jsaddiction / TrailerTech

Download Trailers for you movies
MIT License
13 stars 4 forks source link

Script stops working when movie is not found in TMDB #14

Closed schlop closed 3 years ago

schlop commented 3 years ago

I get the following error if the script cannot find an entry in TMDB. This occurs when I do a recursive search in a directory via the command line. Any idea why this happens?

2021-01-03 11:17:59,768 - DEBUG - providers.tmdb - Getting data from TMDB
2021-01-03 11:17:59,768 - DEBUG - providers.tmdb - Searching by Title and Year: Locke 2013
2021-01-03 11:18:00,063 - DEBUG - providers.tmdb - TMDB reported "Not Found"
2021-01-03 11:18:00,063 - DEBUG - media.movieFolder - Parsed title from folder: Locke
2021-01-03 11:18:00,064 - DEBUG - media.movieFolder - Parsed year from folder: 2013

Traceback (most recent call last):
  File "TrailerTech.py", line 164, in <module>
    app.main()
  File "TrailerTech.py", line 128, in main
    self.scanLibrary(args.directory)
  File "TrailerTech.py", line 101, in scanLibrary
    self.get_Trailer(path)
  File "TrailerTech.py", line 75, in get_Trailer
    ytLinks = self.tmdb.get_trailer_links(config.languages, config.min_resolution)
  File "/home/deploy/dockercompose/trailertech/providers/tmdb.py", line 63, in get_trailer_links
    for video in self.videos:
TypeError: 'NoneType' object is not iterable
jsaddiction commented 3 years ago

Thanks for reporting the issue!

jsaddiction commented 3 years ago

By the way Locke was released in 2014 according to TMDB There is one 1080 trailer listed in there. Try the following CLI python3 TrailerTech.py -t "Locke" -y 2014 -d "/movie/folder"