google-api-php-client

How to upload LARGE files on YouTube [closed]

我怕爱的太早我们不能终老 提交于 2019-12-01 00:49:57
I have tried two methods to upload large files on YouTube but none of them works, each has its own issues, my aim is to find a correct answer to upload large files. First Method: It chunks the large files into different parts, and rather than sending them separately and upload them at once it uploads them separately. So at the end I have a long list of unloadable different parts of the file on Youtube rather than a single file. Code of method 1 if ($client->getAccessToken()) { $videoPath = "path/to/foo.mp4"; $snippet = new Google_VideoSnippet(); $snippet->setTitle("Test title2"); $snippet-

Upload large file to google drive with PHP Client Library

有些话、适合烂在心里 提交于 2019-11-30 23:51:19
问题 I am trying to use the Google Drive API via their PHP Client Library to upload a large file. Currently it fails because the only method seemingly available is the "simple" upload method. Unfortunately that requires you to load the entire file as data and it hits my php memory limit. I would like to know if it is possible and see an example of how it is done. I know there is a method for resumable and chuncked uploads, but there is no documentation on how to use it. <?php require_once 'google

google service account example returns “Error refreshing the OAuth2 token { “error” : “invalid_grant” }”

匆匆过客 提交于 2019-11-30 22:50:05
My goal is to make the simplest query on Google Fusion Tables on behalf of my web app users. For that, I created a service account on google console. Here is the code: // Creating a google client $client = new \Google_Client(); // setting the service acount credentials $serviceAccountName = 'XXXXX.apps.googleusercontent.com'; $scopes= array( 'https://www.googleapis.com/auth/fusiontables', 'https://www.googleapis.com/auth/fusiontables.readonly', ); $privateKey=file_get_contents('/path/to/privatekey.p12'); $privateKeyPassword='notasecret'; // the default one when generated in the console

In Google API v2, why is the error “The project id used to call the Google Play Developer API has not been linked” happening?

∥☆過路亽.° 提交于 2019-11-30 20:21:55
When I'm using Google API v2, to get an inapp listing , I'm getting the following error when I'm making the API call: { "error": { "errors": [ { "domain": "androidpublisher", "reason": "projectNotLinked", "message": "The project id used to call the Google Play Developer API has not been linked in the Google Play Developer Console." } ], "code": 403, "message": "The project id used to call the Google Play Developer API has not been linked in the Google Play Developer Console." } } I then researched this error and ended up seeing the suggestions on this page, this page, and on this page as well.

yii2, google outh2 and scope

心不动则不痛 提交于 2019-11-30 20:20:39
I am using Yii2, GoogleOAuth and yii2-user extension. I want to receive user google circles and set scope to my config: 'authClientCollection' => [ 'class' => 'yii\authclient\Collection', 'clients' => [ 'google' => [ 'class' => 'yii\authclient\clients\GoogleOAuth', 'clientId' => '758709912345-p4qp4lqihit5un1u6qb75msqp5m5j6d8.apps.googleusercontent.com', 'clientSecret' => 'ZygOIi1-0asfktUQ1pKOFOo', 'scope' => 'https://www.googleapis.com/auth/plus.login https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/drive', ], ], ] When I login with Google OAuth2 I had error:

Youtube PHP APi Check VIdeo Is Duplicate Or Not

允我心安 提交于 2019-11-30 14:31:06
问题 Hi I am using Google PHP API to upload video in PHP. I have followed this tutorial to implement this and it is working fine. But there is a problem if video is already exist in my channel it is also returning the video details and I can't find it is a rejected for duplicate. So I cant find this is a duplicate video or not and if it is duplicate then what is the main video. Means the video details of main video from which it is compared as duplicate. Please help me to find this is a duplicate

Google API Service Account Authorization Error

江枫思渺然 提交于 2019-11-30 12:18:42
问题 I am using the google-api-php-client client to connect to Google Drive using a Service Account. Most of the time it works, but every so often (say if I sit here an refresh the page over and over it's every 5th to 10th time), I receive a Google_Service_Exception with the message unauthorized_client: Client is unauthorized to retrieve access tokens using this method . The error only occurs if the $this->drive_service->files->listFiles() code is present. It does not occur if I use the Service

Youtube PHP APi Check VIdeo Is Duplicate Or Not

非 Y 不嫁゛ 提交于 2019-11-30 10:53:07
Hi I am using Google PHP API to upload video in PHP. I have followed this tutorial to implement this and it is working fine. But there is a problem if video is already exist in my channel it is also returning the video details and I can't find it is a rejected for duplicate. So I cant find this is a duplicate video or not and if it is duplicate then what is the main video. Means the video details of main video from which it is compared as duplicate. Please help me to find this is a duplicate video or not? The only solution I could come up with to check the video status is to use a field in the

How to create a public Google Doc through the Drive API (PHP client)

二次信任 提交于 2019-11-30 10:27:54
This is what I've got so far, by combining this and this : require_once "google-api-php-client/src/Google_Client.php"; require_once "google-api-php-client/src/contrib/Google_DriveService.php"; require_once "google-api-php-client/src/contrib/Google_Oauth2Service.php"; //First, build a Drive service object authorized with the service accounts $auth = new Google_AssertionCredentials( DRIVE_SERVICE_ACCOUNT_EMAIL, array( DRIVE_SCOPE ), file_get_contents( DRIVE_SERVICE_ACCOUNT_KEY ) ); $client = new Google_Client(); $client->setUseObjects( true ); $client->setAssertionCredentials( $auth ); $service

How to get email address when user is authenticated with Google Oauth2 and people.me

℡╲_俬逩灬. 提交于 2019-11-30 09:38:38
问题 I'm new to php and the google api, I'm trying to get the email address when the user sing in with Google+, I get all the User info using $plus->people->get("me") but when I try to get the email address it fails with this error: PHP Notice: Undefined index: value here is my code: <?php session_start(); set_include_path(get_include_path() . PATH_SEPARATOR . $_SERVER['DOCUMENT_ROOT'] . "/src"); require_once 'Google/Client.php'; require_once 'Google/Service/Plus.php'; $client_id =