Last active
January 31, 2022 05:26
-
-
Save duracell80/b7ce8c159c258ccc6bb09d7356cac220 to your computer and use it in GitHub Desktop.
Faster youtube-dl
This file contains hidden or 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 | |
echo "$1" >> ./yt-dl.txt |
This file contains hidden or 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
https://www.youtube.com/watch?v=p8NqfwhrLxE | |
https://www.youtube.com/watch?v=ZdoMlrSddQU |
This file contains hidden or 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 | |
#rm -rf *.part | |
youtube-dl --external-downloader aria2c --external-downloader-args '-c -j 10 -x 10 -s 10 -k 1M' -f 'bestvideo[height<=720]+bestaudio/best[height<=720]' -a yt-dl.txt | |
FILENAME="yt-dl.txt" | |
LINES=$(cat "${FILENAME}") | |
for VIDEO in $LINES | |
do | |
IFS='v=' | |
read -a VID <<< "$VIDEO" | |
if ls *${VID[2]}* 1> /dev/null 2>&1; then | |
if ls *${VID[2]}*.part.aria2 1> /dev/null 2>&1; then | |
echo "Failed download for Video ID ${VID[2]}. Deleting chunks, leaving URL in download list." | |
rm *${VID[2]}* | |
else | |
echo "Successful download. Removing Video ID ${VID[2]} URL from download list." | |
gawk -i inplace '/$VID[2]/' $FILENAME | |
fi | |
fi | |
done | |
mv *.mp4 ../ | |
mv *.webm ../ | |
mv *.mkv ../ | |
mv *.mp4 ../ | |
mv *.webm ../ | |
mv *.mkv ../ |
This file contains hidden or 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 | |
#rm -rf *.part | |
youtube-dl --external-downloader aria2c --external-downloader-args '-c -j 15 -x 15 -s 15 -k 1M' -f 'bestvideo[height<=2160]+bestaudio/best[height<=2160]' -a yt-dl.txt | |
FILENAME="yt-dl.txt" | |
LINES=$(cat "${FILENAME}") | |
for VIDEO in $LINES | |
do | |
IFS='v=' | |
read -a VID <<< "$VIDEO" | |
if ls *${VID[2]}* 1> /dev/null 2>&1; then | |
if ls *${VID[2]}*.part.aria2 1> /dev/null 2>&1; then | |
echo "Failed download for Video ID ${VID[2]}. Deleting chunks, leaving URL in download list." | |
rm *${VID[2]}* | |
else | |
echo "Successful download. Removing Video ID ${VID[2]} URL from download list." | |
gawk -i inplace '/$VID[2]/' $FILENAME | |
fi | |
fi | |
done | |
mv *.mp4 ../ | |
mv *.webm ../ | |
mv *.mkv ../ |
This file contains hidden or 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 | |
chmod a+x *.sh | |
sudo apt-get update | |
sudo apt-get install -y aria2 youtube-dl | |
pip3 install --upgrade youtube-dl |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment