Repository: youtube-dl
Issue: error occurs at Freshlive.tv
Labels: 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 this: `[x]`)
- Use the *Preview* tab to see what your issue will actually look like

---

### Make sure you are using the *latest* version: run `youtube-dl --version` and ensure your version is *2018.04.16*. 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 **2018.04.16**

### Before submitting an *issue* make sure you have:
- [x] At least skimmed through the [README](https://github.com/rg3/youtube-dl/blob/master/README.md), **most notably** the [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
- [x] Checked that provided video/audio/playlist URLs (if any) are alive and playable in a browser

### What is the purpose of your *issue*?
- [ ] Bug report (encountered problems with youtube-dl)
- [x] Site support request (request for adding support for a new site)
- [ ] Feature request (request for a new functionality)
- [ ] Question
- [ ] Other

---

### The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your *issue*

---

### If the purpose of this *issue* is a *bug report*, *site support request* or you are not completely sure provide the full verbose output as follows:

Add the `-v` flag to **your command line** you run youtube-dl with (`youtube-dl -v <your command line>`), copy the **whole** output and insert it here. It should look similar to one below (replace it with **your** log inserted between triple ```):

```
MacBook-Pro-3:Downloads gaeaearth$ youtube-dl --cookies cookies.txt https://freshlive.tv/sakuragakuin/199580 -F -v
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'--cookies', u'cookies.txt', u'https://freshlive.tv/sakuragakuin/199580', u'-F', u'-v']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2018.04.16
[debug] Python version 2.7.10 (CPython) - Darwin-17.5.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg git-2018-04-21-e5ba5fa, ffprobe git-2018-04-21-e5ba5fa, rtmpdump 2.4
[debug] Proxy map: {}
[FreshLive] 199580: Downloading webpage
[FreshLive] 199580: Downloading m3u8 information
[info] Available formats for 199580:
format code  extension  resolution note
hls-324      mp4        256x144     324k , avc1.77.21, mp4a.40.2
hls-1207     mp4        512x288    1207k , avc1.77.30, mp4a.40.2
hls-2635     mp4        768x432    2635k , avc1.77.40, mp4a.40.2
hls-3472     mp4        1280x720   3472k , avc1.77.41, mp4a.40.2 (best)
MacBook-Pro-3:Downloads gaeaearth$ youtube-dl --cookies cookies.txt https://freshlive.tv/sakuragakuin/199580 -f hls-3472 -v
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'--cookies', u'cookies.txt', u'https://freshlive.tv/sakuragakuin/199580', u'-f', u'hls-3472', u'-v']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2018.04.16
[debug] Python version 2.7.10 (CPython) - Darwin-17.5.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg git-2018-04-21-e5ba5fa, ffprobe git-2018-04-21-e5ba5fa, rtmpdump 2.4
[debug] Proxy map: {}
[FreshLive] 199580: Downloading webpage
[FreshLive] 199580: Downloading m3u8 information
[debug] Invoking downloader on u'https://movie.freshlive.tv/playlist/2061359.m3u8?token=199580t2212f5e4556956e2a97ebd7959a9dc1c52a1'
[hlsnative] Downloading m3u8 manifest
WARNING: hlsnative has detected features it does not support, extraction will be delegated to ffmpeg
[download] Destination: #FRESHマンデー 「さくら学院の顔笑れ!!FRESH!マンデー」#41-199580.mp4
[debug] ffmpeg command line: ffmpeg -y -loglevel verbose -headers 'Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip, deflate
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0 (Chrome)
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Cookie: P=258f3b63-38cb-44a3-bfc7-07af1894c515; __gads=ID=7322cf2fccefe783:T=1524274229:S=ALNI_MYckkk5yr0zgTgfEaqDdW-PANc2pA; _ga=GA1.2.1187550676.1524274229; utm=j%3A%7B%7D; segmentId=4977; connect.sid=s%3A9e3381d5-574d-4cf1-b4e0-6d0b192e2254.PlMR%2FsY31FbOZ0YWADlkSuhfyx6CVpE7MqpTvrF1EKc
' -i 'https://movie.freshlive.tv/playlist/2061359.m3u8?token=199580t2212f5e4556956e2a97ebd7959a9dc1c52a1' -c copy -f mp4 '-bsf:a' aac_adtstoasc 'file:#FRESHマンデー 「さくら学院の顔笑れ!!FRESH!マンデー」#41-199580.mp4.part'
ffmpeg version git-2018-04-21-e5ba5fa Copyright (c) 2000-2018 the FFmpeg developers
  built with Apple LLVM version 9.1.0 (clang-902.0.39.1)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/HEAD-e5ba5fa --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-gpl --enable-libfdk-aac --enable-libmp3lame --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-opencl --enable-videotoolbox --disable-lzma --enable-nonfree
  libavutil      56. 15.100 / 56. 15.100
  libavcodec     58. 19.100 / 58. 19.100
  libavformat    58. 13.100 / 58. 13.100
  libavdevice    58.  4.100 / 58.  4.100
  libavfilter     7. 18.100 /  7. 18.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  2.100 /  5.  2.100
  libswresample   3.  2.100 /  3.  2.100
  libpostproc    55.  2.100 / 55.  2.100
[hls,applehttp @ 0x7f9f39800400] HLS request for url 'https://movie.freshlive.tv/ts/2061359/movie/fresh199580/hls/720/ts/1.ts?pd=1&token=199580t2212f5e4556956e2a97ebd7959a9dc1c52a1', offset 0, playlist 0
Unable to open key file abemafresh://abemafresh/199580t2212f5e4556956e2a97ebd7959a9dc1c52a1/9a62571da4165ef4e06bc94179523927
[hls,applehttp @ 0x7f9f39800400] Opening 'crypto+https://movie.freshlive.tv/ts/2061359/movie/fresh199580/hls/720/ts/1.ts?pd=1&token=199580t2212f5e4556956e2a97ebd7959a9dc1c52a1' for reading
[hls,applehttp @ 0x7f9f39800400] Error when loading first segment 'https://movie.freshlive.tv/ts/2061359/movie/fresh199580/hls/720/ts/1.ts?pd=1&token=199580t2212f5e4556956e2a97ebd7959a9dc1c52a1'
https://movie.freshlive.tv/playlist/2061359.m3u8?token=199580t2212f5e4556956e2a97ebd7959a9dc1c52a1: Invalid data found when processing input


ERROR: ffmpeg exited with code 1
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/local/bin/youtube-dl/__main__.py", line 19, in <module>
    youtube_dl.main()
  File "/usr/local/bin/youtube-dl/youtube_dl/__init__.py", line 471, in main
    _real_main(argv)
  File "/usr/local/bin/youtube-dl/youtube_dl/__init__.py", line 461, in _real_main
    retcode = ydl.download(all_urls)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1993, in download
    url, force_generic_extractor=self.params.get('force_generic_extractor', False))
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 800, in extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 854, in process_ie_result
    return self.process_video_result(ie_result, download=download)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1627, in process_video_result
    self.process_info(new_info)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1900, in process_info
    success = dl(filename, info_dict)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1839, in dl
    return fd.download(name, info)
  File "/usr/local/bin/youtube-dl/youtube_dl/downloader/common.py", line 365, in download
    return self.real_download(filename, info_dict)
  File "/usr/local/bin/youtube-dl/youtube_dl/downloader/hls.py", line 76, in real_download
    return fd.real_download(filename, info_dict)
  File "/usr/local/bin/youtube-dl/youtube_dl/downloader/external.py", line 64, in real_download
    self.get_basename(), retval))
  File "/usr/local/bin/youtube-dl/youtube_dl/downloader/common.py", line 166, in report_error
    self.ydl.report_error(*args, **kargs)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 617, in report_error
    self.trouble(error_message, tb)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 579, in trouble
    tb_data = traceback.format_list(traceback.extract_stack())

MacBook-Pro-3:Downloads gaeaearth$ youtube-dl --cookies cookies.txt https://freshlive.tv/sakuragakuin/199580 -f hls-3472 -v --hls-prefer-native
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'--cookies', u'cookies.txt', u'https://freshlive.tv/sakuragakuin/199580', u'-f', u'hls-3472', u'-v', u'--hls-prefer-native']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2018.04.16
[debug] Python version 2.7.10 (CPython) - Darwin-17.5.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg git-2018-04-21-e5ba5fa, ffprobe git-2018-04-21-e5ba5fa, rtmpdump 2.4
[debug] Proxy map: {}
[FreshLive] 199580: Downloading webpage
[FreshLive] 199580: Downloading m3u8 information
[debug] Invoking downloader on u'https://movie.freshlive.tv/playlist/2061359.m3u8?token=199580t2212f5e4556956e2a97ebd7959a9dc1c52a1'
[hlsnative] Downloading m3u8 manifest
WARNING: hlsnative has detected features it does not support, extraction will be delegated to ffmpeg
[download] Destination: #FRESHマンデー 「さくら学院の顔笑れ!!FRESH!マンデー」#41-199580.mp4
[debug] ffmpeg command line: ffmpeg -y -loglevel verbose -headers 'Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip, deflate
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0 (Chrome)
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Cookie: P=258f3b63-38cb-44a3-bfc7-07af1894c515; __gads=ID=7322cf2fccefe783:T=1524274229:S=ALNI_MYckkk5yr0zgTgfEaqDdW-PANc2pA; _ga=GA1.2.1187550676.1524274229; utm=j%3A%7B%7D; segmentId=4977; connect.sid=s%3A9e3381d5-574d-4cf1-b4e0-6d0b192e2254.PlMR%2FsY31FbOZ0YWADlkSuhfyx6CVpE7MqpTvrF1EKc
' -i 'https://movie.freshlive.tv/playlist/2061359.m3u8?token=199580t2212f5e4556956e2a97ebd7959a9dc1c52a1' -c copy -f mp4 '-bsf:a' aac_adtstoasc 'file:#FRESHマンデー 「さくら学院の顔笑れ!!FRESH!マンデー」#41-199580.mp4.part'
ffmpeg version git-2018-04-21-e5ba5fa Copyright (c) 2000-2018 the FFmpeg developers
  built with Apple LLVM version 9.1.0 (clang-902.0.39.1)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/HEAD-e5ba5fa --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-gpl --enable-libfdk-aac --enable-libmp3lame --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-opencl --enable-videotoolbox --disable-lzma --enable-nonfree
  libavutil      56. 15.100 / 56. 15.100
  libavcodec     58. 19.100 / 58. 19.100
  libavformat    58. 13.100 / 58. 13.100
  libavdevice    58.  4.100 / 58.  4.100
  libavfilter     7. 18.100 /  7. 18.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  2.100 /  5.  2.100
  libswresample   3.  2.100 /  3.  2.100
  libpostproc    55.  2.100 / 55.  2.100
[hls,applehttp @ 0x7fe7dc800000] HLS request for url 'https://movie.freshlive.tv/ts/2061359/movie/fresh199580/hls/720/ts/1.ts?pd=1&token=199580t2212f5e4556956e2a97ebd7959a9dc1c52a1', offset 0, playlist 0
Unable to open key file abemafresh://abemafresh/199580t2212f5e4556956e2a97ebd7959a9dc1c52a1/9a62571da4165ef4e06bc94179523927
[hls,applehttp @ 0x7fe7dc800000] Opening 'crypto+https://movie.freshlive.tv/ts/2061359/movie/fresh199580/hls/720/ts/1.ts?pd=1&token=199580t2212f5e4556956e2a97ebd7959a9dc1c52a1' for reading
[hls,applehttp @ 0x7fe7dc800000] Error when loading first segment 'https://movie.freshlive.tv/ts/2061359/movie/fresh199580/hls/720/ts/1.ts?pd=1&token=199580t2212f5e4556956e2a97ebd7959a9dc1c52a1'
https://movie.freshlive.tv/playlist/2061359.m3u8?token=199580t2212f5e4556956e2a97ebd7959a9dc1c52a1: Invalid data found when processing input


ERROR: ffmpeg exited with code 1
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/local/bin/youtube-dl/__main__.py", line 19, in <module>
    youtube_dl.main()
  File "/usr/local/bin/youtube-dl/youtube_dl/__init__.py", line 471, in main
    _real_main(argv)
  File "/usr/local/bin/youtube-dl/youtube_dl/__init__.py", line 461, in _real_main
    retcode = ydl.download(all_urls)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1993, in download
    url, force_generic_extractor=self.params.get('force_generic_extractor', False))
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 800, in extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 854, in process_ie_result
    return self.process_video_result(ie_result, download=download)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1627, in process_video_result
    self.process_info(new_info)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1900, in process_info
    success = dl(filename, info_dict)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1839, in dl
    return fd.download(name, info)
  File "/usr/local/bin/youtube-dl/youtube_dl/downloader/common.py", line 365, in download
    return self.real_download(filename, info_dict)
  File "/usr/local/bin/youtube-dl/youtube_dl/downloader/hls.py", line 76, in real_download
    return fd.real_download(filename, info_dict)
  File "/usr/local/bin/youtube-dl/youtube_dl/downloader/external.py", line 64, in real_download
    self.get_basename(), retval))
  File "/usr/local/bin/youtube-dl/youtube_dl/downloader/common.py", line 166, in report_error
    self.ydl.report_error(*args, **kargs)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 617, in report_error
    self.trouble(error_message, tb)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 579, in trouble
    tb_data = traceback.format_list(traceback.extract_stack())
```

---

### If the purpose of this *issue* is a *site support request* please provide all kinds of example URLs support for which should be included (replace following example URLs by **yours**):
- Single video: https://freshlive.tv/sakuragakuin/199580

---

My youtube-dl and ffmpeg are the last version. I read some issue so I tried the option '--hls-prefer-native' with pycrypto, but this is not working (I also attach that code). I think that they not just use m3u8, they use series of .ts files. How to download the video using youtube-dl? Please help me. And I am sorry for my poor english.