Skip to content

Instantly share code, notes, and snippets.

@kmark
Created September 24, 2013 01:12
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kmark/6679135 to your computer and use it in GitHub Desktop.
Save kmark/6679135 to your computer and use it in GitHub Desktop.
Super simple bash script to repeatedly execute plexDownload.php with the same encoding settings but different media IDs. Great for TV show seasons.
#!/bin/bash
# Copyright 2013 Kevin Mark
# Licensed under the Apache License, Version 2.0
# Will expand upon this script to be more convient, proof of concept right now.
# EXAMPLE USAGE: ./plexDownloadMulti.sh "-h 127.0.0.1:32400 -r 720x480 -b 800" 123 456 789
# Universal encoding settings in quotes is the first param. Space-seperated mediaIds are the rest
# Change the "folderformedia" and make sure it exists. Change the extension too if you want.
DOWNLOAD_OPTIONS=$1
download() {
php plexDownload.php -y $DOWNLOAD_OPTIONS -m $1 -o folderformedia/$2.mp4
}
for (( i = 2; i <= $#; i++ )); do
download ${!i} `expr $i - 1`
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment