You-get

来自OSSmedia

batch download

#!/bin/bash

# Base URL of the playlist or video
base_url="https://example.com/video?p="

# Path to the cookie file
cookie_file="cookies.txt"

# folder
output_folder="output"
# Loop from part 15 to part 44
for i in {15..44}
do
  # Construct the full URL
  url="${base_url}${i}"
  
  # Use you-get with the cookie file to download the video
  you-get -o "$output_folder" -c "$cookie_file" "$url"
done

create filelist

generate_filelist() {
  # Create or overwrite the filelist.txt
  > filelist.txt
  
  # Loop through all .mp4 files in the current directory
  for file in *.mp4
  do
    # Escape single quotes in filenames and append to filelist.txt
    echo "file '$(echo "$file" | sed "s/'/'\\\\''/g")'" >> filelist.txt
  done
  
  echo "filelist.txt has been created with the list of MP4 files."
}

merge them

ffmpeg -f concat -safe 0 -i filelist.txt -c copy output.mp4