fixed logic in folder creation
This commit is contained in:
parent
3eee731b00
commit
7c606f86c8
1 changed files with 12 additions and 13 deletions
|
@ -1,8 +1,11 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
if [[ -z "$2" ]]; then
|
help()
|
||||||
echo "please provide both parameters"
|
{
|
||||||
exit 1
|
echo "Download all the past broadcasts from a twitch user"
|
||||||
fi
|
echo "Requires 2 Parameters:"
|
||||||
|
echo " -u the username of the twitch user"
|
||||||
|
echo " -f the encoding format for the videos, which are fed to yt-dlp"
|
||||||
|
}
|
||||||
while getopts u:f: flag
|
while getopts u:f: flag
|
||||||
do
|
do
|
||||||
case "${flag}" in
|
case "${flag}" in
|
||||||
|
@ -11,15 +14,11 @@ do
|
||||||
h) help exit;;
|
h) help exit;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
if [[ -z "$2" ]]; then
|
||||||
|
echo "please provide both parameters"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
cd /home/stev/Videos/Twitch/$username || mkdir -v ~/Videos/Twitch/$username
|
cd /home/stev/Videos/Twitch/$username || mkdir -v ~/Videos/Twitch/$username && cd ~/Videos/Twitch/$username
|
||||||
yt-dlp -q -f $format "https://www.twitch.tv/$username/videos?filter=archives&sort=time"
|
yt-dlp -q -f $format "https://www.twitch.tv/$username/videos?filter=archives&sort=time"
|
||||||
|
|
||||||
|
|
||||||
help()
|
|
||||||
{
|
|
||||||
echo "Download all the past broadcasts from a twitch user"
|
|
||||||
echo "Requires 2 Parameters:"
|
|
||||||
echo " -u the username of the twitch user"
|
|
||||||
echo " -f the encoding format for the videos, which are fed to yt-dlp"
|
|
||||||
}
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue