Guest User

.fetch-mix-5

a guest
May 5th, 2020
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.65 KB | None | 0 0
  1. #!/bin/bash -x
  2. mix_id=uVa55WpCfM0
  3. video_id=dUgdj_gB7S4
  4. template='005 %(title)s (%(id)s).f%(format_id)s.%(ext)s'
  5. ytv=https://www.youtube.com/watch?v
  6.  
  7. until
  8.     set -- *"($mix_id)"*
  9.     audio=$1
  10.     test -f "$audio"
  11. do
  12.     sleep 10
  13.     youtube-dl -f 'bestaudio[acodec^=?opus]/bestaudio/best' -o "$template" "$ytv=$mix_id"
  14. done
  15.  
  16. until
  17.     set -- *"($video_id)"*
  18.     video=$1
  19.     test -f "$video"
  20. do
  21.     sleep 10
  22.     youtube-dl -f 'bestvideo[vcodec^=?vp9]/bestvideo/best' -o "$template" "$ytv=$video_id"
  23. done
  24.  
  25. mix=${audio/).*/).mkv}
  26.  
  27. ffmpeg -i "$video" -i "$audio" -map 0:v -map 1:a -c:v copy -c:a copy ".$mix" &&
  28. test -s ".$mix" &&
  29. rm -v "$audio" &&
  30. mv -vf ".$mix" "$mix"
Add Comment
Please, Sign In to add comment