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

`--hls-prefer-native` on a live twitch.tv stream uses ffmpeg anyway, bypasses proxy #15823

Closed
Jw86Ht opened this issue Mar 11, 2018 · 1 comment
Closed
Labels

Comments

@Jw86Ht
Copy link

@Jw86Ht Jw86Ht commented Mar 11, 2018

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2018.03.10. If it's not, read this FAQ entry and update. Issues with outdated version will be rejected.

  • I've verified and I assure that I'm running youtube-dl 2018.03.10

Before submitting an issue make sure you have:

  • At least skimmed through the README, most notably the FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones
  • 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)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other

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 ```):

$ ./youtube-dl -v -f 480p --hls-prefer-native --proxy socks5://127.0.0.1:9050/ https://www.twitch.tv/carlsagan42
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'-f', u'480p', u'--hls-prefer-native', u'--proxy', u'socks5://127.0.0.1:9050/', u'https://www.twitch.tv/carlsagan42']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2018.03.10
[debug] Git HEAD: d11691899
[debug] Python version 2.7.13 (CPython) - Linux-4.9.0-6-amd64-x86_64-with-debian-9.3
[debug] exe versions: ffmpeg 3.2.10-1, ffprobe 3.2.10-1, rtmpdump 2.4
[debug] Proxy map: {u'http': u'socks5://127.0.0.1:9050/', u'https': u'socks5://127.0.0.1:9050/'}
[twitch:stream] carlsagan42: Downloading stream JSON
[twitch:stream] carlsagan42: Downloading channel access token
[twitch:stream] carlsagan42: Downloading m3u8 information
[debug] Invoking downloader on u'https://video-weaver.fra02.hls.ttvnw.net/v1/playlist/Ct0Cojn-wSxhMMks9Vx5meXm9_glFtr1hh-lZHU5nCL2gkiPKoAKH6_5vZnzNNtmXu8lqtQi9Pb4m5l0N2FUby3E95lA4SFtWTXy2FBo_sSiaO9TSTL7MxEVScTjzyzK8QLWVKpu7bRuU-1KPSXbf5i0FmkoVK0dRHprt4ncfEN5UCQMry3eHD7OP2d6TpLZWjqkK76TipGU5Nhc6fhmmmT5n_SM3PWLxN14M0A-CO7-2YHlxTkCcsE_t18dEshuoXU53WHt8BNGVuEIG-aazWa6RbktHzYApS7yYYSPn-JxWdC9YumLL3lwdfvjGsgG041cjvLfAIInkHo4QOggZMdJbM2iCmYYjFep9P9JdU3XSRenytswvrSOA8CAaUjcPse8Y3-Q0OAI18nXgTonUK9Jmu7pbQmjp7xxmHij1HTQXWEGDa4WK2rrN58vQhrq92Kau5YFZIwhFQGzoijiABIQwCewrcVMde0tVoYAMxMBoBoMb6bZHixVpps31Dj5.m3u8'
[download] Destination: CarlSagan42 2018-03-10 19_50-27888787776.mp4
WARNING: ffmpeg does not support SOCKS proxies. Downloading is likely to fail. Consider adding --hls-prefer-native to your command.
[debug] ffmpeg command line: ffmpeg -y -loglevel verbose -headers 'Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
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)
' -i 'https://video-weaver.fra02.hls.ttvnw.net/v1/playlist/Ct0Cojn-wSxhMMks9Vx5meXm9_glFtr1hh-lZHU5nCL2gkiPKoAKH6_5vZnzNNtmXu8lqtQi9Pb4m5l0N2FUby3E95lA4SFtWTXy2FBo_sSiaO9TSTL7MxEVScTjzyzK8QLWVKpu7bRuU-1KPSXbf5i0FmkoVK0dRHprt4ncfEN5UCQMry3eHD7OP2d6TpLZWjqkK76TipGU5Nhc6fhmmmT5n_SM3PWLxN14M0A-CO7-2YHlxTkCcsE_t18dEshuoXU53WHt8BNGVuEIG-aazWa6RbktHzYApS7yYYSPn-JxWdC9YumLL3lwdfvjGsgG041cjvLfAIInkHo4QOggZMdJbM2iCmYYjFep9P9JdU3XSRenytswvrSOA8CAaUjcPse8Y3-Q0OAI18nXgTonUK9Jmu7pbQmjp7xxmHij1HTQXWEGDa4WK2rrN58vQhrq92Kau5YFZIwhFQGzoijiABIQwCewrcVMde0tVoYAMxMBoBoMb6bZHixVpps31Dj5.m3u8' -c copy -f mp4 'file:CarlSagan42 2018-03-10 19_50-27888787776.mp4.part'
ffmpeg version 3.2.10-1~deb9u1 Copyright (c) 2000-2018 the FFmpeg developers
[then it proceeds to download]

Because the --hls-prefer-ffmpeg downloader doesn't support a SOCKS proxy (#10304), I tried using --hls-prefer-native. But youtube-dl used ffmpeg anyway, and even emitted a warning telling me to use an option I was already using:

WARNING: ffmpeg does not support SOCKS proxies. Downloading is likely to fail. Consider adding --hls-prefer-native to your command.

Although the stream starts to download, it's clear that it's ffmpeg doing the downloading, and I verified with tcpdump that the download was not obeying my --proxy option.

In order to reproduce the problem, you'll need to find a stream that's currently online, otherwise you'll just get the error ERROR: <user> is offline. Sorry I don't know of any streams that are always available, but you can just choose one from the front page of https://twitch.tv/.

I tried without the --proxy option too: it still uses ffmpeg, though without the warning about not supporting a SOCKS proxy.

I tried uninstalling ffmpeg and repeating the command. When I do this, I get an error about an m3u8 download requiring ffmpeg or avconv. Here is the output log when ffmpeg is uninstalled:

$ ./youtube-dl -v -f 480p --hls-prefer-native --proxy socks5://127.0.0.1:9050/ https://www.twitch.tv/carlsagan42
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'-f', u'480p', u'--hls-prefer-native', u'--proxy', u'socks5://127.0.0.1:9050/', u'https://www.twitch.tv/carlsagan42']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2018.03.10
[debug] Git HEAD: d11691899
[debug] Python version 2.7.13 (CPython) - Linux-4.9.0-6-amd64-x86_64-with-debian-9.3
[debug] exe versions: rtmpdump 2.4
[debug] Proxy map: {u'http': u'socks5://127.0.0.1:9050/', u'https': u'socks5://127.0.0.1:9050/'}
[twitch:stream] carlsagan42: Downloading stream JSON
[twitch:stream] carlsagan42: Downloading channel access token
[twitch:stream] carlsagan42: Downloading m3u8 information
[debug] Invoking downloader on u'https://video-weaver.fra02.hls.ttvnw.net/v1/playlist/Ct0CN0Os0dJgqPUxm_h00xUjsaoWUI9SdZai0eVokpV3bXcb_G2Zb0N-j1nCEN3x8AUi3VX7W3OcSIkRKWmByTdAwod4RrOfQ-kbt4iX_u_9JBW7pYV8GCivcft7dv8Rez12zQNv8Vozs6kNc0jQRT3wO-I60oCHrh-SeL7ff8KZL5r-U-C62ODeLMqF1wz7eG1v_puFIEqZ2ZkU2rV-gVeo-x9b5SOra4DCIe_QZjxPEozR_cC1oacdUNDLDjqZlBYcUrFX86qi33NmV4q6zecB2G9dTrRZ7MNVc0IHupxc00zJFKOHVfxprJiXGXUiBGw_mWY5L9VAsDdAWDFFbYrfi2WoO8wdyB2-1LTt0jbrVbjqp1p9WNktVLY2gdAVx2naDLHMFw04W421xv6fffq0TgxuENgiZP2ew8u5scqUq9vNwNdRqGjN3hB1cQyYwJqjY7AQE3vsOGXK52RbSRIQ7DI_aJzTdnKiylmAq_Mj0RoMNtXmnKGd0XgyXvxU.m3u8'
[download] Destination: CarlSagan42 2018-03-10 19_52-27888787776.mp4
ERROR: m3u8 download detected but ffmpeg or avconv could not be found. Please install one.
  File "./youtube-dl", line 6, in <module>
    youtube_dl.main()
  File "/home/user/youtube-dl/youtube_dl/__init__.py", line 471, in main
    _real_main(argv)
  File "/home/user/youtube-dl/youtube_dl/__init__.py", line 461, in _real_main
    retcode = ydl.download(all_urls)
  File "/home/user/youtube-dl/youtube_dl/YoutubeDL.py", line 1989, in download
    url, force_generic_extractor=self.params.get('force_generic_extractor', False))
  File "/home/user/youtube-dl/youtube_dl/YoutubeDL.py", line 796, in extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "/home/user/youtube-dl/youtube_dl/YoutubeDL.py", line 850, in process_ie_result
    return self.process_video_result(ie_result, download=download)
  File "/home/user/youtube-dl/youtube_dl/YoutubeDL.py", line 1623, in process_video_result
    self.process_info(new_info)
  File "/home/user/youtube-dl/youtube_dl/YoutubeDL.py", line 1896, in process_info
    success = dl(filename, info_dict)
  File "/home/user/youtube-dl/youtube_dl/YoutubeDL.py", line 1835, in dl
    return fd.download(name, info)
  File "/home/user/youtube-dl/youtube_dl/downloader/common.py", line 364, in download
    return self.real_download(filename, info_dict)
  File "/home/user/youtube-dl/youtube_dl/downloader/external.py", line 33, in real_download
    retval = self._call_downloader(tmpfilename, info_dict)
  File "/home/user/youtube-dl/youtube_dl/downloader/external.py", line 209, in _call_downloader
    self.report_error('m3u8 download detected but ffmpeg or avconv could not be found. Please install one.')
  File "/home/user/youtube-dl/youtube_dl/downloader/common.py", line 166, in report_error
    self.ydl.report_error(*args, **kargs)
  File "/home/user/youtube-dl/youtube_dl/YoutubeDL.py", line 613, in report_error
    self.trouble(error_message, tb)
  File "/home/user/youtube-dl/youtube_dl/YoutubeDL.py", line 575, in trouble
    tb_data = traceback.format_list(traceback.extract_stack())
@dstftw
Copy link
Collaborator

@dstftw dstftw commented Mar 11, 2018

hls native does not support live streams.

@dstftw dstftw closed this Mar 11, 2018
@dstftw dstftw added the invalid label Mar 11, 2018
@ytdl-org ytdl-org deleted a comment from Techwolf Mar 19, 2018
@ytdl-org ytdl-org deleted a comment from Techwolf Mar 19, 2018
@ytdl-org ytdl-org locked and limited conversation to collaborators Mar 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.