diff --git a/README.md b/README.md index 1945b66..9ca6dd6 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Just download this repo and rename youtube_stuffs.db.def to youtube_stuffs.db - fzf - sqlite3 - sed -- youtube-dl +- yt-dlp ## optional requirements - chafa # for image previews diff --git a/fetch.sh b/fetch.sh index b7cd255..e2d8e67 100755 --- a/fetch.sh +++ b/fetch.sh @@ -5,14 +5,14 @@ # cant do whats below because i need to replace all ' within a subset of 'string' with '' to escape it. -# youtube-dl --get-filename -o "insert into ytlist values('%(title)s','%(channel)s','%(id)s','shorts','');" "https://www.youtube.com/playlist?list=PLwpvCCyacwS9Us6F1_UUUre1Py9p4ex4J" 2> out2.txt #| sed "s/'/''/g" #| sqlite3 ./youtube_stuffs.db +# yt-dlp --get-filename -o "insert into ytlist values('%(title)s','%(channel)s','%(id)s','shorts','');" "https://www.youtube.com/playlist?list=PLwpvCCyacwS9Us6F1_UUUre1Py9p4ex4J" 2> out2.txt #| sed "s/'/''/g" #| sqlite3 ./youtube_stuffs.db cd "$(dirname "$0")" file="./download.txt" if [ "$1" ]; then [ -z "$2" ] && echo playlist not defined. continue? && read -p "continue? (press any key)" - youtube-dl --get-filename -o "%(title)s----%(id)s----%(channel)s" "$1" > "$file" 2> download_err.txt + yt-dlp --get-filename -o "%(title)s----%(id)s----%(channel)s" "$1" > "$file" 2> download_err.txt printf "\n\n" i=1 @@ -39,7 +39,7 @@ while :; do urlid="$(sqlite3 ./youtube_stuffs.db 'select id from ytlist where rowid='$i';')" if [ -z "$(ls -l thumbnails | grep ".$urlid")" ]; then printf "$i::$urlid\n" - thumbnailurl="$(youtube-dl --get-thumbnail "https://youtube.com/watch?v=$urlid" 2> thumberr.txt)" + thumbnailurl="$(yt-dlp --get-thumbnail "https://youtube.com/watch?v=$urlid" 2> thumberr.txt)" ext="$(printf "$thumbnailurl" | sed 's/.*\.//g' | sed 's/?.*//')" wget "$thumbnailurl" -O "thumbnails/$urlid.$ext" fi