rjw57 / yt

Experiments with the YouTube API
MIT License
83 stars 25 forks source link

Will yt support a proxy setting toggle? #28

Open meeeo opened 11 years ago

meeeo commented 11 years ago

Hi, yt is good, I'm running it on my Raspberry Pi Model A, the only problem is, I'm in China. As you might know, youtube is blocked within China. I noticed that youtube-dl has a proxy toggle in its new version , and also has a --no-check-certificate toggle, so I tried to modify the init file under the whitey egg folder, searched for the "youtube-dl" words and added --no-check-certificate and --proxy [myhttpsproxy]. And I set bash proxy enviroment variables https_proxy and http_proxy to my proxy url too:"export http_proxy='http://192.168.1.200:8087' " and " export https_proxy='https://192.168.1.200:8087' ". Once in a while, I can get it run, and I could watch youtube videos, but can't turn pages, and could only search once, or otherwise yt will crash. After it crashed, some error messages got printed on the screen with some http errors. It crashs too much often in this way, so I can only using it through pptp vpn now, works good. So, will you please add some proxy settings if you have time and interesting? Better also have the --no-check-certificate toggle because I use Goagent(code.google.com/p/goagent) for my proxy server which use a faked certificate. Thanks. Sorry for my poor english, and I'm not sure this should be post here, but I've searched, can't find other better way to ask you. Not so good on the twitter?

rjw57 commented 11 years ago

If you could post the error messages, that's always helpful. They're not just written to be decorative :). That being said, I don't think yt directly supports proxies because of the library it uses to talk to YouTube. I've assigned myself to this issue and will look into it.

meeeo commented 11 years ago

Thanks for your reply, I'll post the error messages later.

meeeo commented 11 years ago

Hi, I recorded a operating procedure under bash , watched here, http://asciinema.org/a/5804 , all the error messages inside, hope this help. But this time I never get it work using proxies.

rjw57 commented 11 years ago

Thanks, I'll take a look at getting http_proxy environment variable support working but I can tell you now that I'll never merge something which silently passes --no-check-certificate to youtube-dl. If GoAgent can't sort out HTTPS proxying properly it is its own problem and I'm not going to be instrumental in spreading poor SSL hygiene. If people really, really want to pass that option, I want to make them have the hurdle of checking out the code and modifying it themselves.

meeeo commented 11 years ago

I really like to learn coding.

meeeo commented 11 years ago

I know a faked certificate is bad, but that has its reason for to access those blocked service in China, no matter what, thanks for your time and working.