Cambiar youtube-dl por yt-dlp

This commit is contained in:
deadguy 2021-12-24 14:47:19 -03:00
parent 2756b1b8d4
commit 429a4839f1
Signed by: dgy
GPG Key ID: 37CA55B52CF63730
4 changed files with 44 additions and 39 deletions

View File

@ -1,10 +1,10 @@
#!/bin/sh
youtube-dl --add-metadata -icx --no-cache-dir --no-call-home --audio-format mp3 --audio-quality 0 --prefer-ffmpeg --no-post-overwrites --geo-bypass -o "$HOME/mus/%(artist)s/%(album)s/%(artist)s - %(album)s - %(track_number)d %(track)s.%(ext)s" "$1"
yt-dlp --add-metadata -ix --no-cache-dir --audio-format mp3 --audio-quality 0 --no-post-overwrites --geo-bypass -o "$HOME/mus/%(artist)s/%(album)s/%(artist)s - %(album)s - %(track_number)d %(track)s.%(ext)s" "$1"
echo "Buscando la tapa..."
HTML_TEMP=$(mktemp)
curl -s "$1" > "$HTML_TEMP"
curl -s "$1" >"$HTML_TEMP"
titulo=$(grep -Po "<title>.*</title>" "$HTML_TEMP" | sed 's/<[^>]*>//g')
disco=${titulo% | *}
grupo=${titulo#* | }

View File

@ -3,15 +3,21 @@
# used for newsboat
# If no url given. Opens browser. For using script as $BROWSER.
[ -z "$1" ] && { "$BROWSER"; exit; }
[ -z "$1" ] && {
"$BROWSER"
exit
}
case "$1" in
*mkv|*webm|*mp4|*youtube.com/watch*|*youtube.com/playlist*|*youtu.be*|*hooktube.com*|*bitchute.com*)
setsid -f mpv -quiet "$1" >/dev/null 2>&1 ;;
*png|*jpg|*jpe|*jpeg|*gif)
curl -sL "$1" > "/tmp/$(echo "$1" | sed "s/.*\///")" && sxiv -N "flota" -bpa "/tmp/$(echo "$1" | sed "s/.*\///")" >/dev/null 2>&1 &
;;
*)
if [ -f "$1" ]; then "$TERMINAL" -e "$EDITOR" "$1"
else setsid -f "$BROWSER" "$1" >/dev/null 2>&1; fi ;;
*mkv | *webm | *mp4 | *youtube.com/watch* | *youtube.com/playlist* | *youtu.be* | *hooktube.com* | *bitchute.com* | *v.redd.it*)
setsid -f mpv -quiet "$1" >/dev/null 2>&1
;;
*png | *jpg | *jpe | *jpeg | *gif)
curl -sL "$1" >"/tmp/$(echo "$1" | sed "s/.*\///")" && sxiv -N "flota" -bpa "/tmp/$(echo "$1" | sed "s/.*\///")" >/dev/null 2>&1 &
;;
*)
if [ -f "$1" ]; then
"$TERMINAL" -e "$EDITOR" "$1"
else setsid -f "$BROWSER" "$1" >/dev/null 2>&1; fi
;;
esac

2
ytdl
View File

@ -1,3 +1,3 @@
#!/bin/sh
youtube-dl --add-metadata --youtube-skip-dash-manifest -ic --no-call-home --no-cache-dir --geo-bypass -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best' -o "/mnt/samsung/necropolis/vid/%(title)s.%(ext)s" "$@"
yt-dlp --add-metadata --no-youtube-include-dash-manifest -i --no-cache-dir --geo-bypass -P "/mnt/samsung/necropolis/vid/" -o "%(title)s.%(ext)s" "$@"

53
zu
View File

@ -1,35 +1,34 @@
#!/bin/sh
archive="$(readlink -f "$*")" &&
directory="$(echo "$archive" | sed 's/\.[^\/.]*$//')" &&
mkdir -p "$directory" &&
cd "$directory" || exit
directory="$(echo "$archive" | sed 's/\.[^\/.]*$//')" &&
mkdir -p "$directory" &&
cd "$directory" || exit
[ "$archive" = "" ] && printf "Give archive to extract as argument.\\n" && exit
if [ -f "$archive" ] ; then
case "$archive" in
*.tar.bz2|*.tbz2) tar xvjf "$archive" ;;
*.tar.xz|*.txz) tar -xvJf "$archive" ;;
*.tar.gz|*.tgz) tar xvzf "$archive" ;;
*.tar.zst) tar --zstd -xvf "$archive" ;;
*.tar.lz) tar --lzip -xvf "$archive" ;;
*.tar) tar xvf "$archive" ;;
*.lzma) unlzma "$archive" ;;
*.bz2) bunzip2 "$archive" ;;
*.rar) unrar x -ad "$archive" ;;
*.gz) gunzip "$archive" ;;
*.tar) tar xvf "$archive" ;;
*.zip|*.ZIP) unzip "$archive" ;;
*.zstd) unzstd "$archive" ;;
*.Z) uncompress "$archive" ;;
*.7z) 7z x "$archive" ;;
*.xz) unxz "$archive" ;;
*.deb|*.ar) ar -x "$archive" ;;
*.rpm) 7z x "$archive" ;;
*.exe) cabextract "$archive" ;;
*) printf "extract: '%s' - unknown archive method\\n" "$archive" ;;
esac
if [ -f "$archive" ]; then
case "$archive" in
*.tar.bz2 | *.tbz2) tar xvjf "$archive" ;;
*.tar.xz | *.txz) tar -xvJf "$archive" ;;
*.tar.gz | *.tgz) tar xvzf "$archive" ;;
*.tar.zst) tar --zstd -xvf "$archive" ;;
*.tar.lz) tar --lzip -xvf "$archive" ;;
*.lzma) unlzma "$archive" ;;
*.bz2) bunzip2 "$archive" ;;
*.rar) unrar x -ad "$archive" ;;
*.gz) gunzip "$archive" ;;
*.tar) tar xvf "$archive" ;;
*.zip | *.ZIP | *.cbz) unzip "$archive" ;;
*.zstd) unzstd "$archive" ;;
*.Z) uncompress "$archive" ;;
*.7z) 7z x "$archive" ;;
*.xz) unxz "$archive" ;;
*.deb | *.ar) ar -x "$archive" ;;
*.rpm) 7z x "$archive" ;;
*.exe) cabextract "$archive" ;;
*) printf "extract: '%s' - unknown archive method\\n" "$archive" ;;
esac
else
printf "File \"%s\" not found.\\n" "$archive"
printf "File \"%s\" not found.\\n" "$archive"
fi