Update downloaders and improve ytdldown

This commit is contained in:
Alex 2020-05-10 14:18:37 +02:00
parent bc8cf13ba2
commit edd02ba6c0
Signed by: caskd
GPG Key ID: F92BA85F61F4C173
2 changed files with 14 additions and 6 deletions

View File

@ -1,5 +1,5 @@
alias recordscreen='ffmpeg -hwaccel vdpau -video_size 1920x1080 -framerate 60 -f x11grab -i :0 -c:v libx264rgb -crf 0 -preset ultrafast -movflags +faststart -tune zerolatency'
alias ytdldown='youtube-dl --no-part --newline -ixcw --audio-format best --add-metadata --embed-thumbnail -o "/home/caskd/Media/Music/%(album)s/%(track)s.%(ext)s"'
alias ytdldown='youtube-dl --no-part --newline -ixcw -R infinite --audio-format best --add-metadata --embed-thumbnail -o "/home/caskd/Media/Music/%(album)s/%(track_number)s - %(track)s.%(ext)s"'
alias ls='ls --color=auto'
alias grep='grep --color=auto'
alias diff='diff --color=auto'

View File

@ -14,17 +14,25 @@ function ffmpeg-compress {
ffmpeg -hwaccel vdpau -i $1 -vf "normalize,scale=480:-1:flags=spline,mpdecimate" $2
}
function getnhentai {
for i in {1..$1}; do
curl -sSLO --fail https://i.nhentai.net/galleries/${2}/${i}.png || \
curl -sSLO --fail https://i.nhentai.net/galleries/${2}/${i}.jpg;
local pageinfo="$(curl -sL "$1" | grep -oP '(?<=var gallery = new N.gallery\().*(?=\);)')"
local media_id=$(print $pageinfo | jq -r '.media_id')
local types=($(print $pageinfo | jq -r '.images.pages[].t'))
local urls=()
for i in {0..$(print $pageinfo | jq '.num_pages')}; do
local itoc=$(($i + 1))
[[ ${types[$i]} == p ]] && local type=png || local type=jpg
urls+=("https://i.nhentai.net/galleries/$media_id/$itoc.$type")
done
curl -L --remote-name-all ${urls}
for i in {1..9}.*; do
mv $i 0$i;
done
}
function gethanime {
local ID=$(curl -sSL "https://members.hanime.tv/api/v3/videos_manifests/$1" -H 'x-directive: api' | jq -e '.videos_manifest.servers[].streams | sort_by(.width) | .[-1].id')
[ ! -z $ID ] && ffmpeg -i "https://hanime.tv/api/v1/m3u8s/$ID.m3u8" -c:v copy ${2:-$1.mp4}
local IDS=($(curl -sSL "https://members.hanime.tv/api/v3/videos_manifests/$1" -H 'x-directive: api' | jq -e '.videos_manifest.servers[].streams | sort_by(.width) | .[].id'))
for i in $IDS; do
[ ! -z $i ] && ffmpeg -i "https://hanime.tv/api/v1/m3u8s/$i.m3u8" -c:v copy ${2:-$1.mkv} && break
done
}
function man {
LESS_TERMCAP_md=$'\e[01;31m' \