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

HTTP/SOCKS Proxy upload file #6

Open
avono opened this issue Jul 6, 2012 · 1 comment
Open

HTTP/SOCKS Proxy upload file #6

avono opened this issue Jul 6, 2012 · 1 comment

Comments

@avono
Copy link

avono commented Jul 6, 2012

So I have an issue uploading a music file through the http proxy I am behind this query works

>>> song.search(artist="radiohead",title="Creep")

[<song - Creep>, <song - CREEP (LYRICS!)>, <song - Creep (Acoustic)>, <song - Creep (Radio Edit)>, <song - CREEP (Live)/(LYRICS!)>, <song - Creep (BBC Radio 1 Evening Session)>]

however doing this returns ...

>>> track.track_from_filename(filename)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "build/bdist.macosx-10.6-intel/egg/pyechonest/track.py", line 217, in track_from_filename
  File "build/bdist.macosx-10.6-intel/egg/pyechonest/track.py", line 196, in track_from_file
  File "build/bdist.macosx-10.6-intel/egg/pyechonest/track.py", line 174, in _track_from_string
  File "build/bdist.macosx-10.6-intel/egg/pyechonest/track.py", line 152, in _upload
  File "build/bdist.macosx-10.6-intel/egg/pyechonest/util.py", line 202, in callm
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 958, in request
    self._send_request(method, url, body, headers)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 992, in _send_request
    self.endheaders(body)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 954, in endheaders
    self._send_output(message_body)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 814, in _send_output
    self.send(msg)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 776, in send
    self.connect()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 757, in connect
    self.timeout, self.source_address)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 571, in create_connection
    raise err
socket.error: [Errno 60] Operation timed out

I have tried to "socksipy" (http://socksipy.sourceforge.net) to force the sockets to use the proxy like this:

>>> socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5,"socks.example.com")
>>> socket.socket = socks.socksocket

but to no avail.

I think that problems lies in the function util.callm or in httplib.HTTPConnection therefore I have also tried.

>>> track.util.opener = urllib2.build_opener(urllib2.ProxyHandler(),track.util.MyBaseHandler(), track.util.MyErrorProcessor())
@stowell
Copy link
Member

stowell commented Jul 8, 2012

Have you successfully connected to other sites through the proxy using urllib2?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants