youtube-data-api

Get video duration with YouTube Data API?

这一生的挚爱 提交于 2019-12-05 01:42:44
Basically, I'm trying to get the video duration of each video that shows up in the results when they search. I have a neat little demo set up for you to mess with! ALSO - When I say duration I mean the length of the video in M/S format (0:00).. DEMO http://codepen.io/mistkaes/pen/6b6a347c7d24edee15b3491420db4ecd jQuery: var apikey = '<API KEY>'; $(function() { var searchField = $('#search-input'); $('#search-form').submit(function(e) { e.preventDefault(); }); }); function search() { $('#results').html(''); q = $('#search-input').val(); $.get( "https://www.googleapis.com/youtube/v3/search", {

Disable autoplay in youtube javascript api

守給你的承諾、 提交于 2019-12-04 23:45:13
I know about using autoplay : 0 in params and in url. The problem is when I use the loadVideoByID() function. THe initial video seems to always not autostart. but the moment I load in new video that new one autostarts. I dont want that new one to autostart either $(document).ready(function() { var player; window.onYouTubePlayerAPIReady = function() { player = new YT.Player('player', { height : '390', width : '640', videoId : 'JW5meKfy3fY', playerVars : { 'autoplay' : 0, 'rel' : 0, 'showinfo' : 0, 'egm' : 0, 'showsearch' : 0, 'controls' : 0, 'modestbranding' : 1, }, events : { 'onReady' :

Youtube Data API V3 - No Video url

会有一股神秘感。 提交于 2019-12-04 23:34:20
I am using youtube data api version 3, to get the top youtube videos, i am calling the REST api like this: https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.search.list?part=snippet&forMine=true&maxResults=10&order=viewCount&type=video&_h=6& and get the data like this is json format: "kind": "youtube#searchResult", "etag": "adasdasdasdasdas", "id": { "kind": "youtube#video", "videoId": "123123asdsad12" }, "snippet": { "publishedAt": "date", "channelId": "Gasdqqweqweqwr123123", "title": "my tutle", "description": "xyz", "thumbnails": { "default": { "url": "......jpg", "width":

PHP: YouTube v3 API Captions Upload with Sync Flag

℡╲_俬逩灬. 提交于 2019-12-04 23:13:43
For the past couple weeks my co workers and me have been working on trying to get captions on our clients YouTube video's through the v3 API. After about week we were finally able to get the captions to upload just fine but, YouTube would give us this message in the UI "Track content is not processed" and doesn't display the caption's that we upload. However, we can download the original format that was upload; so we know the file was uploaded successfully. We also were able to get the sync flag to work that tells YouTube to run through the transcript and set timings for the video but, it

How do I use LiveBroadcasts:list from YouTube API?

蹲街弑〆低调 提交于 2019-12-04 21:51:36
I'm trying to use YouTube API for Live Broadcasts. But, I don't get any results. Here's what I do: Go to #Live YouTube channel: www youtube com channel / UC4R8DWoMoI7CAwX8_LjQHig Open any Live Broadcast to get Broadcast ID (for example, "CGt1Ac1gEZc"). Try to use this Broadcast ID in irb: irb(main):038:0> list = youtube.list_live_broadcasts("id,snippet,contentDetails,status", id: "CGt1Ac1gEZc") => #<Google::Apis::YoutubeV3::ListLiveBroadcastsResponse:0x0000000546a960 @etag="\"oqbvhYxBE6fAbRk6m7aLlHf5s1I/P7sEkFelJCqPWY-5t7EUKYER_MQ\"", @items=[], @kind="youtube#liveBroadcastListResponse", @page

How to get top 10 videos from your channel with the views count included in the response

自闭症网瘾萝莉.ら 提交于 2019-12-04 21:38:37
So I have a ouath web app that connects to youtube. I use the youtube analytics calls to get information like number of subscribers from my channel. But right now I try to make a top 10 videos from my channel with the views count for every video included in the response. I use this documentation: Top videos for subscribed or unsubscribed viewers My call looks like this: $command = 'curl -H "Authorization: Bearer ' . $access_token . '" "https://www.googleapis.com/youtube/analytics/v1/reports?ids=channel%3D%3DMINE&start-date=' . date('Y-m-d', strtotime('-31 days')) . '&end-date=' . date('Y-m-d',

How to upload Video to YouTube using Google API PHP Client Library and Youtube API V3?

ε祈祈猫儿з 提交于 2019-12-04 19:52:53
问题 Trying to simply upload video using Google API PHP Client (latest release 1.1.6), but code in Youtube API V3 is not working and giving 500 internal server error. What is wrong with code below when I am not using any bleeding edge beta version, I have just masked 3 parameters below otherwise it is copied form Youtube API V3. require_once 'google-api-php-client/src/Google/Client.php'; require_once 'google-api-php-client/src/Google/Service/YouTube.php'; session_start(); $OAUTH2_CLIENT_ID =

Our application uploads hundreds of videos per day using the YouTube API, but now getting quota exceeded errors

戏子无情 提交于 2019-12-04 19:31:07
My application allows users to "link" their YouTube accounts to our system and then we allow them to upload videos to their channels both automatically in some cases, and on an "upload" action on their part. We have hundreds of videos being uploaded because we have thousands of users that use our system. Today I saw hundreds of errors in my application when our batch automatic upload job was running. The errors were for: quotaExceeded, video upload limit reached. My API quotas are very high (50,000,000 per day, 3,000,000 per 100 seconds, 300,000 per 100 seconds per user), so if a video is 1600

Get video id from youtube url using Android Youtube ApI v3

て烟熏妆下的殇ゞ 提交于 2019-12-04 18:33:30
I'm using Android Youtube API v3. My application plays youtube video. I want to get videoID from youtube url. I see there are a lot of sample that uses pattern to parse the url to get the video ID. But I'm afraid of this way will fail when youtube change their url in the future. There are some formats of youtube video url: http://www.youtube.com/watch?v=0zM4nApSvMg&feature=feedrec_grec_index http://www.youtube.com/user/SomeUser#p/a/u/1/QDK8U-VIH_o http://www.youtube.com/v/0zM4nApSvMg?fs=1&hl=en_US&rel=0 http://www.youtube.com/watch?v=0zM4nApSvMg#t=0m10s http://www.youtube.com/embed/0zM4nApSvMg

How can I set videos to “private yet shared” using the v3 YouTube API?

萝らか妹 提交于 2019-12-04 18:22:01
问题 I work for a school that has an institutional YouTube account (Google Apps for Education). The video privacy options are Public , Unlisted , and Private . The important bit: Private videos can be shared with either: - the institution (i.e., all students with a school account), or - a list of specific email addresses. We have a tool that uses the v3 YouTube API (Java) to automatically upload videos to YouTube. I can use the API to set privacy: VideoStatus videoStatus = new VideoStatus();