Friday, May 5, 2023

YT-DLP 使用筆記




# Update this program to the latest version
yt-dlp.exe -U

# Download and merge the best format that has a video stream, and all audio-only formats into one file
$ yt-dlp -f "bv*+mergeall[vcodec=none]" --audio-multistreams

# Download and merge the best format that has a video stream, and the best 2 audio-only formats into one file
$ yt-dlp -f "bv*+ba+ba.2" --audio-multistreams


YouTube

#Download mp4 video
yt-dlp.exe -f mp4 --embed-metadata -o "%(title)s.%(ext)s" https://www.youtube.com/watch?v=6JkOPVHJvFQ

#Download and convert to a mp3 audio
yt-dlp.exe -x --audio-format mp3 --embed-metadata -o "%(title)s.%(ext)s" https://www.youtube.com/watch?v=6JkOPVHJvFQ

#Keep both mp4 video and mp3 audio
yt-dlp.exe -f mp4 -x --audio-format mp3 --embed-metadata -k -o "%(title)s.%(ext)s" https://www.youtube.com/watch?v=6JkOPVHJvFQ

#Download and convert to a mp3 audio from a playlist
yt-dlp.exe -x --audio-format mp3 --embed-metadata -o "%(title)s.%(ext)s" https://www.youtube.com/playlist?list=OLAK5uy_nnDIsg3JSYhG7kgs_ZK-kttQUkDZQx8ZA

MPD

#List all formats
yt-dlp.exe -F https://xxx/yyy.mpd

#Download selected audio
yt-dlp.exe -f audio_English_mp4a -o "%(title)s.f%(format_id)s.%(ext)s" https://xxx/yyy.mpd
yt-dlp.exe -f audio_Chinese_mp4a -o "%(title)s.f%(format_id)s.%(ext)s" https://xxx/yyy.mpd

#Merge selected video and multiple audios
yt-dlp.exe -f "bv*+audio_Chinese_mp4a+audio_English_mp4a" --audio-multistreams -o "%(title)s.%(ext)s" --merge-output-format mp4 https://xxx/yyy.mpd

彙整信息中翻英

我會提供你兩種材料: 1)一或多篇「原始英文信息」(正式出版或正式翻譯版本) 2)一篇由這些英文信息「節錄、濃縮、重排」而成的「中文彙整信息」 你的任務是: 完全依照「中文彙整信息」的段落結構,逐段回填對應的英文內容。 嚴格遵守以下規則: 以中文彙整信息為 唯一結構骨架...