ютубчик в фоне
youtube-dl --get-filename -o '"%(title)s"' -g https://www.youtube.com/watch?v=ACVgtWyu6ks | awk 'BEGIN{FS=RS;RS=""}{print $1" --input-slave "$2" --meta-title "$3}' | xargs vlc
Объясни мне часть awk кода по буквам/слогам )) {FS=RS;RS=""}
словоFSсловоFSсловоRSсловоFSсловоFSсловоRS...<EOF>
словоFSсловоFSсловоFSслово...<EOF>
то чем после этого разделены переменные $1,$2,$3 ?
$ echo "слово1 слово2\nслово3 слово4" | awk 'BEGIN{FS=RS;RS=""}{print $1,"fff",$2}'
слово1 слово2 fff слово3 слово4
$ echo "слово1 слово2\nслово3 слово4" | awk 'BEGIN{FS=RS;RS=""}{print $1"fff"$2}'
слово1 слово2fffслово3 слово4
Почему не получается сплошной/безпробельной строки, склеенных между собой переменных?
... | awk 'BEGIN{FS=RS;RS=""}{print $2" --input-slave "$3" --meta-title \""$1"\"" }' | xargs vlc
а если нет никакой разницы, то зачем городить лишний код? ))
mpv https://www.youtube.com/watch?v=KTji1hOICEI
mpv --ytdl-format="bestvideo[height<=?1080]+bestaudio" https://www.youtube.com/watch?v=KTji1hOICEI
youtube-dl -ge https://www.youtube.com/watch?v=KTji1hOICEI | awk 'BEGIN{FS=RS;RS=""}{print $2" --input-slave "$3" --meta-title "$1}' | xargs vlc
youtube-dl --format="bestvideo[height<=?1080]+bestaudio" -ge https://www.youtube.com/watch?v=KTji1hOICEI | awk 'BEGIN{FS=RS;RS=""}{print $2" --input-slave "$3" --meta-title "$1}' | xargs vlc
у меня и в лисе и в хромом стоит дополнение Open With
но почему тогда не прокатывает твой код (я немного подправил)
$ x=($(youtube-dl -ge https://www.youtube.com/watch?v=ACVgtWyu6ks)) && echo ${x[1]} --input-slave ${x[2]} --meta-title ${x[0]}
в --input-slave Нидерландах --meta-title Чиновники
IFS1="$IFS";IFS=$'\n';x=($(youtube-dl -ge https://www.youtube.com/watch?v=ACVgtWyu6ks));IFS="$IFS1" && vlc ${x[1]} --input-slave ${x[2]} --meta-title "${x[0]}"
для MPV ничего не нужно, кроме установленного youtube-dl
всё работает ис каропки ))
youtube-dl -ge https://www.youtube.com/watch?v=ACVgtWyu6ks | awk 'BEGIN{FS=RS;RS=""}{print $2" --input-slave "$3" --meta-title "$1}' | xargs vlc
youtube-dl -g https://www.youtube.com/watch?v=yfHQCNPTios | awk 'BEGIN{FS=RS;RS=" "}{print $1" --input-slave "$2}' | xargs vlc
youtube-dl -g https://www.youtube.com/watch?v=yfHQCNPTios | tr "\n" " " | awk '{print "\""$1"\"","--input-slave","\""$2"\""}'
"https://r2---sn-jvgcpo503g-3c2e.googlevideo.com/videoplayback?expire=1622420609&ei=IdizYIKaOIrR7gOf6rXYDQ&ip=91.210.251.66&id=o-AMtwnjnAv2UYuspoEa2lwPHqdEmBF44fe_yUxJYgdKPF&itag=248&aitags=133%2C134%2C135%2C136%2C137%2C160%2C242%2C243%2C244%2C247%2C248%2C278&source=youtube&requiressl=yes&mh=hv&mm=31%2C29&mn=sn-jvgcpo503g-3c2e%2Csn-3c27snel&ms=au%2Crdu&mv=m&mvi=2&pl=24&initcwndbps=1168750&vprv=1&mime=video%2Fwebm&ns=NoDg_3LUSSIAfy61So0JwYwF&gir=yes&clen=97044422&dur=824.240&lmt=1622314577614067&mt=1622398606&fvip=5&keepalive=yes&fexp=24001373%2C24007246&c=WEB&txp=5535432&n=s-6IenEl5G4bCg5O&sparams=expire%2Cei%2Cip%2Cid%2Caitags%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cns%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRQIhAPyBvnPwmZbppfM4Rn84mWDcaUpmFG9ZiRiToVqo1y0wAiBXjaClh4fj4a1SuV6PNsWSLs6SbFfaACvBMFoWIQ62Fg%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIhAO4_LIQsF12wyDMJPFrES1ceZVnSwB8O3bF9XY5fk3lxAiBxmNqFH4bl6lAMMBjIfAhDaBlH1uVotZp1nLmYz-b18g%3D%3D" --input-slave "https://r2---sn-jvgcpo503g-3c2e.googlevideo.com/videoplayback?expire=1622420609&ei=IdizYIKaOIrR7gOf6rXYDQ&ip=91.210.251.66&id=o-AMtwnjnAv2UYuspoEa2lwPHqdEmBF44fe_yUxJYgdKPF&itag=251&source=youtube&requiressl=yes&mh=hv&mm=31%2C29&mn=sn-jvgcpo503g-3c2e%2Csn-3c27snel&ms=au%2Crdu&mv=m&mvi=2&pl=24&initcwndbps=1168750&vprv=1&mime=audio%2Fwebm&ns=NoDg_3LUSSIAfy61So0JwYwF&gir=yes&clen=15272581&dur=824.281&lmt=1622308955458940&mt=1622398606&fvip=5&keepalive=yes&fexp=24001373%2C24007246&c=WEB&txp=5511222&n=s-6IenEl5G4bCg5O&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cns%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRQIgBaIS7YRfb-kWeb-GnfeMp6Gonz2yzG2Y5kBCOmukTUECIQDh8tJ1rpJKqXcoX16lQ6aYJj6MBUrGPnojcSitLVHbJg%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIhAO4_LIQsF12wyDMJPFrES1ceZVnSwB8O3bF9XY5fk3lxAiBxmNqFH4bl6lAMMBjIfAhDaBlH1uVotZp1nLmYz-b18g%3D%3D"
A=$(youtube-dl --get-url https://www.youtube.com/watch?v=VFf4r1D3qBU) ;echo $A |sed 's|\r?\n||g' | awk '{print "\"",$1,"\" --input-slave \"",$2,"\"" }'
" https://r1---sn-jvgcpo503g-3c2e.googlevideo.com/videoplayback?expire=1622420773&ei=xdizYP_cJsuzgAe-lJKoBg&ip=91.210.251.66&id=o-ANJurwz1EcW1Fc5VPavxa3LChBZ0msu6EanDAePP-kIF&itag=247&aitags=133%2C134%2C135%2C136%2C160%2C242%2C243%2C244%2C247%2C278&source=youtube&requiressl=yes&mh=Fe&mm=31%2C29&mn=sn-jvgcpo503g-3c2e%2Csn-3c27sn76&ms=au%2Crdu&mv=m&mvi=1&pl=24&initcwndbps=1222500&vprv=1&mime=video%2Fwebm&ns=HtFF4eEWFwb-2N8H4pRiD80F&gir=yes&clen=5887953&dur=426.800&lmt=1542400221894943&mt=1622398847&fvip=13&keepalive=yes&fexp=24001373%2C24007246&beids=9466588&c=WEB&txp=5432432&n=24upQ4_DPUYh9tzW&sparams=expire%2Cei%2Cip%2Cid%2Caitags%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cns%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRQIgbv9RLzFr5LjfC4J9xt1WxRlUbUvM8xkBfL8xHoFe9pECIQDt4Kh7uFln5koXCJFtqQw3_dzQ8bROVFxJ-pV4LljdrQ%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIhAO8SIjBmhr9AVNU73ncXs95bv5p-s2ADH02DMNiPswViAiAQMmErD5cGR1R3x_higawQBTLUhcA8TOguXZLW6Gv8iQ%3D%3D " --input-slave " https://r1---sn-jvgcpo503g-3c2e.googlevideo.com/videoplayback?expire=1622420773&ei=xdizYP_cJsuzgAe-lJKoBg&ip=91.210.251.66&id=o-ANJurwz1EcW1Fc5VPavxa3LChBZ0msu6EanDAePP-kIF&itag=251&source=youtube&requiressl=yes&mh=Fe&mm=31%2C29&mn=sn-jvgcpo503g-3c2e%2Csn-3c27sn76&ms=au%2Crdu&mv=m&mvi=1&pl=24&initcwndbps=1222500&vprv=1&mime=audio%2Fwebm&ns=HtFF4eEWFwb-2N8H4pRiD80F&gir=yes&clen=5895629&dur=426.921&lmt=1466919474093547&mt=1622398847&fvip=13&keepalive=yes&fexp=24001373%2C24007246&beids=9466588&c=WEB&n=24upQ4_DPUYh9tzW&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cns%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRQIgbZb3MTSb4DphNpKuBESurjxhahu92uPUxH9HPVbGCDICIQDwyC1uKWinGf2zoNXBtBxDXJ9ENcGzQ0DRtsV4Iyj5yw%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIhAO8SIjBmhr9AVNU73ncXs95bv5p-s2ADH02DMNiPswViAiAQMmErD5cGR1R3x_higawQBTLUhcA8TOguXZLW6Gv8iQ%3D%3D "
awk '{print "\""$1"\"","--input-slave","\""$2"\""}'
awk '{print "\"",$1,"\" --input-slave \"",$2,"\"" }'