Guest User

fill_yt_archive

a guest
Dec 2nd, 2023
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.85 KB | Source Code | 0 0
  1. #!/usr/bin/env bash
  2.  
  3. DOWNLOADER="yt-dlp"
  4.  
  5. if [ "$#" = "0" ]; then
  6. echo "Missing argument! Use $0 --help to show available options!"
  7. exit 1
  8. fi
  9.  
  10. if [ "$1" = "--help" ]; then
  11. printf "Script will output content for archive file for usage with youtube-dl --archive-file\n"
  12. printf "Valid as it stands on 29.06.2021.\n\n"
  13. printf "Available switches:\n $0 --channel                                   -provide youtube channel address\n"
  14. exit 0
  15. fi
  16.  
  17. command -v jq >/dev/null 2>&1 || {
  18.     echo "I require jq but it's not installed.  Aborting." >&2
  19.     exit 1
  20. }
  21. command -v $DOWNLOADER >/dev/null 2>&1 || {
  22.     echo "I require $DOWNLOADER but it's not installed.  Aborting." >&2
  23.     exit 1
  24. }
  25.  
  26. # enter youtube channel
  27. #CHANNEL="https://www.youtube.com/user/rossmanngroup/videos"
  28. #
  29. $DOWNLOADER --flat-playlist -j "$1" | jq -r '.id' | awk '{print "youtube "$0}'
  30.  
Tags: yt-dlp
Advertisement
Add Comment
Please, Sign In to add comment