ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
132.36k stars 10.04k forks source link

download youtube embed video can't exit normally #26694

Closed Jokertion closed 4 years ago

Jokertion commented 4 years ago

Checklist

Verbose log

>>> [youtube] wtTk6KzmhDM: Downloading webpage
[youtube] wtTk6KzmhDM: Looking for automatic captions
[youtube] wtTk6KzmhDM: Downloading MPD manifest
[info] Writing video subtitles to: Q&A - Bioweapons... for Dummies Evaluating the Threat of Rogue Biohacking-wtTk6KzmhDM.en.vtt
[info] Writing video description metadata as JSON to: Q&A - Bioweapons... for Dummies Evaluating the Threat of Rogue Biohacking-wtTk6KzmhDM.info.json
[dashsegments] Total fragments: 175
[download] Destination: Q&A - Bioweapons... for Dummies Evaluating the Threat of Rogue Biohacking-wtTk6KzmhDM.f137.mp4
[download] 100% of 283.86MiB in 04:30
[dashsegments] Total fragments: 187
[download] Destination: Q&A - Bioweapons... for Dummies Evaluating the Threat of Rogue Biohacking-wtTk6KzmhDM.f140.m4a
[download] 100% of 14.09MiB in 01:20
[ffmpeg] Merging formats into "Q&A - Bioweapons... for Dummies Evaluating the Threat of Rogue Biohacking-wtTk6KzmhDM.mp4"
Deleting original file Q&A - Bioweapons... for Dummies Evaluating the Threat of Rogue Biohacking-wtTk6KzmhDM.f137.mp4 (pass -k to keep)
Deleting original file Q&A - Bioweapons... for Dummies Evaluating the Threat of Rogue Biohacking-wtTk6KzmhDM.f140.m4a (pass -k to keep)
[ffmpeg] Converting subtitles
Deleting original file Q&A - Bioweapons... for Dummies Evaluating the Threat of Rogue Biohacking-wtTk6KzmhDM.en.vtt (pass -k to keep)

Description

url1 = 'https://www.youtube.com/embed/wtTk6KzmhDM?feature=oembed&hd=1'
url2 = 'https://www.youtube.com/embed/W-b2n5cUVYU?feature=oembed&hd=1'
url3 = 'https://www.youtube.com/embed/NjhSgxsOOlU?feature=oembed&hd=1'

url11 = 'https://www.youtube.com/watch?v=wtTk6KzmhDM'
url22 = 'https://www.youtube.com/watch?v=W-b2n5cUVYU'
url33 = 'https://www.youtube.com/watch?v=NjhSgxsOOlU'

import os
url = u1

cmd1 = f"""youtube-dl -f "bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best" --write-auto-sub --write-info-json --sub-lang en --convert-subs srt {url}"""  
msg = f"cmd1: {cmd1}"
print(msg)
os.system(cmd1)

The url1 to url3 are youtube embedded links, which crawled from