jsaddiction / TrailerTech

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

Some trailers not detected without the IMDB ID argument #43

Closed Tippon closed 2 years ago

Tippon commented 2 years ago

First of all, thank you for making this fantastic tool :)

I'm having some small issues getting certain trailers to download though. I tried to download the trailers for The World's End (2013) and Zombieland: Double Tap (2019), but neither of them were found until I added the IMDB ID as an argument through the terminal. The ID is being parsed from the file name, but doesn't seem to be used. The debug log for Zombieland is below:

`media@Media:~/Arr/TrailerTech$ python3 TrailerTech.py -d "/mnt/kids/New Films/Zombieland Double Tap (2019)" 2022-06-04 17:12:06,551 - INFO - TrailerTech - Starting TrailerTech 2022-06-04 17:12:06,551 - INFO - TrailerTech - Parsing "/mnt/kids/New Films/Zombieland Double Tap (2019)" in single movie mode. 2022-06-04 17:12:06,617 - DEBUG - media.movieFolder - Movie Found: Zombieland Double Tap (2019) - {imdb-tt1560220}.mkv 2022-06-04 17:12:06,617 - DEBUG - media.movieFolder - Parsed title from folder: Zombieland Double Tap 2022-06-04 17:12:06,617 - DEBUG - media.movieFolder - Parsed year from folder: 2019 2022-06-04 17:12:06,905 - DEBUG - media.movieFolder - Parsed IMDB from movie file name: 2019 - {imdb-tt1560220} 2022-06-04 17:12:06,905 - DEBUG - media.movieFolder - Parsed title from folder: Zombieland Double Tap 2022-06-04 17:12:06,905 - DEBUG - media.movieFolder - Parsed year from folder: 2019 2022-06-04 17:12:06,905 - DEBUG - providers.tmdb - Getting data from TMDB 2022-06-04 17:12:06,905 - DEBUG - providers.tmdb - Searching by Title and Year: Zombieland Double Tap 2019 2022-06-04 17:12:07,326 - DEBUG - providers.tmdb - TMDB reported "Not Found" 2022-06-04 17:12:07,327 - DEBUG - media.movieFolder - Parsed title from folder: Zombieland Double Tap 2022-06-04 17:12:07,327 - DEBUG - media.movieFolder - Parsed year from folder: 2019 2022-06-04 17:12:07,327 - DEBUG - TrailerTech - Found 0 trailer Links for "Zombieland Double Tap" (2019). 2022-06-04 17:12:07,327 - DEBUG - media.movieFolder - Parsed title from folder: Zombieland Double Tap 2022-06-04 17:12:07,327 - DEBUG - media.movieFolder - Parsed year from folder: 2019 2022-06-04 17:12:07,327 - INFO - TrailerTech - No local or downloadable trailers for "Zombieland Double Tap" (2019) 2022-06-04 17:12:07,327 - INFO - TrailerTech - Cleaning up temp directory. 2022-06-04 17:12:07,327 - INFO - TrailerTech - Script Completed Successfully!

       TrailerTech Stats:
       Movie Directories Scanned: 1
       Trailers Downloaded:       0
       Missing Trailers:          1
       Completed In:              0s

media@Media:~/Arr/TrailerTech$ python3 TrailerTech.py -imdb tt1560220 -d "/mnt/kids/New Films/Zombieland Double Tap (2019)" 2022-06-04 17:20:52,724 - INFO - TrailerTech - Starting TrailerTech 2022-06-04 17:20:52,724 - INFO - TrailerTech - Parsing "/mnt/kids/New Films/Zombieland Double Tap (2019)" in single movie mode. 2022-06-04 17:20:52,834 - DEBUG - media.movieFolder - Movie Found: Zombieland Double Tap (2019) - {imdb-tt1560220}.mkv 2022-06-04 17:20:52,834 - DEBUG - providers.tmdb - Getting data from TMDB 2022-06-04 17:20:52,834 - DEBUG - providers.tmdb - Searching by IMDBid: tt1560220 2022-06-04 17:20:53,969 - DEBUG - providers.apple - Getting movie data from url: https://trailers.apple.com/trailers/sony_pictures/zombieland-double-tap//data/page.json 2022-06-04 17:20:54,575 - DEBUG - media.movieFolder - Parsed title from folder: Zombieland Double Tap 2022-06-04 17:20:54,576 - DEBUG - media.movieFolder - Parsed year from folder: 2019 2022-06-04 17:20:54,576 - DEBUG - TrailerTech - Found 5 trailer Links for "Zombieland Double Tap" (2019). 2022-06-04 17:20:54,576 - DEBUG - TrailerTech - Source: apple, Size: 1080, link: https://movietrailers.apple.com/movies/sony_pictures/zombieland-double-tap/zombieland-double-tap-trailer-1_1080p.mov 2022-06-04 17:20:54,576 - DEBUG - TrailerTech - Source: youtube, Size: 1080, link: https://www.youtube.com/watch?v=ZlW9yhUKlkQ 2022-06-04 17:20:54,576 - DEBUG - TrailerTech - Source: apple, Size: 720, link: https://movietrailers.apple.com/movies/sony_pictures/zombieland-double-tap/zombieland-double-tap-trailer-1_720p.mov 2022-06-04 17:20:54,576 - DEBUG - TrailerTech - Source: apple, Size: 720, link: https://movietrailers.apple.com/movies/sony_pictures/zombieland-double-tap/zombieland-double-tap-trailer-1_a720p.m4v 2022-06-04 17:20:54,576 - DEBUG - TrailerTech - Source: apple, Size: 720, link: https://movietrailers.apple.com/movies/sony_pictures/zombieland-double-tap/zombieland-double-tap-trailer-1_a720p.m4v 2022-06-04 17:20:54,576 - INFO - downloaders.downloader - Attempting to download video at "https://movietrailers.apple.com/movies/sony_pictures/zombieland-double-tap/zombieland-double-tap-trailer-1_1080p.mov". Please Wait... 2022-06-04 17:20:54,991 - WARNING - downloaders.downloader - File too small. URL: https://movietrailers.apple.com/movies/sony_pictures/zombieland-double-tap/zombieland-double-tap-trailer-1_1080p.mov Content-Length: 176 2022-06-04 17:20:54,992 - INFO - downloaders.downloader - Attempting to download video: Zombieland Double Tap (2019) - {imdb-tt1560220}-trailer.mp4 from "https://www.youtube.com/watch?v=ZlW9yhUKlkQ". Please Wait... 2022-06-04 17:20:59,837 - INFO - downloaders.downloader - Download Complete Moving Zombieland Double Tap (2019) - {imdb-tt1560220}-trailer.mp4 to /mnt/kids/New Films/Zombieland Double Tap (2019) 2022-06-04 17:20:59,875 - INFO - TrailerTech - Cleaning up temp directory. 2022-06-04 17:20:59,875 - INFO - TrailerTech - Script Completed Successfully!

       TrailerTech Stats:
       Movie Directories Scanned: 1
       Trailers Downloaded:       1
       Missing Trailers:          0
       Completed In:              7s

New Trailers: Zombieland Double Tap (2019) - {imdb-tt1560220}-trailer.mp4 `

Using python3 TrailerTech.py --use_threads -rd "path" didn't find the trailers either. That gave

'2022-06-04 15:27:07,777 - INFO - TrailerTech - No local or downloadable trailers for "Zombieland Double Tap" (2019)'

I used the Debian manual install as I'm running Xubuntu without Docker, and the requirements are all installed. I don't know if it's related, but I'm getting the 'Script exited with code: 1' error when I try to add the script to Radarr too. I tried changing the ownership and group of my TrailerTech folder, as that seemed to work for #37 but it didn't help.

Please let me know if there's any other info you need. Thanks :)

EDIT: Sorry, I forgot to add my settings. I tried the min_resolution as 720 then 480, just to rule out an issue with the resolution, and I used my API key

'[LOGS] log_level=debug log_to_file=false

[TMDB] api_key=

[TRAILERS] preferred_source=apple min_resolution=480 max_resolution=1080 languages=en

[APPLE] enabled=True

[YOUTUBE] enabled=true'

jsaddiction commented 2 years ago

Not finding the trailer is related to issue #42. When called manually with no user added info like title, year, imdb, tmdb, TrailerTech parses the media directory and tries it's best to decide which movie is represented. It prioritizes xml files with imdb, tmdb, title, year info in them similar to how user defined info is required. (if no ids are found then title and year must be included in the xml). If this is not successful, the last method is to follow a naming convention. Where the movie's filename is named like "Some Movie Title (ttsomeid).ext" It appears that your files are slightly different in that the id is surrounded in curly braces and the type of id is included. I am working on better parsing of these file paths to be more lenient on exact format. This will resolve your issue.

As for the "script exited with code 1" please open a new issue and post a debug log of when you try to add it to radarr and i will look into that as well.

jsaddiction commented 2 years ago

I have merged a fix to the master branch. Please perform a git pull in your install directory. Then remove any trailers from one of the failed directories you listed above and try again. If the fix works we can close this issue.

Tippon commented 2 years ago

Apologies for the slow reply. It's working perfectly now. I removed the trailers for Zombieland: Double Tap, and The World's End, and ran TrailerTech, and it found both trailers.

Thanks again for making TrailerTech :)

EDIT: Apologies, I didn't realise that I could close my issue.