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

[youtube] HTTPSConnectionV3 instance has no attribute '_tunnel_host' Android #1860

Closed
canamcy opened this issue Nov 29, 2013 · 8 comments
Closed
Labels
bug

Comments

@canamcy
Copy link

@canamcy canamcy commented Nov 29, 2013

video id = 1-5bzCOLMb8
ytdl version 2013.11.29

t/usr/lib/python2.6/httplib.py", line 874, in request
 File "/home/manuel/AptanaStudio3Workspace/python-for-android/python-build/ou
t/usr/lib/python2.6/httplib.py", line 911, in _send_request
 File "/home/manuel/AptanaStudio3Workspace/python-for-android/python-build/ou
t/usr/lib/python2.6/httplib.py", line 868, in endheaders
 File "/home/manuel/AptanaStudio3Workspace/python-for-android/python-build/ou
t/usr/lib/python2.6/httplib.py", line 740, in _send_output
 File "/home/manuel/AptanaStudio3Workspace/python-for-android/python-build/ou
t/usr/lib/python2.6/httplib.py", line 699, in send
 File "/mnt/sdcard/sl4a/scripts/!yo-2b/youtube_dl.py/youtube_dl/utils.py", li
551, in connect
 if self._tunnel_host:
ttributeError: HTTPSConnectionV3 instance has no attribute '_tunnel_host'
@Sepulep
Copy link

@Sepulep Sepulep commented Dec 1, 2013

found the same issue, python 2.6

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Dec 2, 2013

Could you please post wich version of python2.6 are you using?, you can run python --version or youtube-dl --verbose.

@Sepulep
Copy link

@Sepulep Sepulep commented Dec 2, 2013

2.6.2 here

@Sepulep
Copy link

@Sepulep Sepulep commented Dec 2, 2013

it works on 2.6.2 with:

--- a/youtube_dl/utils.py
+++ b/youtube_dl/utils.py
@@ -548,9 +548,12 @@ def make_HTTPS_handler(opts_no_check_certificate):

             def connect(self):
                 sock = socket.create_connection((self.host, self.port),
-                if self._tunnel_host:
-                    self.sock = sock
-                    self._tunnel()
+                try:
+                    if self._tunnel_host:
+                        self.sock = sock
+                        self._tunnel()
+                except:
+                    pass
                 try:
                     self.sock = ssl.wrap_socket(sock, self.key_file, se
                 except ssl.SSLError:

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Dec 2, 2013

The problem was probably introduced in 13ebea7.
@phihag it uses a non-documented property, which (after a quick search) was added to python 2.6 in http://hg.python.org/cpython/rev/0f57b30a152f, the first release that included it seems to be 2.6.3. We should either check if the property is present (I haven't look carefully at the code) or bump the minimum supported version of python 2.6. What do you think?

@Sepulep
Copy link

@Sepulep Sepulep commented Dec 8, 2013

any update on this issue? I would be grateful if you could maintain compatibility for 2.6.2, cause I am using youtube-dl for a youtube app on the openpandora handheld - http://repo.openpandora.org/?page=detail&app=thetube
(the firmware has 2.6.2, meaning I can keep the app very lean at 500kb)

@canamcy
Copy link
Author

@canamcy canamcy commented Dec 8, 2013

I only use youtube and it continues to work with 2013.11.21.

lopen libpython2.6.so
ython 2.6.2 (r262:71600, Mar 20 2011, 16:54:21)
GCC 4.4.3] on linux-armv6l
ype "help", "copyright", "credits" or "license" for more information.

@phihag phihag closed this in ac79fa0 Dec 9, 2013
@phihag
Copy link
Contributor

@phihag phihag commented Dec 9, 2013

Fixed in version 2013.12.09 and newer. You may have to reinstall these though, or update from an older version that works.

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