Repository: youtube-dl
Issue: [adultswim] Problem resuming an HLS-native download
Labels: tv-provider-account-needed

## Please follow the guide below

- You will be asked some questions and requested to provide some information, please read them **carefully** and answer honestly
- Put an `x` into all the boxes [ ] relevant to your *issue* (like that [x])
- Use *Preview* tab to see how your issue will actually look like

---

### Make sure you are using the *latest* version: run `youtube-dl --version` and ensure your version is *2017.06.05*. If it's not read [this FAQ entry](https://github.com/rg3/youtube-dl/blob/master/README.md#how-do-i-update-youtube-dl) and update. Issues with outdated version will be rejected.
- [x ] I've **verified** and **I assure** that I'm running youtube-dl **2017.06.05**

### Before submitting an *issue* make sure you have:
- [x ] At least skimmed through [README](https://github.com/rg3/youtube-dl/blob/master/README.md) and **most notably** [FAQ](https://github.com/rg3/youtube-dl#faq) and [BUGS](https://github.com/rg3/youtube-dl#bugs) sections
- [x ] [Searched](https://github.com/rg3/youtube-dl/search?type=Issues) the bugtracker for similar issues including closed ones

### What is the purpose of your *issue*?
- [ x] Bug report (encountered problems with youtube-dl)
- [ ] Site support request (request for adding support for a new site)
- [ ] Feature request (request for a new functionality)
- [ ] Question
- [ ] Other

---

Well, with crypto / native downloader, rate limiting, and a nicely functioning network/router ...

Still hung at 96%, but at least it resumed/finished.

Died on ffmpeg at the end.
VLC will not play the mp4 file.
So, it downloaded, but something went wrong.


```
keybounceMBP:AdultSwim michael$ ./yt-dl http://www.adultswim.com/videos/dragon-ball-z-kai/stunning-youngsters-no-18s-uphill-battle/
[debug] System config: []
[debug] User config: ['-k', '-o', '%(title)s.%(ext)s', '-f', '\nbest[ext=mp4][height>431][height<=576]/\nbestvideo[ext=mp4][height=480]+bestaudio[ext=m4a]/\nbest[ext=mp4][height>340][height<=431]/\nbestvideo[ext=mp4][height>360][height<=576]+bestaudio/\nbest[height>340][height<=576]/\nbestvideo[height>360][height<=576]+bestaudio/\nbestvideo[height=360]+bestaudio/\nbest[ext=mp4][height>=280][height<=360]/\nbest[height<=576]/\nworst', '--ap-mso', 'Dish', '--ap-username', 'PRIVATE', '--ap-password', 'PRIVATE', '--write-sub', '--write-auto-sub', '--sub-lang', 'en,enUS,en-us', '--sub-format', 'ass/srt/best', '--convert-subs', 'ass', '--embed-subs', '--recode-video', 'mkv', '--mark-watched', '--download-archive', 'downloaded-videos.txt']
[debug] Custom config: []
[debug] Command-line args: ['-v', '--hls-prefer-native', '--keep-fragments', '-r', '230k', '-o', '%(series)s/s%(season_number)02d-e%(episode_number)02d-%(title)s.%(ext)s', '--include-ads', 'http://www.adultswim.com/videos/dragon-ball-z-kai/stunning-youngsters-no-18s-uphill-battle/']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2017.06.05
[debug] Python version 3.6.1 - Darwin-13.4.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 3.2.4, ffprobe 3.2.4, rtmpdump 2.4
[debug] Proxy map: {}
[AdultSwim] stunning-youngsters-no-18s-uphill-battle: Downloading webpage
[AdultSwim] yg6tkv1KS3yUltXY4HS5zA: Downloading XML
[AdultSwim] 1400176: Retrieving Authorization Token
[AdultSwim] 1400176: Retrieving Media Token
[AdultSwim] 1400176: Downloading XML
[AdultSwim] 1400176: Downloading m3u8 information
[AdultSwim] 1400176: Downloading m3u8 information
[debug] Invoking downloader on 'http://androidhls-secure.cdn.turner.com/adultswim/big/secure/tve/2017-05/ASOE1004271700075224_HLS/ASOE1004271700075224_Layer6_vod.m3u8'
[hlsnative] Downloading m3u8 manifest
[hlsnative] Total fragments: 131
[download] Destination: Dragon Ball Z Kai/s01-e118-Dragon Ball Z Kai - DBZ Kai 118.mp4
[download]  96.9% of ~340.06MiB at 242.12KiB/s ETA 00:51^C
ERROR: Interrupted by user
keybounceMBP:AdultSwim michael$ ./yt-dl http://www.adultswim.com/videos/dragon-ball-z-kai/stunning-youngsters-
no-18s-uphill-battle/
[debug] System config: []
[debug] User config: ['-k', '-o', '%(title)s.%(ext)s', '-f', '\nbest[ext=mp4][height>431][height<=576]/\nbestvideo[ext=mp4][height=480]+bestaudio[ext=m4a]/\nbest[ext=mp4][height>340][height<=431]/\nbestvideo[ext=mp4][height>360][height<=576]+bestaudio/\nbest[height>340][height<=576]/\nbestvideo[height>360][height<=576]+bestaudio/\nbestvideo[height=360]+bestaudio/\nbest[ext=mp4][height>=280][height<=360]/\nbest[height<=576]/\nworst', '--ap-mso', 'Dish', '--ap-username', 'PRIVATE', '--ap-password', 'PRIVATE', '--write-sub', '--write-auto-sub', '--sub-lang', 'en,enUS,en-us', '--sub-format', 'ass/srt/best', '--convert-subs', 'ass', '--embed-subs', '--recode-video', 'mkv', '--mark-watched', '--download-archive', 'downloaded-videos.txt']
[debug] Custom config: []
[debug] Command-line args: ['-v', '--hls-prefer-native', '--keep-fragments', '-r', '230k', '-o', '%(series)s/s%(season_number)02d-e%(episode_number)02d-%(title)s.%(ext)s', '--include-ads', 'http://www.adultswim.com/videos/dragon-ball-z-kai/stunning-youngsters-no-18s-uphill-battle/']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2017.06.05
[debug] Python version 3.6.1 - Darwin-13.4.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 3.2.4, ffprobe 3.2.4, rtmpdump 2.4
[debug] Proxy map: {}
[AdultSwim] stunning-youngsters-no-18s-uphill-battle: Downloading webpage
[AdultSwim] yg6tkv1KS3yUltXY4HS5zA: Downloading XML
[AdultSwim] 1400176: Retrieving Media Token
[AdultSwim] 1400176: Downloading XML
[AdultSwim] 1400176: Downloading m3u8 information
[AdultSwim] 1400176: Downloading m3u8 information
[debug] Invoking downloader on 'http://androidhls-secure.cdn.turner.com/adultswim/big/secure/tve/2017-05/ASOE1004271700075224_HLS/ASOE1004271700075224_Layer6_vod.m3u8'
[hlsnative] Downloading m3u8 manifest
[hlsnative] Total fragments: 131
[download] Destination: Dragon Ball Z Kai/s01-e118-Dragon Ball Z Kai - DBZ Kai 118.mp4
[download] 100% of 338.38MiB in 00:42
[debug] ffmpeg command line: ffprobe -show_streams 'file:Dragon Ball Z Kai/s01-e118-Dragon Ball Z Kai - DBZ Kai 118.mp4'
[ffmpeg] Converting video from mp4 to mkv, Destination: Dragon Ball Z Kai/s01-e118-Dragon Ball Z Kai - DBZ Kai 118.mkv
[debug] ffmpeg command line: ffmpeg -y -i 'file:Dragon Ball Z Kai/s01-e118-Dragon Ball Z Kai - DBZ Kai 118.mp4' 'file:Dragon Ball Z Kai/s01-e118-Dragon Ball Z Kai - DBZ Kai 118.mkv'
ERROR: file:Dragon Ball Z Kai/s01-e118-Dragon Ball Z Kai - DBZ Kai 118.mp4: Invalid data found when processing input
Traceback (most recent call last):
  File "/Users/michael/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1943, in post_process
    files_to_delete, info = pp.run(info)
  File "/Users/michael/bin/youtube-dl/youtube_dl/postprocessor/ffmpeg.py", line 337, in run
    self.run_ffmpeg(path, outpath, options)
  File "/Users/michael/bin/youtube-dl/youtube_dl/postprocessor/ffmpeg.py", line 208, in run_ffmpeg
    self.run_ffmpeg_multiple_files([path], out_path, opts)
  File "/Users/michael/bin/youtube-dl/youtube_dl/postprocessor/ffmpeg.py", line 204, in run_ffmpeg_multiple_files
    raise FFmpegPostProcessorError(msg)
youtube_dl.postprocessor.ffmpeg.FFmpegPostProcessorError: file:Dragon Ball Z Kai/s01-e118-Dragon Ball Z Kai - DBZ Kai 118.mp4: Invalid data found when processing input

keybounceMBP:AdultSwim michael$ 
```

For what it's worth, here are the timestamps at the "seam". Fragments all look about the same size (so it's not like one only got half downloaded and 'gapped'.)

```
   2456 -rw-r--r--  1 michael  staff    2512448 Jun  9 09:59 s01-e118-Dragon Ball Z Kai - DBZ Kai 118.mp4.part-Frag128
   2456 -rw-r--r--  1 michael  staff    2512816 Jun  9 09:59 s01-e118-Dragon Ball Z Kai - DBZ Kai 118.mp4.part-Frag127
   2472 -rw-r--r--  1 michael  staff    2529552 Jun  9 09:53 s01-e118-Dragon Ball Z Kai - DBZ Kai 118.mp4.part-Frag126
   2468 -rw-r--r--  1 michael  staff    2526544 Jun  9 09:53 s01-e118-Dragon Ball Z Kai - DBZ Kai 118.mp4.part-Frag125
   2508 -rw-r--r--  1 michael  staff    2566592 Jun  9 09:53 s01-e118-Dragon Ball Z Kai - DBZ Kai 118.mp4.part-Frag124
```