chrippa / livestreamer

Command-line utility that extracts streams from various services and pipes them into a video player of choice. No longer maintained, use streamlink or youtube-dl instead.
http://livestreamer.io/
BSD 2-Clause "Simplified" License
3.88k stars 580 forks source link

Crunchyroll plugin fails using Polipo as HTTPS proxy #339

Closed satsuki-sama closed 10 years ago

satsuki-sama commented 10 years ago

I'm using Livestreamer v1.7.5 on Ubuntu to watch Crunchyroll. In order to watch US-only shows from outside the US I normally use an ssh tunnel like ssh -D localhost:1080 user@example.com and set my browser to use localhost:1080 as a SOCKS proxy. But since Livestreamer requires a HTTP proxy, I'm using Polipo run locally on localhost:1234 with its parent SOCKS proxy set to localhost:1080.

This works in the web browser for HTTPS, but not in Livestreamer. With no http-proxy or https-proxy set, Livestreamer's Crunchyroll plugin works fine (but denies access to US-only shows).

With http-proxy=localhost:1234 and https-proxy=localhost:1234 in fhe config, Livestreamer gives an error: error: Unable to open URL: https://api.crunchyroll.com/start_session.0.json (_ssl.c:489: The handshake operation timed out) The Polipo documentation says it supports HTTPS (tunnels it, at least), and my web browser uses HTTPS just fine over the Polipo proxy.

With https-proxy=https://localhost:1234/ (specifying https://) it times out too.

With https-proxy=http://localhost:1234 (specifying http:// instead of https://), Livestreamer returns error: Unable to open URL: https://api.crunchyroll.com/start_session.0.json (400 Client Error: Couldn't parse URL)

chrippa commented 10 years ago

I'm not able to reproduce this here, what version of python-requests do you have?

chrippa commented 10 years ago

Actually, when using requests < 2.0 I also got the timeout. So try updating your requests.

satsuki-sama commented 10 years ago

Aha! I had an old version of requests (1.2.2), and updating requests solved the problem. Thanks for your help!