diff --git a/.gitignore b/.gitignore index e9d5a44..f9e537c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -downloads/* +downloads/ yt-dlc/ diff --git a/README.md b/README.md index 5036db5..48932e9 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,10 @@ Effortlessly download South Park episodes from southpark.de in bulk ## Setup `git clone https://github.com/xypwn/southpark-de-downloader.git; cd southpark-de-downloader` -`sh init.sh` this will download youtube-dlc and apply a patch for english episodes. +`./init.sh` this will download youtube-dlc and apply a patch for english episodes. ## Usage -`sh southpark-downloader.sh -h` to show usage instructions +`./southpark-downloader.sh -h` to show usage instructions All downloads will end up in the `downloads` folder in the cloned repo (you can also change it in config.sh, if you want to). @@ -16,4 +16,4 @@ All downloads will end up in the `downloads` folder in the cloned repo (you can `./southpark-downloader.sh -s 5 -e 13` download Season 5 Episode 13 -`./southpark-downloader.sh -D -s 1` download Season 2 in German +`./southpark-downloader.sh -D -s 2` download Season 2 in German diff --git a/southpark-downloader.sh b/southpark-downloader.sh index 14d5f2b..c513686 100755 --- a/southpark-downloader.sh +++ b/southpark-downloader.sh @@ -1,9 +1,10 @@ #!/usr/bin/env sh -source ./config.sh +source "$(dirname $0)/config.sh" -YOUTUBE_DL="$PWD/$YOUTUBE_DL" -OUTDIR="$PWD/$SAVEDIR" +# We need absolute paths, since we'll be changing directories later +YOUTUBE_DL="$(readlink -f $(dirname $0))/$YOUTUBE_DL" +OUTDIR="$(readlink -f $(dirname $0))/$SAVEDIR" p_info() { echo -e "\e[32m>>> $@\e[m" @@ -159,7 +160,7 @@ download_all() { done } -[ ! -e "$OUTDIR" ] && mkdir "$OUTDIR" +[ ! -e "$OUTDIR" ] && mkdir -p "$OUTDIR" if [ -n "$OPT_SEASON" ]; then get_season_url "$OPT_SEASON"