jackz revised this gist . Go to revision
No changes
Jackz revised this gist . Go to revision
1 file changed, 7 insertions, 6 deletions
download_youtube.sh
@@ -1,13 +1,14 @@ | |||
1 | 1 | #!/bin/bash | |
2 | 2 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | |
3 | 3 | if [[ "$#" -lt 1 ]]; then #if less than 1 | |
4 | - | echo "Usage: ./download.sh <youtube url> [name of file] " | |
5 | - | exit 2 | |
4 | + | echo "Usage: ./download.sh <youtube url> [name of file] " | |
5 | + | exit 2 | |
6 | 6 | fi | |
7 | 7 | if [[ "$#" -ne 2 ]]; then | |
8 | - | echo Downloading $1 | |
9 | - | youtube-dl -f 'bestaudio[ext=m4a]' "$1" --output "$DIR/%(id)s.%(ext)s" --add-metadata --write-all-thumbnails --embed-thumbnail --write-info-json --embed-subs --all-subs --no-playlist | |
8 | + | echo Downloading $1 | |
9 | + | OUTPUT="$DIR/%(id)s.%(ext)s" | |
10 | 10 | else | |
11 | - | echo Downloading $1 as $2 | |
12 | - | youtube-dl -f 'bestaudio[ext=m4a]' "$1" --output "$DIR/$2.%(ext)s" --add-metadata --write-all-thumbnails --embed-thumbnail --write-info-json --embed-subs --all-subs --no-playlist | |
11 | + | echo Downloading $1 as $2 | |
12 | + | OUTPUT="$DIR/$2.%(ext)s" | |
13 | 13 | fi | |
14 | + | youtube-dl -f 'bestaudio[ext=m4a]' "$1" --output $OUTPUT --add-metadata --embed-thumbnail --no-playlist |
Jackz revised this gist . Go to revision
1 file changed, 3 insertions, 3 deletions
download_youtube.sh
@@ -4,10 +4,10 @@ if [[ "$#" -lt 1 ]]; then #if less than 1 | |||
4 | 4 | echo "Usage: ./download.sh <youtube url> [name of file] " | |
5 | 5 | exit 2 | |
6 | 6 | fi | |
7 | - | if [[ "$#" -ne 2 ]]; then | |
7 | + | if [[ "$#" -ne 2 ]]; then | |
8 | 8 | echo Downloading $1 | |
9 | - | youtube-dl -f 'bestaudio[ext=m4a]' "$1" --output "$DIR/%(id)s.%(ext)s" --add-metadata --write-all-thumbnails --embed-thumbnail --write-info-json --embed-subs --all-subs | |
9 | + | youtube-dl -f 'bestaudio[ext=m4a]' "$1" --output "$DIR/%(id)s.%(ext)s" --add-metadata --write-all-thumbnails --embed-thumbnail --write-info-json --embed-subs --all-subs --no-playlist | |
10 | 10 | else | |
11 | 11 | echo Downloading $1 as $2 | |
12 | - | youtube-dl -f 'bestaudio[ext=m4a]' "$1" --output "$DIR/$2.%(ext)s" --add-metadata --write-all-thumbnails --embed-thumbnail --write-info-json --embed-subs --all-subs | |
12 | + | youtube-dl -f 'bestaudio[ext=m4a]' "$1" --output "$DIR/$2.%(ext)s" --add-metadata --write-all-thumbnails --embed-thumbnail --write-info-json --embed-subs --all-subs --no-playlist | |
13 | 13 | fi |
Jackz revised this gist . Go to revision
1 file changed, 2 insertions, 2 deletions
download_youtube.sh
@@ -6,8 +6,8 @@ if [[ "$#" -lt 1 ]]; then #if less than 1 | |||
6 | 6 | fi | |
7 | 7 | if [[ "$#" -ne 2 ]]; then | |
8 | 8 | echo Downloading $1 | |
9 | - | youtube-dl -f 'bestaudio[ext=m4a]' "$1" --output "$DIR/%(id)s.%(ext)s" | |
9 | + | youtube-dl -f 'bestaudio[ext=m4a]' "$1" --output "$DIR/%(id)s.%(ext)s" --add-metadata --write-all-thumbnails --embed-thumbnail --write-info-json --embed-subs --all-subs | |
10 | 10 | else | |
11 | 11 | echo Downloading $1 as $2 | |
12 | - | youtube-dl -f 'bestaudio[ext=m4a]' "$1" --output "$DIR/$2.%(ext)s" | |
12 | + | youtube-dl -f 'bestaudio[ext=m4a]' "$1" --output "$DIR/$2.%(ext)s" --add-metadata --write-all-thumbnails --embed-thumbnail --write-info-json --embed-subs --all-subs | |
13 | 13 | fi |
Jackz revised this gist . Go to revision
1 file changed, 13 insertions
download_youtube.sh(file created)
@@ -0,0 +1,13 @@ | |||
1 | + | #!/bin/bash | |
2 | + | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | |
3 | + | if [[ "$#" -lt 1 ]]; then #if less than 1 | |
4 | + | echo "Usage: ./download.sh <youtube url> [name of file] " | |
5 | + | exit 2 | |
6 | + | fi | |
7 | + | if [[ "$#" -ne 2 ]]; then | |
8 | + | echo Downloading $1 | |
9 | + | youtube-dl -f 'bestaudio[ext=m4a]' "$1" --output "$DIR/%(id)s.%(ext)s" | |
10 | + | else | |
11 | + | echo Downloading $1 as $2 | |
12 | + | youtube-dl -f 'bestaudio[ext=m4a]' "$1" --output "$DIR/$2.%(ext)s" | |
13 | + | fi |