Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
--ignore-errors + DASH keeps going even when segment download fails #10497
Comments
|
diff --git a/youtube_dl/downloader/dash.py b/youtube_dl/downloader/dash.py
index 8bbab9d..c819cca 100644
--- a/youtube_dl/downloader/dash.py
+++ b/youtube_dl/downloader/dash.py
@@ -68,10 +68,15 @@ class DashSegmentsFD(FragmentFD):
self.report_error('giving up after %s fragment retries' % fragment_retries)
return False
+ return True
+
+ initialization_ok = True
if initialization_url:
- append_url_to_file(initialization_url, ctx['tmpfilename'], 'Init')
- for i, segment_url in enumerate(segment_urls):
- append_url_to_file(segment_url, ctx['tmpfilename'], 'Seg%d' % i)
+ initialization_ok = append_url_to_file(initialization_url, ctx['tmpfilename'], 'Init')
+
+ if initialization_ok:
+ for i, segment_url in enumerate(segment_urls):
+ append_url_to_file(segment_url, ctx['tmpfilename'], 'Seg%d' % i)
self._finish_frag_download(ctx)@dstftw Currently |
should'nt it be generalized also to the case when the video doesn't have an intialization segment in MPD manifest at all. |
|
In commit a1a2257 I see you make |
|
i don't have an example, but making it optional was based on the standard. |
|
If the standard allows a DASH manifest without any initialization URL, it should be OK in youtube-dl, too. |
|
I don't think this default behavior should be changed. In most of the cases 404 is a temporary error for dash segments on YouTube and it's usually fixed by 1-2 subsequent retries. |
but it will be necessary for dash manifest with initialization to stop if it coudn't get initialization segment as it won't produce a working file. |
|
I guess it's format dependent whether the resulting file will be playable or not when the head segment is missing. Is there any statement in spec about this? |
it's possible, but the most used format in dash manifests is mp4 which didn't work without the initialization segment. |
i found an example in the nytimes mpd manifests. |
Could you paste the URL? |
|
Here's my new proposal: #10542 |
|
@ivan I've fixed it. In the next version the whole download process stops immediately if the first segment is unavailable. |
Please follow the guide below
xinto all the boxes [ ] relevant to your issue (like that [x])Make sure you are using the latest version: run
youtube-dl --versionand ensure your version is 2016.08.28. If it's not read this FAQ entry and update. Issues with outdated version will be rejected.Before submitting an issue make sure you have:
What is the purpose of your issue?
If you use
--ignore-errors, download a DASH format, and a segment fails to download,youtube-dl --ignore-errorswill keep going, trying to download every other segment as well:I'm not sure this behavior makes sense. I'm using
--ignore-errorsbecause it's very helpful when downloading entire channels, but this behavior 1) creates a flood of requests that makes me more likely to get banned 2) presumably doesn't get a complete video file anyway?