Created
July 16, 2019 19:52
-
-
Save kinoute/f8c9b9435ffe116d23546dde83e512d4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
shopt -s nullglob | |
downloadFromFile(){ | |
while read -r URL <&3; do | |
wget --content-disposition $(echo $URL | tr -d '\r') -P "$1/" | |
done 3<"$2" | |
} | |
for d in *; do | |
if [ -d "$d" ]; then | |
VIDEOS_TXT=$(ls "$d"/*.txt) | |
if [ -n "$VIDEOS_TXT" ]; then | |
downloadFromFile "$d" "$VIDEOS_TXT" | |
fi | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment