Here's a way to auto download videos on a schedule

Avatar image for simonk83
simonk83

20

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#1  Edited By simonk83

DISCLAIMER: This is a lot easier than it looks! Also if someone can tell me what text formatting options are available in this forum I can make this a little easier to read...

I'm a fairly recent premium subscriber and have found myself wanting to set something up to monitor for new episodes of certain series (Mass Alex, Breaking Brad etc) and auto download them (I have them go into a specific folder that is then auto scanned and added to my Plex server for easy viewing and resuming on the go).

I came across this awesome cli script (https://github.com/harryr0se/giant_bomb_cli) by Harryr0se which lets you easily download stuff manually using the command line in your OS of choice (python required) so that was one part of the puzzle. I also started using youtube-dl(https://rg3.github.io/youtube-dl/) recently which has a great way of keeping track of videos you've previously downloaded, and making sure you don't grab them again.

Long story short (not that short, sorry), I ended up bugging Harry to add similar functionality to his script. It works like this (I'm using Linux):

1. Download his script, set it up, test it. There are examples in the readme on his github page, but essentially:

python giant_bomb_cli.py --filter --name "Quick Look: Bad North" --download

for example will download that specific video to the folder you're running the script from.

2. Now, to keep track of files you've already downloaded, create a text file somewhere (same folder makes sense) named whatever you like (I call mine "archive.txt" and amend your command as follows:

python giant_bomb_cli.py --filter --name "Quick Look: Bad North" --download --download-archive /home/simon/Downloads/giant_bomb_cli/archive.txt

Change the path to the archive file depending on where you put it and what you named it, of course.

The script will create a new file called archive.txt.json which it then uses going forward to record the ID's of your downloaded videos, so you can probably just append .json to whatever file you create in the first place if you prefer. I didn't actually test that but I assume it'll work.

3. Now this is fine for downloading individual videos, but if you want to follow a series (lets say Mass Alex), you can instead use the video_show ID instead of the name. Using the following command will dump a list of all available ID's:

python giant_bomb_cli.py --dump_video_shows

This will show you that Mass Alex has a show ID of 39

4. Amend your command as follows:

python giant_bomb_cli.py --filter --video_show_id 39 --download --download-archive /home/simon/Downloads/giant_bomb_cli/archive.txt

5. If you want to save the resulting videos to a different folder (ie a folder that Plex or another service is monitoring), you can use the --output flag, eg:

python giant_bomb_cli.py --filter --video_show_id 39 --download --download-archive /home/simon/Downloads/giant_bomb_cli/archive.txt --output /mnt/nas/GiantBomb

6. So, the first time you run this command it's going to grab every file in the Mass Alex series and download them all, and after each one it'll add that video ID to your archive file so that next time it won't grab them again. The final step is to automate this and have it check daily/weekly/whatever suits you. As I'm using Linux I just set up a crontab, but I'm sure there are easy solutions for Windows (Task Scheduler? I'm a bit behind with Windows to be honest). So the following will have crontab check daily at 5 am for new episodes:

6a. Open crontab

crontab -e

6b. Paste the following, change the time/paths/filenames/show ID's etc to suit you:

0 5 * * * python /path/to/script/folder/giant_bomb_cli.py --filter --video_show_id 39 --download --download-archive /home/simon/Downloads/giant_bomb_cli/archive.txt --output /mnt/nas/GiantBomb

Now, if you want to keep track of more than one series, you'll need to add multiple lines to crontab, essentially just running the script multiple times. I do have an issue open at Harry's github asking if he can add some functionality so that we can download multiple shows ID's just using the one command, but I assume he's a busy man and hasn't gotten around to it yet. Feel free to chime in at his Github.

I may have forgotten stuff here but this is the basic gist. This post looks long and a mess but it's really easy once you get going, and it's pretty great just waking up to new episodes without having to manually check and grab them :)

Huge thanks to Harry for his work amending the script for me, he did it super quickly and was really open to the changes so that's always nice. Good on you Harry, appreciate it :)

Avatar image for delver
Delver

24

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

This is great, thanks so much!

I made some small edits to add the video ID to the start of the filename, and then used the Plex agent here:

https://github.com/rspeicher/GiantBomb.bundle

to autoscrape the details for plex, and make it look all nice.