-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
SOCKS proxy support #402
Comments
The quick and dirty patch is to install http://code.google.com/p/socksipy-branch/ and put the following after the import statements in
I can't guarantee that this does not have leaks (actually, I am pretty sure that this might suffer from DNS leaks) cc: @lenik |
For a long-term solution we need either to:
Some reference: http://stackoverflow.com/questions/2317849/how-can-i-use-a-socks-4-5-proxy-with-urllib2 |
I tried @FiloSottile 's #402 (comment) solution. Two pointers:
import socks
socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, 'localhost', 9999)
socks.wrapmodule(compat_urllib_request) |
From this page http://www.linuxjournal.com/content/use-ssh-create-http-proxy comments:
So this would be |
+1 for this. |
I looked for SOCKS support when trying to get round a geo-restricted source. Surprised it isn't already implemented in master to be honest. |
@Orbixx If you can point us to a pull request of yours which implements SOCKS, we're happy to merge that into master. |
@phihag Does the pull request have to be free of new dependencies or is it ok to depend on socksipy? |
+1 for this one. any updates? |
+1 |
5 similar comments
+1 |
+1 |
+1 |
+1 |
+1 |
Feature is implemented in PR #6353 |
I could was not able to build the windows binary with py2exe, so I could not test that. The feature will not work under windows or anywhere else without the PySocks package installed. I first tried to use the "official" socksipy package, but that is no longer maintained and I needed a newer feature that is only in PySocks to implement a feature @yan12125 wanted. |
@Don42 I guess technically it's possible to bundle PySocks with youtube-dl via py2exe, while there are legal concerns. youtube-dl is released under UNLICENSE, while PySocks is under BSD like license. I'm not sure whether it's OK to bundle them together. |
@yan12125 The License of PySocks states that Redistribution is allowed when the "Copyright Notice, list of conditions and the disclaimer is reproduced in the documentation and/or other materials". I don't know what kind of documentation is available for the exe, but I should be possible to add it somewhere in there. Or maybe add a "--license" command and print it when on windows. In any case, the way I implemented the feature would allow it to be a Linux/OSX only feature where the user would have to install PySocks if and when they want to use a SOCKS proxy. |
+1 |
The same issue here, can't download videos using server in Germany. |
+1 Using proxychains doesn't work with youtube-dl for me, though it works for almost everything else. Doesn't even work when I do proxychains bash, then youtube-dl inside of that, which is a workaround that works for npm. Here's the output I get after waiting a few minutes for a timeout: https://gist.github.com/7266d1ee29800f458772 |
Love to see this 👍 |
+1 Has anyone discovered a workaround for this yet? |
@Ianvdl Workaround for what exactly? I have a branch that works with SOCKS proxies. It might be a bit old, but it still works. As it probably won't be merged I am not updating it regularly. |
@Don42 I'll take a look at your fork sometime to see if I can merge it with the latest version. I find myself having to update often due to youtube's constant changes, so I expect that your version (given that it is outdated) might not be sufficient. |
@Ianvdl That is possible. I tested it a few weeks back and it still worked. The changes are quite localized, so it should be easily merged. The only problem was, that it has a dependency and I couldn't add that to the windows exe builder. But it is a soft dependency, when it's not available everything except the SOCKS proxy will work as expected. |
Suggest use cow to convert you socks to http proxy. then
|
@zqwroiez that is so fucking cool. You++. |
Looks like @zqwroiez's comment and account have both been deleted, mysterious. I'll add the comment back as it appears in the GitHub notification email I got: On Fri, Jan 22, 2016 at 6:24 AM, zqwroiez notifications@github.com wrote:
I wanted to try this, but unfortunately there's no formula for DeleGate in homebrew, though a PR was opened in the past: Homebrew/legacy-homebrew#30807. Tried asking the author of that PR what happened but haven't heard back yet. Just thought I'd mention here in case anyone reading would be interested in picking that back up. |
+1 |
Not sure how these guys got it working back then, but urllib3 1.14 with PySocks>=1.5.6,<2.0 supports SOCKS. I've got urllib3 1.14 with PySocks master (which is apparently at 1.5.6), but still getting |
Just noting here that, recent versions of |
SOCKS proxy support has been added in youtube-dl 2016.05.10. |
youtube-dl --proxy "socks5://127.0.0.1/" |
[pull] master from ytdl-org:master
The necessity arose in #171 and even I needed it to debug a geo-blocked video.
There was an attempt on #305 that faced license issues.
I implemented it some time ago with SocksiPy-branch but we don't like external dependencies, do we?
The text was updated successfully, but these errors were encountered: