Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Twitch VOD downloads don't retry on errors and can't be resumed #4966

Closed
Daiz opened this issue Feb 17, 2015 · 4 comments
Closed

Twitch VOD downloads don't retry on errors and can't be resumed #4966

Daiz opened this issue Feb 17, 2015 · 4 comments

Comments

@Daiz
Copy link

@Daiz Daiz commented Feb 17, 2015

I'm trying to download a long Twitch VOD (over 9 hours). I have ffmpeg in my path (not that it would even work without that). youtube-dl will start downloading the VOD just fine, but can run into an issue like this:

[tcp @ 000000000487c780] Failed to resolve hostname vod.ak.hls.ttvnw.net: The name does not resolve for the supplied parameters
[hls,applehttp @ 000000000487f160] Failed to open segment of playlist 0
http://vod.ak.hls.ttvnw.net/v1/AUTH_system/vods_e783/miss_jamball_13115324480_203872310/chunked/index-dvr.m3u8:
 Input/output error

(Here's a full -v log)

Now, this is clearly just a temporary download hiccup, and a retry should sort it out just fine, but at this point the download will just stop and youtube-dl will write the final file. No download retry attempts are made (-R does nothing) and you can't resume the download either (neither by default nor with -c - youtube-dl just says the target file already exists), which means that I'll have to try download the whole thing again (and another error like that will mean I'll need to try again and again and again until I'd get a download with no errors for the entire >9h duration, which seems like an almost impossible task).

Considering all this, wouldn't it make more sense for youtube-dl to download all the playlist parts first and only then invoke ffmpeg to mux it all together? I'd expect it to be actually possible for youtube-dl to retry chunk downloads properly that way and resume a halted download later on as well. Sure, it might take a bit longer to download and then mux instead of muxing on the fly, but I'd say being able to reliably download long things to begin with clearly trumps that downside.

phihag added a commit that referenced this issue Feb 17, 2015
@phihag
Copy link
Contributor

@phihag phihag commented Feb 17, 2015

At the moment, these HLS downloads are run by ffmpeg alone. youtube-dl just extracts the metadata and invokes ffmpeg. I've added an option --hls-prefer-native to use youtube-dl's native HLS downloader instead.

However, at the moment, that won't help you, because the native HLS downloader is quite experimental and doesn't support resuming either. I'm working on that though, although it may take a while.

jaimeMF added a commit that referenced this issue Feb 17, 2015
@ddurdle
Copy link

@ddurdle ddurdle commented Mar 16, 2016

I wouldn't say that --hls-prefer-native won't help. Actually, it very much helps me over the ffmpeg/avconv default. I was having the download fail very often, and retrying would cause the entire download to restart. But by using --hls-prefer-native, it's downloading fragments and if it fails, rerunning will pickup these fragments and quickly get to the point where the download failed. Huge improvement and it's almost essentially resume.

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Jun 12, 2016

In the latest version hls native is used by default for vods.

@dstftw dstftw closed this Jun 12, 2016
@TehBotolSosro
Copy link

@TehBotolSosro TehBotolSosro commented Nov 7, 2016

Hi sorry for bringing this up, but is the hlsprefer-native do support resuming or retrying yet as in the latest version?
since when i use ffmpeg it always failed on some video segment probably do to internet hiccup but opening the link manually is fine

Unable to open resource:https://xxxxx
[hls,applehttp @ 00000000023f2ea0] Failed to open segment of playlist 0

and when using hls-prefer native after it done muxing it seem it always leave some segmented file behind
(most of it are deleted but not all of them)
and i also have error like [ffmpeg] Fixing malformated aac bitstream in "download.ts"

does leaving some segmented file and the fixing malformated aac means the hls prefer native downloader have also some segment download error or not? since there is no similar error message as when using ffmpeg (i already turn on the verbose)

also is there any way to retrying the failed segment if using the default ffmpeg?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants
@phihag @ddurdle @dstftw @Daiz @TehBotolSosro and others
You can’t perform that action at this time.