Skip to content
This repository was archived by the owner on Apr 4, 2024. It is now read-only.
This repository was 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

@anonymouscowards

Description

@anonymouscowards

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions