danipragustia / php-videoproxy-gdrive

Proxy video for Google Drive
GNU Affero General Public License v3.0
19 stars 15 forks source link

Is there anyway to prevent limit exceeded? #3

Closed xubmuajkub closed 4 years ago

xubmuajkub commented 4 years ago

I've applied this to one of my demo server and ask people to test. But recently I got an error, so I take a look at it and it shows the data below:

status=fail&hl=en_US&allow_embed=0&ps=docs&partnerid=30&errorcode=150&reason=Unable+to+play+this+video+at+this+time.+The+number+of+allowed+playbacks+has+been+exceeded.+Please+try+again+later.&timestamp=1598702998804&suberrorcode=4&BASE_URL=https%3A%2F%2Fdrive.google.com%2F

Even when the file I used to test is a newly created one, still got the error.

Do you have anyway to fix this?

kevinzie commented 4 years ago

you need proxy server dude. you can use squid proxy.

xubmuajkub commented 4 years ago

you need proxy server dude. you can use squid proxy.

Not sure what to do, I'm totally new to networking side.

So is it that I have a Apache server (Ubuntu) which host this PHP script, so I just need to install Squid and do the basic config and that's all?

danipragustia commented 4 years ago

Didn't have the issue so far, As @kevinzie mention if you reach the limit you can set proxy on curl_setopt_array to bypass limit or wait 24 Hours (with little bit more) to reset daily quota playback.

danipragustia commented 4 years ago

@xubmuajkub Need for information where you got the result fail, so i can some error handling on it. I would make if there daily quota exceeded, It would be use proxy instead direct.

xubmuajkub commented 4 years ago

@xubmuajkub Need for information where you got the result fail, so i can some error handling on it. I would make if there daily quota exceeded, It would be use proxy instead direct.

@danipragustia The error is come from the write_data function on the get_video_info.

For the daily quota exceeded, I want to setup my own proxy server but I just have no experience on this.

xubmuajkub commented 4 years ago

@danipragustia You can test my proxy server 157.245.205.127 port 3128. But seems like I didn't get it to work.

kevinzie commented 4 years ago

@danipragustia You can test my proxy server 157.245.205.127 port 3128. But seems like I didn't get it to work.

I think your squid configuration is not public. or your server ip is not configured on squid conf

$proxyList = Helper::getProxy(); $ch = curl_init($urls); curl_setopt($ch, CURLOPT_PROXY, $proxyList['ip']); curl_setopt($ch, CURLOPT_PROXYPORT, $proxyList['port']); if (!empty($proxyList['auth'])) { curl_setopt($ch, CURLOPT_PROXYUSERPWD, $proxyList['auth']); } curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HEADER, 1); $result = curl_exec($ch); curl_close($ch);

Thats my curl code, inside getProxy, i've created random ip from database.

Screenshot_371

xubmuajkub commented 4 years ago

@danipragustia You can test my proxy server 157.245.205.127 port 3128. But seems like I didn't get it to work.

I think your squid configuration is not public. or your server ip is not configured on squid conf

$proxyList = Helper::getProxy(); $ch = curl_init($urls); curl_setopt($ch, CURLOPT_PROXY, $proxyList['ip']); curl_setopt($ch, CURLOPT_PROXYPORT, $proxyList['port']); if (!empty($proxyList['auth'])) { curl_setopt($ch, CURLOPT_PROXYUSERPWD, $proxyList['auth']); } curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HEADER, 1); $result = curl_exec($ch); curl_close($ch);

Thats my curl code, inside getProxy, i've created random ip from database.

Screenshot_371

I got it worked now. It's not working because I was running Ubuntu 20, so after downgrade to Ubuntu 18. Now the proxy server seems to work.

xubmuajkub commented 4 years ago

@kevinzie I have a question. Do I need to always generate new IP? Or just simply use same single IP for every request? I would be really really appreciate if you would give me hints. Thanks.

xubmuajkub commented 4 years ago

This is what I got from sending request through proxy. I'm stuck. lol

image

kevinzie commented 4 years ago

This is what I got from sending request through proxy. I'm stuck. lol

image

Didnt see that message? your ISP network problem, Im using gcloud & vultr for server proxy. it works!

kevinzie commented 4 years ago

@kevinzie I have a question. Do I need to always generate new IP? Or just simply use same single IP for every request? I would be really really appreciate if you would give me hints. Thanks.

Ya, im using 6 proxy server for generating get_video_info data.

  1. Proxy server randomly.
  2. getting one proxy server IP
  3. if success, data will be cached for 3 hours, and if fail, trying to use another IP.

I've created laravel module for videoproxy gdrive. maybe I'll share it later..

example generated video : https://bit.ly/3lAWMSr

xubmuajkub commented 4 years ago

@kevinzie I can't play your video. Anyway, are you willing to help me setup? Of course it's not free

kevinzie commented 4 years ago

@kevinzie I can't play your video. Anyway, are you willing to help me setup? Of course it's not free

maybe you've addons like adsblock. you can visit my site emkalab, and we'll talk about your problem via livechat.