Brucekomike(讨论 | 贡献) (创建页面,内容为“ <pre> #!/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 </pre>”) |
Brucekomike(讨论 | 贡献) 无编辑摘要 |
||
第1行: | 第1行: | ||
==batch download== | |||
<pre> | <pre> | ||
#!/bin/bash | #!/bin/bash | ||
第22行: | 第22行: | ||
done | done | ||
</pre> | </pre> | ||
==create filelist == | |||
<pre> | |||
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." | |||
} | |||
</pre> | |||
== merge them == | |||
ffmpeg -f concat -safe 0 -i filelist.txt -c copy output.mp4 |
2025年1月7日 (二) 21:41的最新版本
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