How do I download youtube videos for a specified time period #26647

Closed
opened 2026-02-21 13:16:17 -05:00 by deekerman · 2 comments
Owner

Originally created by @GuanghuiSong on GitHub (Jul 31, 2023).

Checklist

  • [ x] I'm asking a question
  • I've looked through the README and FAQ for similar questions
  • I've searched the bugtracker for similar questions including closed ones

Question

Can someone help me, please

Originally created by @GuanghuiSong on GitHub (Jul 31, 2023). <!-- ###################################################################### WARNING! IGNORING THE FOLLOWING TEMPLATE WILL RESULT IN ISSUE CLOSED AS INCOMPLETE ###################################################################### --> ## Checklist <!-- Carefully read and work through this check list in order to prevent the most common mistakes and misuse of youtube-dl: - Look through the README (http://yt-dl.org/readme) and FAQ (http://yt-dl.org/faq) for similar questions - Search the bugtracker for similar questions: http://yt-dl.org/search-issues - Finally, put x into all relevant boxes (like this [x]) --> - [ x] I'm asking a question - [x] I've looked through the README and FAQ for similar questions - [ ] I've searched the bugtracker for similar questions including closed ones ## Question <!-- How do I download youtube videos for a specified time period? I have tried the following two forms of parameters, neither of which worked. ydl_opts = { 'path':"/home/sgh/code/Text-To-Video-Finetuning/datasets/download_videos", 'outtmpl':caption, 'merge_output_format':'mp4', 'format':format_id, 'skip_download':False, 'quiet':True, "download_ranges": download_range_func(None, [[start_time, end_time]] ), "force_keyframes_at_cuts": True } and ydl_opts = { 'path':"/home/sgh/code/Text-To-Video-Finetuning/datasets/download_videos", 'outtmpl':caption, 'merge_output_format':'mp4', 'format':format_id, 'skip_download':False, 'quiet':True, "external_downloader": "ffmpeg", "external_downloader_args": {"ffmpeg_i": ["-ss", str(start_time), "-to", str(end_time)}, } --> Can someone help me, please
deekerman 2026-02-21 13:16:17 -05:00
Author
Owner

@GuanghuiSong commented on GitHub (Jul 31, 2023):

I have used the following two forms of parameters, neither of which worked
ydl_opts = {
'path':"/home/sgh/code/Text-To-Video-Finetuning/datasets/download_videos",
'outtmpl':caption,
'merge_output_format':'mp4',
'format':format_id,
'skip_download':False,
'quiet':True,
"download_ranges": download_range_func(None, start_time, end_time ),
"force_keyframes_at_cuts": True
}
and

ydl_opts = {
'path':"/home/sgh/code/Text-To-Video-Finetuning/datasets/download_videos",
'outtmpl':caption,
'merge_output_format':'mp4',
'format':format_id,
'skip_download':False,
'quiet':True,
"external_downloader": "ffmpeg",
"external_downloader_args": {"ffmpeg_i": ["-ss", str(start_time)."-to", str(end_time)]},
}

@GuanghuiSong commented on GitHub (Jul 31, 2023): I have used the following two forms of parameters, neither of which worked ydl_opts = { 'path':"/home/sgh/code/Text-To-Video-Finetuning/datasets/download_videos", 'outtmpl':caption, 'merge_output_format':'mp4', 'format':format_id, 'skip_download':False, 'quiet':True, "download_ranges": download_range_func(None, [[start_time, end_time]] ), "force_keyframes_at_cuts": True } and ydl_opts = { 'path':"/home/sgh/code/Text-To-Video-Finetuning/datasets/download_videos", 'outtmpl':caption, 'merge_output_format':'mp4', 'format':format_id, 'skip_download':False, 'quiet':True, "external_downloader": "ffmpeg", "external_downloader_args": {"ffmpeg_i": ["-ss", str(start_time)."-to", str(end_time)]}, }
Author
Owner

@dirkf commented on GitHub (Jul 31, 2023):

[ ] I've searched the bugtracker for similar questions including closed ones

Why do you think this checklist item is there? #30839, #4821, https://github.com/ytdl-org/youtube-dl/issues/31448#issuecomment-1379700151.

@dirkf commented on GitHub (Jul 31, 2023): >[ ] I've searched the bugtracker for similar questions including closed ones Why do you think this checklist item is there? #30839, #4821, https://github.com/ytdl-org/youtube-dl/issues/31448#issuecomment-1379700151.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/youtube-dl#26647
No description provided.