Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash -x
- mix_id=uVa55WpCfM0
- video_id=dUgdj_gB7S4
- template='005 %(title)s (%(id)s).f%(format_id)s.%(ext)s'
- ytv=https://www.youtube.com/watch?v
- until
- set -- *"($mix_id)"*
- audio=$1
- test -f "$audio"
- do
- sleep 10
- youtube-dl -f 'bestaudio[acodec^=?opus]/bestaudio/best' -o "$template" "$ytv=$mix_id"
- done
- until
- set -- *"($video_id)"*
- video=$1
- test -f "$video"
- do
- sleep 10
- youtube-dl -f 'bestvideo[vcodec^=?vp9]/bestvideo/best' -o "$template" "$ytv=$video_id"
- done
- mix=${audio/).*/).mkv}
- ffmpeg -i "$video" -i "$audio" -map 0:v -map 1:a -c:v copy -c:a copy ".$mix" &&
- test -s ".$mix" &&
- rm -v "$audio" &&
- mv -vf ".$mix" "$mix"
Add Comment
Please, Sign In to add comment