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

Wrong proxy arguments passed to aria2 when using socks proxy (aria2 doesn't support socks) #16162

Closed
Tony-il-Capo opened this issue Apr 11, 2018 · 5 comments
Labels

Comments

@Tony-il-Capo
Copy link

@Tony-il-Capo Tony-il-Capo commented Apr 11, 2018

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.09. 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.04.09

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

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

 youtube-dl --ignore-config --proxy socks5://192.168.1.1:9050 --external-downloader '/usr/bin/aria2c' --external-downloader-args '--all-proxy=http://192.168.1.1:8118' -o '/youtube-dl/%(title)s_(%(upload_date)
s).%(ext)s' -f best https://www.youtube.com/watch?v=EK70LTD-GSk --verbose
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'--ignore-config', u'--proxy', u'socks5://192.168.1.1:9050', u'--external-downloader', u'/usr/bin/aria2c', u'--external-downloader-args', u'--all-proxy=http://192.168.1.1:8118', u'-o', u'/youtube-dl/%(title)s_(%(upload_date)s).%(ext)s', u'-f', u'best', u'https://www.youtube.com/watch?v=EK70LTD-GSk', u'--verbose']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2018.04.09
[debug] Python version 2.7.14 (CPython) - Linux-4.4.50-mips-with-glibc2.0
[debug] exe versions: ffmpeg 3.2.2
[debug] Proxy map: {u'http': u'socks5://192.168.1.1:9050', u'https': u'socks5://192.168.1.1:9050'}
[youtube] EK70LTD-GSk: Downloading webpage
[youtube] EK70LTD-GSk: Downloading video info webpage
[youtube] EK70LTD-GSk: Extracting video information
[youtube] EK70LTD-GSk: Downloading MPD manifest
[youtube] EK70LTD-GSk: Downloading MPD manifest
[debug] Invoking downloader on u'https://r2---sn-ntnxax8xo-cxge.googlevideo.com/videoplayback?expire=1523491213&dur=379.530&pl=24&ratebypass=yes&pcm2cms=yes&itag=22&ipbits=0&signature=9E0AC696CE5D71D22CC2A2366FCB76F184217759.CEE42668CB1AC16430641A9E5B670B84E2B72D27&mime=video%2Fmp4&source=youtube&ms=au%2Crdu&mv=m&mt=1523469507&mn=sn-ntnxax8xo-cxge%2Csn-4g5e6nes&mm=31%2C29&requiressl=yes&key=yt6&fvip=2&lmt=1523053383830877&id=10aef42d30fe1929&ei=LU3OWuqTJJGQhAfRkYPoDw&initcwndbps=662500&c=WEB&sparams=dur%2Cei%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpcm2cms%2Cpl%2Cratebypass%2Crequiressl%2Csource%2Cexpire&ip=192.36.27.4'
[download] Destination: /youtube-dl/VUUR-STRANGE MACHINES (THE GATHERING)06.04.2018 DOORNROOSJE  NIJMEGEN_(20180406).mp4
[debug] aria2c command line: /usr/bin/aria2c -c '--all-proxy=http://192.168.1.1:8118' --dir /youtube-dl --out 'VUUR-STRANGE MACHINES (THE GATHERING)06.04.2018 DOORNROOSJE  NIJMEGEN_(20180406).mp4.part' --header 'Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7' --header 'Accept-Language: en-us,en;q=0.5' --header 'Accept-Encoding: gzip, deflate' --header 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' --header 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0 (Chrome)' --all-proxy 'socks5://192.168.1.1:9050' '--check-certificate=true' -- 'https://r2---sn-ntnxax8xo-cxge.googlevideo.com/videoplayback?expire=1523491213&dur=379.530&pl=24&ratebypass=yes&pcm2cms=yes&itag=22&ipbits=0&signature=9E0AC696CE5D71D22CC2A2366FCB76F184217759.CEE42668CB1AC16430641A9E5B670B84E2B72D27&mime=video%2Fmp4&source=youtube&ms=au%2Crdu&mv=m&mt=1523469507&mn=sn-ntnxax8xo-cxge%2Csn-4g5e6nes&mm=31%2C29&requiressl=yes&key=yt6&fvip=2&lmt=1523053383830877&id=10aef42d30fe1929&ei=LU3OWuqTJJGQhAfRkYPoDw&initcwndbps=662500&c=WEB&sparams=dur%2Cei%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpcm2cms%2Cpl%2Cratebypass%2Crequiressl%2Csource%2Cexpire&ip=192.36.27.4'
Exception: [AbstractOptionHandler.cc:69] errorCode=28 We encountered a problem while processing the option '--all-proxy'.
  -> [OptionHandlerImpl.cc:520] errorCode=1 unrecognized proxy format
Usage:
 --all-proxy=PROXY            Use a proxy server for all protocols. To override
                              a previously defined proxy, use "".
                              You also can override this setting and specify a
                              proxy server for a particular protocol using the
                              --http-proxy, --https-proxy and --ftp-proxy
                              options.
                              This affects all downloads.

                              Possible Values: [http://][USER:PASSWORD@]HOST[:PORT]
                              Tags: #http, #https, #ftp



ERROR: aria2c exited with code 28
  File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/bin/youtube-dl/__main__.py", line 19, in <module>
    youtube_dl.main()
  File "/usr/bin/youtube-dl/youtube_dl/__init__.py", line 471, in main
    _real_main(argv)
  File "/usr/bin/youtube-dl/youtube_dl/__init__.py", line 461, in _real_main
    retcode = ydl.download(all_urls)
  File "/usr/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1993, in download
    url, force_generic_extractor=self.params.get('force_generic_extractor', False))
  File "/usr/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 800, in extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "/usr/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 854, in process_ie_result
    return self.process_video_result(ie_result, download=download)
  File "/usr/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1627, in process_video_result
    self.process_info(new_info)
  File "/usr/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1900, in process_info
    success = dl(filename, info_dict)
  File "/usr/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1839, in dl
    return fd.download(name, info)
  File "/usr/bin/youtube-dl/youtube_dl/downloader/common.py", line 365, in download
    return self.real_download(filename, info_dict)
  File "/usr/bin/youtube-dl/youtube_dl/downloader/external.py", line 64, in real_download
    self.get_basename(), retval))
  File "/usr/bin/youtube-dl/youtube_dl/downloader/common.py", line 166, in report_error
    self.ydl.report_error(*args, **kargs)
  File "/usr/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 617, in report_error
    self.trouble(error_message, tb)
  File "/usr/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 579, in trouble
    tb_data = traceback.format_list(traceback.extract_stack())
...
<end of log>

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

Note that youtube-dl does not support sites dedicated to copyright infringement. In order for site support request to be accepted all provided example URLs should not violate any copyrights.


Description of your issue, suggested solution and other information

Hi

When using socks proxy for youtube-dl and then using aria2c as downloader, it seems youtube-dl passes wrong argument to aria2c, as we can see from log, aria2c complains about --all-proxy argument that is automatically passed by youtube-dl, AFAIK aria2 does not support socks proxy, but youtube-dl automatically passes option like "--all-proxy 'socks5://ip:port'".
So we get unrecognized proxy format error
And shouldn't be --all-proxy= with the equal sign?

Please note that I've manually entered the correct argument to aria2 in command line, "--external-downloader-args '--all-proxy=http://192.168.1.1:8118'", but same argument automatically placed by youtube-dl overrides it

I someone could take a look, I would appreciate it.

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Apr 11, 2018

This is expected behavior.

@dstftw dstftw closed this Apr 11, 2018
@dstftw dstftw added the invalid label Apr 11, 2018
@Tony-il-Capo
Copy link
Author

@Tony-il-Capo Tony-il-Capo commented Apr 11, 2018

So, we can't use aria2 downloader when using a socks proxy for youtube-dl??

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Apr 11, 2018

Use http proxy for both.

@Tony-il-Capo
Copy link
Author

@Tony-il-Capo Tony-il-Capo commented Apr 11, 2018

OK, I will try that, thanks.

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Apr 11, 2018

Note that you should not mix --all-proxy with --proxy.

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
2 participants
You can’t perform that action at this time.