Giter Club home page Giter Club logo

api-samples's Introduction

api-samples

Code samples for YouTube APIs, including the YouTube Data API, YouTube Analytics API, and YouTube Live Streaming API. The repo contains language-specific directories that contain the samples.

api-samples's People

Contributors

andydiamondstein avatar bshaffer avatar carlyalexandra avatar gguuss avatar jeffposnick avatar kl3ryk avatar mchambers avatar naoman avatar njuettner avatar rasa avatar samuelteixeiras avatar ttruong21 avatar ulukaya avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

api-samples's Issues

Getting View Count in youtube api V3 in search video list

I want to get videos view counts plus number of likes and dislikes
Here is my code in ruby

opts = Trollop::options do
opt :q, 'Search term', :type => String, :default => "#{search_params}"
opt :maxResults, 'Max results', :type => :int, :default => 25
end

client = Google::APIClient.new(:key => DEVELOPER_KEY,:authorization => nil)
youtube = client.discovered_api(YOUTUBE_API_SERVICE_NAME, YOUTUBE_API_VERSION)
opts[:part] = 'id,snippet,status,statistics'
opts[:pageToken] = session[:nextPageToken]

search_response = client.execute!(
  :api_method => youtube.search.list,
  :parameters => opts
)

It works fine if I set opts[:part] = 'id,snippet' but getting this error "Google::APIClient::ClientError (status)" on setting opts[:part] = 'id,snippet,status,statistics'

Please help me and tell me what should I do to get number of views , likes and dislikes in search list

Thanks in Advance

.Net C# Sample code for upload video is not working

Whenever I want to try to upload the video through .net c# sample code then the it shows in seconds that the video is shared successfully but when i go to my youtube account there is no video uploaded anyhow i try my best to recognize the error or find the actual problem that why do the API is not working but alas all in vain i tried stack overflow as well as code project but couldn't resolve the problem and this is my last hope and expecting the positive response from you kindly it means a lot
if you just take a look and point the actual problem so that I can resolve it I hope you will respond to my humble request thank you I am also attaching the files of my code which I used in my project .
youtube.txt

youtube.php file not found

in the documentation have Google/Service/Youtube.php file but this is not in the folder, i can not find this in the api files.

batch_report_download.py doesn't work anymore.

Here is the error log:

$ python batch_report_download.py  --content-owner-id [my-content-owner-id] --report-type claims
Your browser has been opened to visit:

    https://accounts.google.com/o/oauth2/auth?scope=...

If your browser is on a different machine then exit and re-run this
application with the command-line parameter 

  --noauth_local_webserver

Authentication successful.
Traceback (most recent call last):
  File "batch_report_download.py", line 117, in <module>
    reports = get_available_reports(youtubeAnalytics, args.content_owner_id)
  File "batch_report_download.py", line 81, in get_available_reports
    return definitions_list_response["items"]
KeyError: 'items'

Mostly because youtubeAnalytics.batchReportDefinitions.list's result is empty, see result from https://developers.google.com/apis-explorer/#s/youtubeAnalytics/v1beta1/youtubeAnalytics.batchReportDefinitions.list

screen shot 2015-05-12 at 13 02 45

Am I missing something here or Is there any way to fix this? I've tried to google around a lot and still can not find any solution to this.

New channel: API is not returning if it's live or not

The goal of my YouTube API call is, given a channelId, return whether that channel is currently live streaming or not. I'm using this currently:

https://www.googleapis.com/youtube/v3/search?part=snippet&channelId={CHANNEL_ID}&eventType=live&type=video&key={API_KEY}
In the result if items[] is empty, I conclude it's live, else offline.

This is not working with my channel ID (UCwY_JgHY-B0K9NFAxzuTVSQ). The channel is going live, but the api call returns null for items[]. But It's working when I provide some other popular channel's ID. (for example, this channel: https://www.youtube.com/channel/UCe_3CoEeinvPMze2u_aENBg)

How to add thumbnail upon upload

The class Google_Service_YouTube_VideoSnippet has a method setThumbnails that takes as a parameter an instance of Google_Service_YouTube_ThumbnailDetails which has two interesting methods called setDefault and setStandard which takes in parameter an instance of Google_Service_YouTube_Thumbnail which itself has a method called setUrl. This is the method I use to set the thumbnail url. I've also set the width and the height just in case, making sure the minimum width is 640.

However, upon upload the thumbnail I chose is not set. Why? What am I doing wrong?
( I want to know if it's possible to set the thumbnail before try this thumbnails/set and sending a second request.)

 $thumbnail_service = new \Google_Service_YouTube_Thumbnail();
    $thumbnail_details = new \Google_Service_YouTube_ThumbnailDetails();

    $thumbnail_service->setUrl($thumbnail_url);
    $thumbnail_details->setDefault($thumbnail_service);

    $snippet = new \Google_Service_YouTube_VideoSnippet();
    /*
      Other video info added to snippet
    */
    $snippet->setThumbnails($thumbnail_details);

StackOverflow: how-to-add-thumbnail-to-youtube-video-upon-insert

Getting Error

Fatal error: Class 'Google_Service' not found in \Google\Service\YouTube.php on line

I am getting this error.

Java Sample Compilation Errors

Hello,

Anyone able to compile the Java samples? Pulled them down, ran mvn compile and received a host of errors.

-Ron

Customizing an embeded YouTube url in WordPress

I made this tutorial:
http://easywebdesigntutorials.com/customizing-a-video-embed-in-wordpress/

Containing how to align an embeded url added into a post or page in WordPress.
As well as how to change the size of the embeded video.

I feel like the tutorial is missing important information that people who use WordPress could benefit from.
What code would I need to add into the functions.php file to show a HD version of a video?
What about auto starting a video?
Other information that would be good to add?

It would be great to have code added to the functions.php file to gather code into one place.
Thanks!

Can't download report with php

In file api-samples/php/retrieve_reports.php on lines 149-150 an error is triggered by this code:

$request = $youtubeReporting->media->download("");
$request->setUrl($reportUrl);

Method setUrl() is not defined in class GuzzleHttp\Psr7\Request.

What's more important, that Request object doesn't have such field. It has URI (GuzzleHttp\Psr7\Uri Object). So I replaced that lines with following:

$uri = new GuzzleHttp\Psr7\Uri($reportUrl);
$request = new GuzzleHttp\Psr7\Request('get', $uri);

It removes existing error. But the new one is generated:

Fatal error: Call to undefined method GuzzleHttp\Psr7\Response::getResponseBody()

Even changing $request->getResponseBody() to $response->getStream()->getContents() doesn't really help or download a proper report.

Can anyone help me on this?

Thank you in advance.

Error in update snippet (tags) [PHP]

In the PHP video snippet update example that adds tags it states:

      $video = $listResponse[0];
      $videoSnippet = $video['snippet'];
      $tags = $videoSnippet['tags'];
      // Preserve any tags already associated with the video. If the video does
      // not have any tags, create a new list. Replace the values "tag1" and
      // "tag2" with the new tags you want to associate with the video.
      if (is_null($tags)) {
        $tags = array("tag1", "tag2");
      } else {
        array_push($tags, "tag1", "tag2");
      }
      // Set the tags array for the video snippet
      $videoSnippet['tags'] = $tags;
      // Update the video resource by calling the videos.update() method.
      $updateResponse = $youtube->videos->update("snippet", $video);

I can't see how that is ever gonna work, seems like its written by a JS programmer :)
$video isn't changed proposed change:

$video = $listResponse[0];
$tags = $video[''snippet']['tags'];
if (is_null($tags)) {
      $tags = array("tag1", "tag2");
} else {
     array_push($tags, "tag1", "tag2");
}
$video[''snippet']['tags'] = $tags;
$updateResponse = $youtube->videos->update("snippet", $video);

Upload using .net library is not working

Video upload is not working since this morning. I also made console app to see if this example works, and it doesn't? I had web app that worked great until this morning. What happend?

Running java samples got error: 403 : Access Not Configured.

I got the error when I ran Search.java:

There was a service error: 403 : Access Not Configured. Please use Google Developers Console to activate the API for your project.

  1. I have checked that I have enabled Youtube Data API in Cloud console
  2. I use Key for server applications as the API key

What could be the problem?

Failed to start the resumable upload (HTTP 403: global, Insufficient Permission)

The scopes:

array:2 [▼
  0 => "https://www.googleapis.com/auth/youtube"
  1 => "https://www.googleapis.com/auth/youtube.upload"
]

But it does not appear here:

{
 "issued_to": "blubb",
 "audience": "blubb",
 "scope": "https://www.googleapis.com/auth/youtube.readonly",
 "expires_in": 3532,
 "access_type": "online"
}

I have used this:
https://github.com/youtube/api-samples/blob/master/php/update_video.php

Environment is Laravel.

import errors

Hello! I'm trying to open this in Eclipse using "existing Maven project" and it says it can't resolve these imports:
import com.google.api.services.youtube.YouTube.Captions.Download;
import com.google.api.services.youtube.YouTube.Captions.Insert;
import com.google.api.services.youtube.YouTube.Captions.Update;
import com.google.api.services.youtube.model.Caption;
import com.google.api.services.youtube.model.CaptionListResponse;
import com.google.api.services.youtube.model.CaptionSnippet;

Does anyone know what this may be about?
Thanks!

Uploaded Video and 0% uploaded

Hello !,

I have managed to upload a test video of my own to YouTube via YouTube API version 3. But when I checked in my YouTube account I am getting 0% uploaded and I waited for more than 15 minutes though my video is less than 2MB

I was getting the following when I was uploading my video.

Initiation Started
Initiation Completed
Upload Completed!

But it is not calling
"case MEDIA_IN_PROGRESS:"

and I am not getting any exception.

Is it because of this, it is not uploading the video or am I missing anything here?

I am using VideoUpload.java to upload video with my keys configured.

Thanks,
Unni

How to get client secret id

In client_secrets.json file. there is row for client_secret. I searched on internet, but i can not find the way to get it.
Can everybody tell me the way?

golang dependencies are out of date it seems ?

The code and the import statements use the following:

gedw99-MacBook-Pro:api-samples apple$ go get code.google.com/p/goauth2/oauth
warning: code.google.com is shutting down; import path code.google.com/p/goauth2/oauth will stop working
gedw99-MacBook-Pro:api-samples apple$ go get code.google.com/p/google-api-go-client/youtube/v3
warning: code.google.com is shutting down; import path code.google.com/p/google-api-go-client/youtube/v3 will stop working


I am not a golang expert, but it looks like its telling me these git repos are the old ones on the code.google.com

Can you please let me know, because i need to use this You Tube API in a production system.

could not upload large file resumable sample

on uploading large files it throws error:

An client error occurred: Error calling PUT 
https://www.googleapis.com/upload/youtube/v3/videos?

part=status%2Csnippet&uploadType=resumable&upload_id=UPLOAD_ID: (400) Invalid Upload Request

also how to implement progress bar with resumable upload, could you post sample code with progress example with resumable support ?

Mac osX issue with PKIX

ANyone knows why this works flawlessly on WIn machines, but on osX machines...i get the following, after running the 'Search' class off the JAVA APi's??

There was an IO error: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target : sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

YT javascript upload

I noticed that on your old page at code.google.com, you had a sample for creating an upload page using javascript:

https://code.google.com/p/youtube-api-samples/source/browse/yt-upload-javascript/
https://youtube-api-samples.googlecode.com/git/yt-upload-javascript/index.html

On this github page, I couldn't find the corresponding sample though. Has it been dropped?

I was hoping to create a javascript uploader for my web app. The old sample works the majority of the time, but I notice that for videos larger than ~2GB, the upload does not start. In the console, I get the following message:

XMLHttpRequest cannot load https://www.googleapis.com/upload/youtube/v3/videos?uploadType=resumable&part=snippet&upload_id=. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://youtube-api-samples.googlecode.com' is therefore not allowed access.

This does not happen for files smaller than 2GB. This happens on both my page and the sample. I understood that YouTube removed its restriction on files larger than 2GB. I am logged in with my YouTube account on the page. The account has a channel already and is verified to allow long videos.

Any idea what is happening here?
Thanks, Jon.

javascript/auth.js

Hi,

In the file javascript/auth.js

The line:
if (authResult) {
will be always true (authResult is an object, connection failed or not).
So, if we replace this line by this one:
if (authResult && authResult.status.signed_in) {
it's work :)

(enfin.. pour moi ca marche en tout cas)

api-samples / python / upload_video.py - bug in resumable_upload

I first posted here
https://code.google.com/p/youtube-api-samples/issues/detail?id=11
This is the same problem, better report.

The bug is in the sample code, not the API.

The important lines
https://github.com/youtube/api-samples/blob/master/python/upload_video.py#L131-L135

def resumable_upload(insert_request):
while response is None:
status, response = insert_request.next_chunk()
if 'id' in response:

while response is None - response will be None when there are more chunks to upload (fine)

if 'id' in response - this will error when response is None. (bug)

License

Hello,
What’s the license of these code snippets?

Inscreva-se

<script src="https://apis.google.com/js/platform.js"></script>

Compilation failure on UploadVideo.java

api-samples\java\src\main\java\com\google\api\services\samples\youtube\cmdline\data\UploadVideo.java:[126,41] error: cannot find symbol

MediaHttpUploader uploader = thumbnailSet.getMediaHttpUploader();

where thumbnailSet was not declared yet.

In .net in c# how can i get and see the video process progress after video file uploaded completed ?

I mean that if i'm uploading a video file from the youtube.com site it self in the end when the upload is completed i see a message "we are processing....please wait"

I wanted to display this ame thing to the user to show him a progressBar progress or a message" Video is beign process please wait" then " Video process done" something like that.

But i didn't find any event that related to the video process.
I read in youtube api site and saw that on the old api v2 there was a video process event or something to get it but in the google youtube vpi v3 there is nothing about it.

Any way and idea how to get/use the video process part after uploaded completed ?

Play list id

Hi ,

When i tried to pull the play list id from play lists:

playlistItem.getSnippet().getPlaylistId() from the class my upload, i am not receiving the actual play list id

actually play list id starts with PLs..
but i am receiving like, starts with UUp..(it looks like similar to channel id)

Could you please help me out how i can get play list id?

i am actually looking for the vedio id and the corresponding play list id.

Thanks

How can i upload to youtube to my gmail account ?

On my laptop when i surf with chrome to gmail it's getting to gmail.com to my [email protected]
But on my program in csharp in my client_secrets.JSON file the gmail account there is [email protected]

How can i make that in my csharp program it will upload the video file to [email protected] without changing the gmail account i'm surfing to in chrome ?
For some reason when i upload to the youtube it's uploading to the channel according to the gmail in chrome and not the one in the JSON file.

This is my code to upload to youtube:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Google.Apis.Auth.OAuth2;
using Google.Apis.Services;
using Google.Apis.Upload;
using Google.Apis.Util.Store;
using Google.Apis.YouTube.v3;
using Google.Apis.YouTube.v3.Data;
using Google.GData.Client;
using Google.GData.Extensions;
using System.Reflection;
using System.IO;
using System.Threading;
using System.Net;

namespace Youtubeupload
{
public partial class Youtube_Uploader : Form
{
public class ComboboxItem
{
public string Text { get; set; }
public object Value { get; set; }

        public override string ToString()
        {
            return Text;
        }
    }

    YouTubeService service;

    string apiKey = "myapikey";
    string FileNameToUpload = "";
    string[] stringProgressReport = new string[5];
    long totalBytes = 0;
    DateTime dt;
    public static string fileuploadedsuccess = "";
    Upload upload;

    public Youtube_Uploader(string filetoupload)
    {
        InitializeComponent();

        FileNameToUpload = @"C:\Users\tester\Videos\test.mp4";
        service = AuthenticateOauth(apiKey);
        var videoCatagories = service.VideoCategories.List("snippet");
        videoCatagories.RegionCode = "IL";
        var result = videoCatagories.Execute();
        MakeRequest();
        backgroundWorker1.RunWorkerAsync();
    }

    public static string uploadstatus = "";
    Video objects = null;
    private void videosInsertRequest_ResponseReceived(Video obj)
    {
        System.Timers.Timer aTimer;
        aTimer = new System.Timers.Timer();
        aTimer.Elapsed += aTimer_Elapsed;
        aTimer.Interval = 10000;
        aTimer.Enabled = false;
        uploadstatus = obj.Status.UploadStatus;
        if (uploadstatus == "uploaded")
        {
            fileuploadedsuccess = "file uploaded successfully";
        }
        if (uploadstatus == "Completed")
        {
            fileuploadedsuccess = "completed";
        }
        objects = obj;
    }

    void aTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
    {

    }

    double mbSent = 0;
    int percentComplete = 0;
    VideoProcessingDetailsProcessingProgress vp = new VideoProcessingDetailsProcessingProgress();
    private void videosInsertRequest_ProgressChanged(IUploadProgress obj)
    {            
        ulong? ul = vp.TimeLeftMs;
        stringProgressReport[1] = obj.Status.ToString();
        mbSent = ((double)obj.BytesSent) / (1 << 20);
        stringProgressReport[2] = mbSent.ToString();
        percentComplete = (int)Math.Round(((double)obj.BytesSent) / totalBytes * 100);
        stringProgressReport[3] = percentComplete.ToString();

        if (obj.BytesSent != 0)
        {
            var currentTime = DateTime.Now;
            TimeSpan diff = currentTime - dt;
            double diffSeconds = (DateTime.Now - dt).TotalSeconds;
            double averageSpeed = obj.BytesSent / diffSeconds;
            double MBunits = ConvertBytesToMegabytes((long)averageSpeed);
            stringProgressReport[4] = string.Format("{0:f2} MB/s", MBunits);
        }
    }

    public static YouTubeService AuthenticateOauth(string apiKey)
    {
        try
        {
            YouTubeService service = new YouTubeService(new YouTubeService.Initializer()
            {
                ApiKey = apiKey,
                ApplicationName = "YouTube Uploader",
            });
            return service;
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex.InnerException);
            return null;
        }
    }

    private void MakeRequest()
    {
        var searchListRequest = service.Search.List("snippet");
        searchListRequest.Q = "daniel lipman gta"; // Replace with your search term.
        searchListRequest.RegionCode = "IL";
        searchListRequest.MaxResults = 50;
        // Call the search.list method to retrieve results matching the specified query term.
        var searchListResponse = searchListRequest.Execute();

        List<string> videos = new List<string>();
        List<string> channels = new List<string>();
        List<string> playlists = new List<string>();
        // matching videos, channels, and playlists.
        foreach (var searchResult in searchListResponse.Items)
        {
            switch (searchResult.Id.Kind)
            {
                case "youtube#video":
                    videos.Add(String.Format("{0} ({1})", searchResult.Snippet.Title, searchResult.Id.VideoId));
                    break;

                case "youtube#channel":
                    channels.Add(String.Format("{0} ({1})", searchResult.Snippet.Title, searchResult.Id.ChannelId));
                    break;

                case "youtube#playlist":
                    playlists.Add(String.Format("{0} ({1})", searchResult.Snippet.Title, searchResult.Id.PlaylistId));
                    break;
            }
        }
    }

    static Video video = new Video();
    private void UploadVideo(string FileName, string VideoTitle, string VideoDescription)
    {
        try
        {
            UserCredential credential;
            using (FileStream stream = new FileStream(@"D:\C-Sharp\Youtube-Manager\Youtube-Manager\Youtube-Manager\bin\Debug\client_secrets.json", FileMode.Open, FileAccess.Read))
            {
                credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
                    GoogleClientSecrets.Load(stream).Secrets,
                    new[] { YouTubeService.Scope.Youtube, YouTubeService.Scope.YoutubeUpload },
                    "user",
                    CancellationToken.None,
                    new FileDataStore("YouTube.Auth.Store")).Result;
            }
            var youtubeService = new YouTubeService(new BaseClientService.Initializer()
            {
                HttpClientInitializer = credential,
                ApplicationName = Assembly.GetExecutingAssembly().GetName().Name
            });

            video.Snippet = new VideoSnippet();
            video.Snippet.Title = VideoTitle;
            video.Snippet.Description = VideoDescription;
            video.Snippet.Tags = new string[] { "tag1", "tag2" };
            video.Status = new VideoStatus();
            video.Status.PrivacyStatus = "public";
            using (var fileStream = new FileStream(FileName, FileMode.Open))
            {

                const int KB = 0x400;
                var minimumChunkSize = 256 * KB;

                var videosInsertRequest = youtubeService.Videos.Insert(video,
                    "snippet,status", fileStream, "video/*");
                videosInsertRequest.ProgressChanged +=
                    videosInsertRequest_ProgressChanged;
                videosInsertRequest.ResponseReceived +=
                    videosInsertRequest_ResponseReceived;
                // The default chunk size is 10MB, here will use 1MB.
                videosInsertRequest.ChunkSize = minimumChunkSize * 3;
                dt = DateTime.Now;
                videosInsertRequest.Upload();
            }
        }
        catch (Exception errors)
        {
            string errorss = errors.ToString();
        }
    }

    static double ConvertBytesToMegabytes(long bytes)
    {
        return (bytes / 1024f) / 1024f;
    }

    private void Youtube_Uploader_Load(object sender, EventArgs e)
    {

    }

    private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
    {
        UploadVideo(FileNameToUpload, "Gta v ps4", "Testing gta v ps4");
    }

    private void backgroundWorker1_ProgressChanged(object sender, ProgressChangedEventArgs e)
    {
        int eventIndex = 0;
        try
        {
            eventIndex = (int)e.UserState;
        }
        catch
        {
            MessageBox.Show(e.UserState == null ? "null" : e.UserState.GetType().FullName);
            throw;
        }

        if (eventIndex == 0) // upload status.
        {
            label14.Text = stringProgressReport[0];
        }
        else if (eventIndex == 1) // obj.Status
        {
            label16.Text = stringProgressReport[1];
        }
        else if (eventIndex == 2) // mb sent so far
        {
            stringProgressReport[2];
            label5.Text = stringProgressReport[2];
        }
        else if (eventIndex == 3) // percent complete
        {
            progressBar1.Value = Int32.Parse(stringProgressReport[3]);
        }
        else if (eventIndex == 4) // percent complete
        {
            label8.Text = stringProgressReport[4];
        }
        else
        {
            throw new Exception("Invalid event index: " + eventIndex);
        }
    }

    private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
    {

    }

    private void timer1_Tick(object sender, EventArgs e)
    {

    }
}

}

And this is my JSON file content:

{"installed":{"auth_uri":"https://accounts.google.com/o/oauth2/auth","client_secret":"jfffffffflCv","token_uri":"https://accounts.google.com/o/oauth2/token","client_email":"[email protected]","redirect_uris":["urn:ietf:wg:oauth:2.0:oob","oob"],"client_x509_cert_url":"","client_id":"19300890668-ffffffffffffff8tr707m07maf.apps.googleusercontent.com","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs"}}

The problem again instead uploading the video file to [email protected] it's uploading the video file to the account on [email protected]

How can i make it to upload it to [email protected] without disconnect or changing anything in the chrome gmail.com ?

What is the JSON file for if it dosent upload the file to the gmail account in it ?

AddSubscription is throwing NullPointerException

I am getting NullPointerException while trying to add a subscription. Please find below the stack trace.

Throwable: null
java.lang.NullPointerException
    at com.google.api.client.repackaged.com.google.common.base.Preconditions.checkNotNull(Preconditions.java:191)
    at com.google.api.client.util.Preconditions.checkNotNull(Preconditions.java:127)
    at com.google.api.client.json.jackson2.JacksonFactory.createJsonParser(JacksonFactory.java:96)
    at com.google.api.client.json.JsonObjectParser.parseAndClose(JsonObjectParser.java:85)
    at com.google.api.client.json.JsonObjectParser.parseAndClose(JsonObjectParser.java:81)
    at com.google.api.client.auth.oauth2.TokenResponseException.from(TokenResponseException.java:88)
    at com.google.api.client.auth.oauth2.TokenRequest.executeUnparsed(TokenRequest.java:287)
    at com.google.api.client.auth.oauth2.TokenRequest.execute(TokenRequest.java:307)
    at com.google.api.client.auth.oauth2.Credential.executeRefreshToken(Credential.java:570)
    at com.google.api.client.auth.oauth2.Credential.refreshToken(Credential.java:489)
    at com.google.api.client.auth.oauth2.Credential.intercept(Credential.java:217)
    at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:859)
    at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:410)
    at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:343)
    at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:460)
    at com.google.api.services.samples.youtube.cmdline.data.AddSubscription.main(AddSubscription.java:85)

How come there are no Android samples?

I would love to use your implementation of the YouTube Data Api v3 in my project https://github.com/akoscz/YouTubePlaylist because I realy do not want to re-implement all the YouTube Data Api model classes.

I've looked at the YouTube Android Player API and it's completely useless for accessing the YouTube data model.

Correct me if I'm wrong, but it seems like all you would need to do is to implement an Android friendly Auth module to make your Java Samples run on Android, unless I'm overlooking some dependency that does not exist on Android.

Thanks in advance for your response!

new feature: Allow to request caption in url

Please allow youtube videos to start with a specified language caption,

https://www.youtube.com/watch?v=VIDEOID&lang=us-en

lang parameter specifies which caption to use. if no caption matches, captions are disabled (or by user preferences)

This feature is more pronounced for the case of embedding video situation.

The Youtube API v3 sample for uploading a video using Ruby is outdated

The file https://github.com/youtube/api-samples/blob/master/ruby/upload_video.rb is outdated. It doesn't work with the current version and says cannot require 'google/api_client' as there is no file in the current version.

Also, when i use the version 0.8.2, it can require the above file but it doesn't work in other ways and gives an internal server error on the redirect_uri (i am currently testing on my localhost - i have already set the address http://localhost:8080/ in the allowed domains list on developer console). I thought it would have something to do with the Thin gem but the gem is working fine when i tested on another file.
is there any solution to this?
Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.