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

[Python3][Tumblr] Infinite redirect when using proxy feature #9654

Open
kidol opened this issue Jun 1, 2016 · 5 comments
Open

[Python3][Tumblr] Infinite redirect when using proxy feature #9654

kidol opened this issue Jun 1, 2016 · 5 comments

Comments

@kidol
Copy link
Contributor

@kidol kidol commented Jun 1, 2016

version 2016.05.30.2

youtube-dl -j "http://sythnmsvntn.tumblr.com/post/145116566731/little-kid-dancing-to-seventeens-pretty-u-this-is

WITHOUT proxy:

Request 1:

GET /post/145116566731/

(why is youtube-dl removing part of the url here?)

Response:

HTTP/1.1 301 Moved Permanently
Location: http://sythnmsvntn.tumblr.com/post/145116566731/little-kid-dancing-to-seventeens-pretty-u-this-is#_=_

Request 2:

GET /post/145116566731/little-kid-dancing-to-seventeens-pretty-u-this-is HTTP/1.1

OK, page is now sent and youtube-dl handles it correctly.

WITH proxy:

Same as before, but request 2 looks like this:

GET http://sythnmsvntn.tumblr.com/post/145116566731/little-kid-dancing-to-seventeens-pretty-u-this-is#_=_

Notice the not removed #_=_ at the end. This causes tumblr to respond with yet another 301 redirect (as in first response) resulting in infinite loop:

ERROR: Unable to download webpage: HTTP Error 301: The HTTP server returned a redirect error that would lead to an infinite loop.

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Jun 1, 2016

Works fine for me either with proxy or without proxy. Please post the output of:

youtube-dl -vF "http://sythnmsvntn.tumblr.com/post/145116566731/little-kid-dancing-to-seventeens-pretty-u-this-is" --print-traffic --proxy your_proxy_ip:port

Note that --print-traffic is broken on Python 3 (#9365), so please use Python 2.

@kidol
Copy link
Contributor Author

@kidol kidol commented Jun 1, 2016

Hmm, with Python 2 it works correctly. Before I used the youtube-dl.exe which comes with Python 3.

So obviously something changed in Python url libs? If that's the case then youtube-dl should probably normalize the url manually.

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Jun 1, 2016

So obviously something changed in Python url libs?

Maybe. I can't reproduce it yet on Python 3 with a proxy. Need to investigate further.

@yan12125 yan12125 changed the title [Tumblr] Infinite redirect when using proxy feature [Python3][Tumblr] Infinite redirect when using proxy feature Jun 1, 2016
@kidol
Copy link
Contributor Author

@kidol kidol commented Jun 1, 2016

I can't reproduce it yet on Python 3 with a proxy

Strange. Here is version info:

[debug] Python version 3.4.4 - Windows-7-6.1.7601-SP1

@kidol
Copy link
Contributor Author

@kidol kidol commented Jun 1, 2016

Related python bug I found (even though it says 2.7): http://bugs.python.org/issue18119

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.