ozencb / yts-scraper

Download .torrent files from YTS YIFY
MIT License
52 stars 22 forks source link

Program Crashes After %1 and throws KeyError: 'genres' among other things #9

Closed Arefu closed 4 years ago

Arefu commented 4 years ago

Downloading: 1%|▋ | 109/18389 [04:58<13:56:11, 2.74s/Files]Traceback (most recent call last): File "/usr/lib/python3.8/site-packages/YTS_Scraper-0.1.1-py3.8.egg/yts_scraper/main.py", line 153, in main scraper.download() File "/usr/lib/python3.8/site-packages/YTS_Scraper-0.1.1-py3.8.egg/yts_scraper/scraper.py", line 355, in download self.initialize_download() File "/usr/lib/python3.8/site-packages/YTS_Scraper-0.1.1-py3.8.egg/yts_scraper/scraper.py", line 202, in __initialize_download self.filter_torrents(movie) File "/usr/lib/python3.8/site-packages/YTS_Scraper-0.1.1-py3.8.egg/yts_scraper/scraper.py", line 212, in __filter_torrents movie_genres = movie['genres'] KeyError: 'genres' Downloading: 1%|▋`

I am running it using yts-scraper -q 1080p -o torrents

Any idea?

ozencb commented 4 years ago

The KeyError means that one of the movies is lacking genres key data that's necessary for the program to run properly. It seems that YTS's API is not as uniform as I thought, so I should implement some sort of control to catch these cases. I will look into it 👍

ozencb commented 4 years ago

Should be working now. 7bcd2bc3eecb7f39ad9150a949d132fbbcfcefba

Arefu commented 4 years ago

Yeah, I had a feeling it was gonna be something like that lol, I went to add it myself, but yeah nah, python ain't my thing. Cheers for the fast turn around :)