ArdiArtani / Google-Drive-Player-Script

Grab google drive streaming links (redirector.googlevideo.com/videoplayback?..)
https://ardiartani.github.io/Google-Drive-Player-Script/
MIT License
321 stars 232 forks source link

Error video #101

Closed mongmonk closed 5 years ago

mongmonk commented 5 years ago

All video from google drive got error today :( .

Zebraslive commented 5 years ago

Same here. Something changed recently. I wasn't having any problems until a few weeks ago. When trying to get a shareable link it says "anyone with link can comment" instead of the usual "anyone with link can view". It can't be changed even if you set it to public it will force comment only when you hit the supposed download limit.

I'm using unlimited gdrive account.......with only 77gb uploaded. I've had accounts in the past with 250+gb and never had any view limitations.

When you hit the limit, all videos on the account will stop working for an unknown amount of time. (not 24hrs)

xEmily911 commented 5 years ago

I've encountered this error today. I am unsure if it's a google sided error, or JWPlayer.

I created a support ticket with jwplayer to find out more.

GDrive videos still work fine, and can create share-links with anyone can view without signup.

So I think either JWPlayer has changed something (they just had maintenance a few hours ago) or google has changed something.

Zebraslive commented 5 years ago

@xEmily911 It's not JWplayer, I don't use it. I use videojs. Google has definitely changed something.

xEmily911 commented 5 years ago

@xEmily911 It's not JWplayer, I don't use it. I use videojs. Google has definitely changed something.

Well i've got like 1500+ videos that are now all error-coded.

I am hoping someone can hotfix this issue so my cache/videos return to working.

In mean-time, will have to write up an re-director to obscure gdrive embed urls.

Zebraslive commented 5 years ago

it appears to be limited based on server ip. So if it gets limited just use a proxy host.

xEmily911 commented 5 years ago

it appears to be limited based on server ip. So if it gets limited just use a proxy host.

Can you elaborate further?

Are you saying gdrive is limiting direct download/access IP's for servers hosting/using the drive script?

Have you tried installing the script on a fresh ip/webhost and no problem?

xEmily911 commented 5 years ago

I see. Your solution is simple, however, not ideal for my scenario.

1500+ posts are using iframe embeds from the domain associated with the embed scrip).

If I understand, your idea; would require me to go in and manually change and then publish update them all 1 by 1 to the new domain (uploading embed folder backup to new hoster - newipdomain.com/embed/cachedtoken).

I could maybe automate this process with Python, but I feel like it might just be simpler to find a solution to whatever google has done to blacklist our server IP's (if that is the case).

JWPlayer support got back to me, has informed me although they do not support gdrive/3rd party scripts; that something fundamentally has changed with the drive api and that the file strings in our players are empty (likely a result of the files not being served from their host)

Do you have skype, Zebra?

xEmily911 commented 5 years ago

Okay,

So I ran embed script from a new IP (on my box) - Still encountering the same problem.

So either (by your explanation) gdrive has blacklisted the IP range of my server (xxx.xxx.xxx.1/2/3/4/5/6) or there's a security update that now longer allows script to curl download token..

I don't think its IP blacklisting (and rather a security update) because;

1) I have tried multiple gdrive accounts now (all of which should have no blacklisting) on new IP and still returns error code on video player 2) To be absolutely sure, I tried another box that isn't on same ip range and still same error

I have yet to try local hosting JWPlayer, or a JWPlayer alternative to see if error still occurs.

If the error doesn't reproduce with self-hosted JW or another player. Then it would indicate the error being with player, and not gdrive.

I will try these other solutions, and update you.

xEmily911 commented 5 years ago

I tried the script already on another box, and still same result. Cannot pull video gdrive.

xEmily911 commented 5 years ago

I tried my own forked zip on another box. I haven't tried the newer version, or yours.

Do you have skype or discord? I would like to chat further privately if possible.

If you do, let me know and I'll forward you my addies.

Zebraslive commented 5 years ago

I tried my own forked zip on another box. I haven't tried the newer version, or yours.

Do you have skype or discord? I would like to chat further privately if possible.

If you do, let me know and I'll forward you my addies.

I don't really get on skype or discord much, I'm very busy managing my own sites and other work. I have over 8000 videos using gdrive and the proxy fix i had posted seemed to work at first but now it's not working. just have to buy more gdrive accounts and spread out the videos between accounts. send your skype or discord and I'll add you when I can.

ArdiArtani commented 5 years ago

Hello everyone,

I’m going to take a look and see what google changed. I haven’t been active the past couple of months. I will keep you updated.

Sent with GitHawk

xEmily911 commented 5 years ago

Hello everyone,

I’m going to take a look and see what google changed. I haven’t been active the past couple of months. I will keep you updated.

Sent with GitHawk

Thank you, Adri.

Please keep us updated on new developments.

adeadw commented 5 years ago

me neither,,:

{ "id": "0B04yda-aeq8sTS1jYldYWV9DbUU", "title": "%5B720p%5D+LK21.ORG+-+Nayak%3A+The+Real+Hero+%282001%29.mp4", "image": "https:\/\/lh5.googleusercontent.com\/BnchWWoH-VaSBbPxBgrLn720wqj5wDBbTAmyaWnxMXd2HJk3gNVXQw=w1200-h630-p", "label": "HD", "file": "", "type": "video\/mp4", "embed_id": "amVNOHNPVWlPckU3L1F3K0ZCUU5nYzhwOXdBMkVTYk9vL1hwb3BnOFZ6dz0=" }

the "file:" not showing the source of the video,, but the "image:" of the gdrive video is showing.. really weird,, something must be changed by google.

but the demo player of the script here: https://googledriveplayer.herokuapp.com/

is working fine,, i need to know why its still working fine on the demo but stopped working on mine.

xiopt commented 5 years ago

I was checking yesterday the get.google.com albumarchive interface and I had some old picasa videos stored that were public. I tested the ipv4/ipv6 method and it seems to be working fine. Has someone any idea how to make videos public in albumarchive from google photos or google drive? I will get a demo ready.

EDIT Here is a demo link

DonCorleone9 commented 5 years ago

I was checking yesterday the get.google.com albumarchive interface and I had some old picasa videos stored that were public. I tested the ipv4/ipv6 method and it seems to be working fine. Has someone any idea how to make videos public in albumarchive from google photos or google drive? I will get a demo ready.

EDIT Here is a demo link

How did you make it work ? Any pointers to the exact ipv4/v6 method ? I have heard about it and found an old proxy streaming repo but it doesn't work.. Please can you tell me where to get the code for your demo ? Thanks. 👍

DonCorleone9 commented 5 years ago

me neither,,:

{ "id": "0B04yda-aeq8sTS1jYldYWV9DbUU", "title": "%5B720p%5D+LK21.ORG+-+Nayak%3A+The+Real+Hero+%282001%29.mp4", "image": "https://lh5.googleusercontent.com/BnchWWoH-VaSBbPxBgrLn720wqj5wDBbTAmyaWnxMXd2HJk3gNVXQw=w1200-h630-p", "label": "HD", "file": "", "type": "video/mp4", "embed_id": "amVNOHNPVWlPckU3L1F3K0ZCUU5nYzhwOXdBMkVTYk9vL1hwb3BnOFZ6dz0=" }

the "file:" not showing the source of the video,, but the "image:" of the gdrive video is showing.. really weird,, something must be changed by google.

but the demo player of the script here: https://googledriveplayer.herokuapp.com/

is working fine,, i need to know why its still working fine on the demo but stopped working on mine.

Even the demo player of ArdiArtani is not working anymore..

xiopt commented 5 years ago

I was checking yesterday the get.google.com albumarchive interface and I had some old picasa videos stored that were public. I tested the ipv4/ipv6 method and it seems to be working fine. Has someone any idea how to make videos public in albumarchive from google photos or google drive? I will get a demo ready. EDIT Here is a demo link

How did you make it work ? Any pointers to the exact ipv4/v6 method ? I have heard about it and found an old proxy streaming repo but it doesn't work.. Please can you tell me where to get the code for your demo ? Thanks. 👍

function getURL($url) {
      $ch = curl_init();
      curl_setopt($ch, CURLOPT_URL, $url); //set url
      curl_setopt($ch, CURLOPT_HEADER, true); //get header
      curl_setopt($ch, CURLOPT_NOBODY, true); //do not include response body
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); //do not show in browser the response
      curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); //follow any redirects
      curl_exec($ch);
      $new_url = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL); //extract the url from the header response
      curl_close($ch);
    $url = !empty($new_url) ? preg_replace('/^https:\/\/(.*)\.googlevideo.com/', 'https://redirector.googlevideo.com', $new_url) : '';
  return $url;
}

$link = !empty($_GET['link']) ? trim($_GET['link']) : 'https://get.google.com/albumarchive/linktovideo';

$data = file_get_contents($link);

$data = preg_replace_callback('/\\\\u([0-9a-fA-F]{4})/', function ($match) {
    return mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE');
}, $data);
$data = urldecode($data);
preg_match_all('/(https\:\/\/lh\d{1,}\.\w+\.com\/\S+)\&itag\=(\d{2}).*\&type\=video\/(.*)\;/U', $data, $m);

$map = [
  '37' => '1080p',
  '22' => '720p',
  '18' => '360p',
];

if(empty($m[2])) die('No links');

$json = [];
foreach($m[2] as $i => $res) {
  if(!empty($map[$res])) {
    $json[] = ['label' => $map[$res], 'type' => 'video/mp4', 'file' => getURL($m[1][$i])];
  }
}

The code is actually simple. You don't need a server that has ipv6. it's working fine with ipv4 only. the problem is that it works only with videos that were uploaded to picasa.

DonCorleone9 commented 5 years ago

I was checking yesterday the get.google.com albumarchive interface and I had some old picasa videos stored that were public. I tested the ipv4/ipv6 method and it seems to be working fine. Has someone any idea how to make videos public in albumarchive from google photos or google drive? I will get a demo ready. EDIT Here is a demo link

How did you make it work ? Any pointers to the exact ipv4/v6 method ? I have heard about it and found an old proxy streaming repo but it doesn't work.. Please can you tell me where to get the code for your demo ? Thanks. 👍

function getURL($url) {
      $ch = curl_init();
      curl_setopt($ch, CURLOPT_URL, $url); //set url
      curl_setopt($ch, CURLOPT_HEADER, true); //get header
      curl_setopt($ch, CURLOPT_NOBODY, true); //do not include response body
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); //do not show in browser the response
      curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); //follow any redirects
      curl_exec($ch);
      $new_url = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL); //extract the url from the header response
      curl_close($ch);
    $url = !empty($new_url) ? preg_replace('/^https:\/\/(.*)\.googlevideo.com/', 'https://redirector.googlevideo.com', $new_url) : '';
  return $url;
}

$link = !empty($_GET['link']) ? trim($_GET['link']) : 'https://get.google.com/albumarchive/linktovideo';

$data = file_get_contents($link);

$data = preg_replace_callback('/\\\\u([0-9a-fA-F]{4})/', function ($match) {
    return mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE');
}, $data);
$data = urldecode($data);
preg_match_all('/(https\:\/\/lh\d{1,}\.\w+\.com\/\S+)\&itag\=(\d{2}).*\&type\=video\/(.*)\;/U', $data, $m);

$map = [
  '37' => '1080p',
  '22' => '720p',
  '18' => '360p',
];

if(empty($m[2])) die('No links');

$json = [];
foreach($m[2] as $i => $res) {
  if(!empty($map[$res])) {
    $json[] = ['label' => $map[$res], 'type' => 'video/mp4', 'file' => getURL($m[1][$i])];
  }
}

The code is actually simple. You don't need a server that has ipv6. it's working fine with ipv4 only. the problem is that it works only with videos that were uploaded to picasa.

Thanks a lot for the code.. And is it not possible anymore ? I mean picasa is now google photos.. Is it not possible to upload to google photos and do the same ? Pardon my ignorance

xiopt commented 5 years ago

This is what I trying to find out. The picasa API is still active so theoretically it's possible to upload and the videos will show up on albumarchive. The problem is that the API will be turned down in January 2019 so it's useless to try now.

DonCorleone9 commented 5 years ago

Thanks.. Hopefuly @ArdiArtani will update us soon.

DonCorleone9 commented 5 years ago

I tried the script & its working perfectly right now.. What are you all experiencing ? Because Ardi has left this issue open so not sure if its just working for me or working for everyone ?

ArdiArtani commented 5 years ago

It should work now! Download the new release v2.0

mongmonk commented 5 years ago

I got the simple solution for video download link. just need googledrive API. bellow the link <?php $api = "API GOOGLEDRIVE KEY"; //ex: AIxxxxxx $id = "ID FILE GOOGLE DRIVE"; //ex: 1OVtpk04QS0q1aZuBhraCfscRJhzy0R3D $link = "https://www.googleapis.com/drive/v3/files/$id?alt=media&key=$api"; echo $link;

DonCorleone9 commented 5 years ago

@mongmonk Does this method have rate limit ? As I believe API always have rate limit in Google..please verify this. Thanks

mongmonk commented 5 years ago

I don't know. I just trick it with create some API key and shuffle it :)