Jump to content


Photo

[Linux Script] Download YT Trailers from .nfo to local movie folder


  • Please log in to reply
15 replies to this topic

#1 sualfred OFFLINE  

sualfred

    The Embuary guy

  • Developers
  • 1839 posts
  • Local time: 04:44 PM
  • LocationGermany

Posted 16 May 2018 - 03:51 AM

I faced a lot of broken trailer links in my movie collection these days so I decided to switch over to store the trailers locally in my media folders.

To save a lot of time I've made this small bash script, which downloads the YT Trailer by fetching the TheMovieDB ID right out the existing movie nfo.

 

Link:

https://raw.githubus...dl/trailerdl.sh

 

Requirements:

  • Linux KnowHow
  • A own TheMovieDB API (see https://developers.themoviedb.org/3 )
  • youtube-dl / curl / jq
  • Adjustment of the paths inside of the script
  • A clean folder structure without additional and unnecessary nfo's

 

The trailers are going to be stored next to the movie with the prefix "-trailer".

 

You will get a trailerdl.log after each run to check which movies don't have a YT ID or if the download has failed.

Please visit https://themoviedb.org and edit or add new trailer links so other users can benefit. (I spent the last 2 hours adding 100< updated trailer url's)

 

And before I forget it:

The script is quick'n'dirty,  but it's working. Feel free to adjust it if you want, but don't hope for support from my side -> Just sharing it.

If you want to say thanks: A beer is appreciated ;)


Edited by sualfred, 16 May 2018 - 10:16 AM.

  • CBers, vze22jjw, neik and 2 others like this

#2 sualfred OFFLINE  

sualfred

    The Embuary guy

  • Developers
  • 1839 posts
  • Local time: 04:44 PM
  • LocationGermany

Posted 16 May 2018 - 08:43 AM

Reworked the script to use the themoviedb API.



#3 vitaminb OFFLINE  

vitaminb

    Newbie

  • Members
  • 1 posts
  • Local time: 04:44 PM

Posted 05 August 2018 - 03:19 PM

thank you! works like a charm  :)



#4 vze22jjw OFFLINE  

vze22jjw

    Newbie

  • Members
  • 9 posts
  • Local time: 09:44 AM

Posted 30 December 2018 - 08:19 PM

I just ran across this and works great with minimal effort! Yes you need some linux skill, but with a firetv and no access to youtube trailers this is a great workaround.  Respect!


  • neik likes this

#5 neik OFFLINE  

neik

    Advanced Member

  • Members
  • 670 posts
  • Local time: 04:44 PM

Posted 01 January 2019 - 09:38 AM

Danke, @sualfred!

 

Does this also work for series?


Edited by neik, 01 January 2019 - 10:08 AM.

  • syralk likes this

#6 sualfred OFFLINE  

sualfred

    The Embuary guy

  • Developers
  • 1839 posts
  • Local time: 04:44 PM
  • LocationGermany

Posted 01 January 2019 - 10:20 AM

Only for movies. 



#7 nagetech OFFLINE  

nagetech

    Advanced Member

  • Members
  • 310 posts
  • Local time: 10:44 AM

Posted 05 January 2019 - 12:04 PM

This script looks super handy! Is there a way to accomplish this in Windows?



#8 sualfred OFFLINE  

sualfred

    The Embuary guy

  • Developers
  • 1839 posts
  • Local time: 04:44 PM
  • LocationGermany

Posted 05 January 2019 - 05:13 PM

Just use the Linux subsystem of windows:

 

https://docs.microso...l/install-win10



#9 nagetech OFFLINE  

nagetech

    Advanced Member

  • Members
  • 310 posts
  • Local time: 10:44 AM

Posted 05 January 2019 - 05:14 PM

Thanks for that share! I'm actually running Server 2012, would that still work?



#10 syralk OFFLINE  

syralk

    Advanced Member

  • Members
  • 226 posts
  • Local time: 11:44 AM

Posted 13 January 2019 - 01:48 PM

Thanks for that share! I'm actually running Server 2012, would that still work?

 

Hi @nagetech, I have a similar setup, emby are running in windows

so the setup I did is

1. Share your drive in Windows for network accesss

2. Install Linux in Hyper-V

3. connect your share drive in linux

4. Run the scripts in Linux using your share windows access

5. then at the bottom of the script add 

 

curl --data '' "http://[emby_local_ip]:[emby_local_port]/Emby/Library/Refresh?api_key=[emby_api]"



#11 syralk OFFLINE  

syralk

    Advanced Member

  • Members
  • 226 posts
  • Local time: 11:44 AM

Posted 22 April 2019 - 01:08 PM

@sualfred

 

just to let you know I was able to edit your script to auto download TV Shows trailer

 

https://raw.githubus...ilerdl_shows.sh

fell free to share or edit it :)


  • sualfred and neik like this

#12 neik OFFLINE  

neik

    Advanced Member

  • Members
  • 670 posts
  • Local time: 04:44 PM

Posted 22 April 2019 - 04:45 PM

Thanks a lot for sharing your work, very much appreciated. :-)

Hoppefully I can give both a try in the next couple of days. 



#13 mickmik OFFLINE  

mickmik

    Member

  • Members
  • 10 posts
  • Local time: 04:44 PM

Posted 11 June 2019 - 12:13 AM

Thanks ! Really useful !



#14 neik OFFLINE  

neik

    Advanced Member

  • Members
  • 670 posts
  • Local time: 04:44 PM

Posted 19 June 2019 - 04:18 AM

Fyi, for all who want use the script with a flat folder structure, that does not work.
I had to move my files to a more "complex" structure: /movies/moviename (year)/moviename.ext
Thanks @sualfred for clarifying this. :-)

@syralk, right know the script is downloading one trailer, would it be possible to download a trailer for each season?
@Luke, does Emby support multiple trailers (one for each season) at all?

#15 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 131233 posts
  • Local time: 10:44 AM

Posted 19 June 2019 - 09:52 AM

Yes.

#16 syralk OFFLINE  

syralk

    Advanced Member

  • Members
  • 226 posts
  • Local time: 11:44 AM

Posted 05 July 2019 - 01:27 PM

Hi @neik

I think it could be possible I will do some testing and come back to you on this :)

 

 

Fyi, for all who want use the script with a flat folder structure, that does not work.
I had to move my files to a more "complex" structure: /movies/moviename (year)/moviename.ext
Thanks @sualfred for clarifying this. :-)

@syralk, right know the script is downloading one trailer, would it be possible to download a trailer for each season?
@Luke, does Emby support multiple trailers (one for each season) at all?


  • neik likes this




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users