KipgenNeo / youtube-upload

Automatically exported from code.google.com/p/youtube-upload
1 stars 0 forks source link

youtube-upload fails through HTTP proxy #81

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
= Versions

youtube-upload: 0.7.1
python: 2.7
python-gdata: 2.0.17

= Describe the steps (including the command you run) that will reproduce
the problem?

Installation and configuration are simple, but it seems that the script fails 
with HTTP proxy.  When I run it on a machine that does not go through our 
proxy, it works as expected; however, it fails on a machine which requires our 
proxy.  Any good suggestions on using this in an environment with an HTTP proxy?

Original issue reported on code.google.com by jeremyco...@gmail.com on 17 Sep 2012 at 2:47

GoogleCodeExporter commented 9 years ago
Have you tried setting the "http_proxy" environment variable? that's the 
standard way in the UNIX world and pycurl will probably honor it.

Original comment by tokland on 17 Sep 2012 at 3:36

GoogleCodeExporter commented 9 years ago
Actually, now that I've read a little more, it seems that Python
should get this from Windows anyway.  Also, I've written other simple
scripts for connecting to a URL in the past without needing to set
proxy stuff.  Hmmm...

Nonetheless, when I run it on the machine using the proxy, I get this:

Login to Youtube API: email='webmastr@co.frederick.va.us', password='**********'
Traceback (most recent call last):
  File "youtube_upload.py", line 448, in <module>
    sys.exit(catch_exceptions(EXIT_CODES, main_upload, sys.argv[1:]))
  File "youtube_upload.py", line 104, in catch_exceptions
    fun(*args, **kwargs)
  File "youtube_upload.py", line 380, in main_upload
    captcha_response=options.captcha_response)
  File "youtube_upload.py", line 181, in login
    self.service.ProgrammaticLogin(captcha_token, captcha_response)
  File "C:\Python27\lib\site-packages\gdata\service.py", line 771, in
ProgrammaticLogin
    headers={'Content-Type':'application/x-www-form-urlencoded'})
  File "C:\Python27\lib\site-packages\atom\http.py", line 163, in request
    connection.endheaders()
  File "C:\Python27\lib\httplib.py", line 937, in endheaders
    self._send_output(message_body)
  File "C:\Python27\lib\httplib.py", line 797, in _send_output
    self.send(msg)
  File "C:\Python27\lib\httplib.py", line 759, in send
    self.connect()
  File "C:\Python27\lib\httplib.py", line 1140, in connect
    self.timeout, self.source_address)
  File "C:\Python27\lib\socket.py", line 571, in create_connection
    raise err
socket.error: [Errno 10061] No connection could be made because the
target machine actively refused it

I'll see if I can get the other machine connected to our network and
see if merely running through a proxy breaks things where they once
worked.

Jeremy

Original comment by jeremyco...@gmail.com on 17 Sep 2012 at 4:06

GoogleCodeExporter commented 9 years ago
Revisited this today.  First, ignore what I said about not needing to
set proxy stuff in the past.  Something changed with the proxy at work
which made those things work.  Now they don't.  So, I added http_proxy
environment variable in Windows with value like
"http://user:pass@proxyurl:port/".  Then I tried a simple
weather-scraping script I wrote using Requests
(http://pastebin.com/D3Nfn85u).  It connects to its URL with no
trouble.  This script, however, is still not working with the proxy
environment variable.

On Mon, Sep 17, 2012 at 12:06 PM, Jeremy Coulson
<jeremycoulson@gmail.com> wrote:

Original comment by jeremyco...@gmail.com on 18 Sep 2012 at 3:50

GoogleCodeExporter commented 9 years ago
now I realize... have you tried setting both http_proxy and https_proxy? 
get_categories use http but python-gdata and pycurl most certainly use https.

Original comment by tokland on 18 Sep 2012 at 4:14

GoogleCodeExporter commented 9 years ago
A ha!  I will try it.  I have a meeting right now, but I can't wait to
give it a shot!

Original comment by jeremyco...@gmail.com on 18 Sep 2012 at 5:34

GoogleCodeExporter commented 9 years ago
Bingo.  I added https_proxy alongside http_proxy and we're in
business.  Thanks a ton!  Now stand by for my next question about this
script :)

Original comment by jeremyco...@gmail.com on 18 Sep 2012 at 7:16

GoogleCodeExporter commented 9 years ago
great, added info to the [README]

Original comment by tokland on 18 Sep 2012 at 7:20

GoogleCodeExporter commented 9 years ago

Original comment by tokland on 13 May 2014 at 2:55