• 0 Posts
  • 2 Comments
Joined 2 years ago
cake
Cake day: August 16th, 2023

help-circle
  • To save videos from certain streaming sites that are not supported by yt-dlp, I catch the M3U playlist used by the page and with that I use this script that gets ffmpeg to put together the pieces into a single file.

    #!/bin/bash
    if [ "$1" == "-h" ] || [ $# -lt 2 ]; then
    	echo Download a video from a playlist into a single file
    	echo usage: $(basename $0) PLAYLIST OUTPUT_VID
    	exit
    fi
    
    nbparts=$(grep ^[^#] $1 | wc -l)
    
    echo -e "\e[38;5;202m Downloading" $(( nbparts - 1 )) "parts \e[00m"
    time ffmpeg -hide_banner -allowed_extensions ALL -protocol_whitelist file,http,https,tcp,tls,crypto -i $1 -codec copy $2