Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

KeyError: 'tag' for parsing scene tag results when running scrapeScenes.py #56

Open
anonymouscowards opened this issue Oct 29, 2023 · 0 comments

Comments

@anonymouscowards
Copy link

I believe that tpdb likely changed their api results format for scenes sometime this year when it comes to scene tags. When running scrapeScenes.py and a successful hit occurs, it fails to update the scene with the following error:

ERROR:root:Scrape succeeded, but update failed:
Traceback (most recent call last):
  File "/mnt/d/GIT/stash_theporndb_scraper/scrapeScenes.py", line 752, in updateSceneFromScrape
    tag_name = tag_dict['tag'].replace('-', ' ').replace('(', '').replace(')', '').strip().title()
KeyError: 'tag'

The tag results is a list of dictionaries under 'data.tags' in the json return, simplified example below:

[
  {
    "id": 2,
    "name": "Sex"
  },
  {
    "id": 29,
    "name": "Blowjob"
  }
]

If I comment out the portion for tagging, the update succeeds (without tags).
Any chance the scraper logic can be updated to account for this?
Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant