I'm seeing issues where adding multiple entries to a playlist in a short amount of time seems to fail regularly without any error responses.
I'm using the json-c format with version 2.1 of the api. If I send POST requests to add 7 videos entries to a playlist then I see results of between 3-5 of them actually being added to the playlist.
I am getting back a 201 created response from the api for all requests.
Here's what a request looks like:
{"data":{"position":0,"video":{"duration":0,"id":"5gYXlTe0JTk","itemsPerPage":0,"rating":0,"startIndex":0,"totalItems":0}}}
and here's the response:
{"apiVersion":"2.1","data":{"id":"PLL_faWZNDjUU42ieNrViacdvqvG714P4QjvSDgGRg1kc","position":4,"author":"Lance Andersen","video":{"id":"5gYXlTe0JTk","uploaded":"2012-08-16T19:27:19.000Z","updated":"2012-09-28T20:20:39.000Z","uploader":"usanahealthsciences","category":"Education","title":"What other products does USANA offer?","description":"Discover USANA's other high-quality products: the Sens skin and hair care line, USANA Foods, the RESET weight-management program, and Rev3 Energy.","thumbnail":{"sqDefault":"http://i.ytimg.com/vi/5gYXlTe0JTk/default.jpg","hqDefault":"http://i.ytimg.com/vi/5gYXlTe0JTk/hqdefault.jpg"},"player":{"default":"http://www.youtube.com/watch?v=5gYXlTe0JTk&feature=youtube_gdata_player","mobile":"http://m.youtube.com/details?v=5gYXlTe0JTk"},"content":{"5":"http://www.youtube.com/v/5gYXlTe0JTk?version=3&f=playlists&d=Af8Xujyi4mT-Oo3oyndWLP8O88HsQjpE1a8d1GxQnGDm&app=youtube_gdata","1":"rtsp://v6.cache3.c.youtube.com/CkgLENy73wIaPwk5JbQ3lRcG5hMYDSANFEgGUglwbGF5bGlzdHNyIQH_F7o8ouJk_jqN6Mp3Viz_DvPB7EI6RNWvHdRsUJxg5gw=/0/0/0/video.3gp","6":"rtsp://v7.cache7.c.youtube.com/CkgLENy73wIaPwk5JbQ3lRcG5hMYESARFEgGUglwbGF5bGlzdHNyIQH_F7o8ouJk_jqN6Mp3Viz_DvPB7EI6RNWvHdRsUJxg5gw=/0/0/0/video.3gp"},"duration":72,"aspectRatio":"widescreen","rating":5.0,"likeCount":"6","ratingCount":6,"viewCount":1983,"favoriteCount":0,"commentCount":0,"accessControl":{"comment":"allowed","commentVote":"allowed","videoRespond":"moderated","rate":"allowed","embed":"allowed","list":"allowed","autoPlay":"allowed","syndicate":"allowed"}},"canEdit":true}}
The problem doesn't change if I set the position attribute.
If I send them sequentially with a 5 second delay between them then the results are more reliable with 6 of the 7 usually making it on the playlist.
It seems like there is a race condition happening on the api server side.
I'm not sure how to handle this problem since I am seeing zero errors in the api call responses.
I have considered doing batch processing, but can't find any documentation on it for the json-c format. I'm not sure it that would make a difference anyways.
Is there a solution to reliably adding playlist entries to a playlist?
This was fixed in and update to the youtube data apis around the 25th of October.
Related
I have a very simple message and getting the v3 youtube data api to get the list of comments. I am just fetching the list of videos and then fetching the comments (at frequency of 5 sec) to get updated messages. using the page token as needed to minimize the load and computaion.
Today after some time while internally testing the application i started getting the quota exceeded exception. I know the youtube provided by default 10000 units and since reading the comments (and videos as well) is just 1 unit, i should expect to get similar numbers.
However, the data is wrongly calculated.
Following are request details
If you see, there are 2895 total requests LiveChatMessages-> List.
However, when i go to IAM-> Quotas, it showed 14k earlier, then 12.6k in quota usage
There seems to be some problem either with the computation or with the Documentation that defines the units for queries. Can someone help please..
PS: Just using the two apis as mentioned above in screenshot. Both are list.
If you see, there are 2895 total requests LiveChatMessages-> List. However, when i go to IAM-> Quotas, it showed 14k earlier, then 12.6k in quota usage
Yes i can see that there are 2895 requests, but how do you know what the qutoa costs are for those requests. You are using the YouTube Live Streaming api for those requests. Not the YouTube-Data-api
There is no documentation of the quota cost for the YouTube Live Streaming api calls. If Google says you used all your quota then you probably have.
I would post an issue over on the issue forum asking them to document the quota cost for the calls Issue forum
I have a YouTube API Key, and I was testing it out when I started watching my [requests] through the dashboard?project=myproject-111111&duration=PT1H
The issue is this. I stopped using the key about 15 minutes ago, and that blasted thing is STILL counting. Since I stopped using it, it has gone from
9,875 -to- 39,978 (And still counting)
Why would this be still counting for? The key is NOT being used, but its counting.
You are allowed 1 million requests per 24 hour day. And at this rate, I will be there in no time flat.
I have tried to find an active Forum for the YouTube API, and there is none. The only ones I found had their last post in 2012 and 2014.
Any idea's why this thing is still counting? (46,333)
Updated 10:47 pm EST: On the [Quotas] page. It is over 300,000+ and counting. This is a blasted joke. I reported it in as a bug, but the bug reporting page, is so full of SPAM, that it makes you wonder on rather they are going to check it regularly or not.
Updated 10:51 pm EST: It finally stopped. Conflicting count returns are coming in from the different pages.
118,762 on the dashboard
415,489 on the YouTube Quotas page.
I went to the YouTube Developers Twitter page and tweeted to them about the issue, and am awaiting a reply back.
I will post here, once I get a reply back.
Is this a BUG?
Or, do other issue?
CodingEE
This is something that I was looking at. As quota is eaten up by api calls that the site is not actually making.
This is unfortunately something for Google to fix. I did send a request to look into it, but no reply.
The cause is "BOTS". They will search, index and run the page affectively to index and rate it. As such, the will incur api usage.
This can be reduced in a few ways.
1: If in testing stage, and you do not use the online version too often apart from testing updates to code, then you can remove the api key from the code while not testing.
2: If it is live and running, but you wish to stop the bots eating the quota, then in your Google dashboard, block the bots.
This will however stop indexing. So I would recommend "trying" to limit them and how often they inex.
Aside from that, we need to get Google to (if possible) not use quota for bots.
I am just curious about why does Youtube shows 301+ views. I think there must be some logic behind that. What it could be?
I have seen exact count of views lesser than 300 views as well as having count in several thousands and millions.
It can stay stuck for a while. This is a control procedure for preventing the use of bots, any video getting more than 301 views in a short period gets verified in terms of source of traffic. However views are still getting counted (logged) in the back-end and will appear when YouTube will unlock the view counts.
Answering myself, it is no longer the case and it's been resolved.
So whenever a new video used to upload it receives many likes including from bots. So to verify the legitimacy of likes YouTube counter used to stop after 300 likes to verify sources of likes.
Official release: https://mobile.twitter.com/YTCreators/status/628958720953819136
The videos returned by Youtube API do not contain the search keywords. In fact, the videos do not have any description when you open the URL.
For example this was video was retrieved using the keyword parachuteadvansed:
http://www.youtube.com/watch?hl=en-GB&v=Gqe4td6xpjQ
Description of the video:
-026. Watch Later Anushka sharma childhood imagesby iram nadeemFeatured 117 ·
-213. Watch Later Anushka Sharma Shine
Stories 3 Film Dealby parachuteadvansed 472 views ·
-136. Watch Later
Anushka Sharma Shine Stories Prasad Bidappa Fashion Showby
parachuteadvansed 956 views ·
-135. Watch Later Deep Conditioning in 20 Minutes Parachute Advansed Deep Conditioning Hot Oilby parachuteadvansed 9236 views ·
-129. Watch Later Anushka Sharma Shine Stories School Daysby ..."
This description are actually the titles of the additional videos that are displayed on the right hand side of the page.
I used this query:
http://gdata.youtube.com/feeds/api/videos?max-results=50&q=parachuteadvansed&orderby=published&v=2
I have received 2000+ videos like this over the past week while fetching for numerous keywords. I am using YouTube’s Java API and I did not face this problem until last week. This does not occur for every fetch, but over the day I receive an average of 300 URLs with such description.
The problem is that when you fetch for the keywords again, the video is not returned. So, this issue cannot be replicated. Also, if you fetch the video separately, the video does not contain a description.
If this continues, then there will be a lot of irrelevant data coming from YouTube.
I would like to know if anyone is facing the same issue or if someone know what is going wrong in my query.
Update: The underlying issue has been identified, and the incorrect descriptions should no longer be returned once the fix is deployed and the search index is refreshed.
There's nothing different that you could be doing to work around this; the description in the search feed is being incorrectly populated due to a bug in the YouTube search index.
I'll report it internally.
(In the future, please follow the advice in this blog post and use the YouTube API issue tracker to report buggy behavior.)
First of all let me say that I am not asking "how to check a status of a previously uploaded video". My question is about getting the status of a video from the response of an upload. I am using the dotnet client and right after an upload is completed the response is a Google.Apis.Youtube.v3.Data.Video object. That object has a property called Status that contains the folllowing fields among others: RejectionReason, PrivacyStatus and UploadStatus. The problem is that only the PrivacyStatus and UploadStatus have values. The RejectionReason is null. Jeff Posnick mentioned that (see whole thread here)
There's no way to determine whether a video is a duplicate or not as part of the upload response, because YouTube doesn't know whether the video is a duplicate until it has processed the video, and processing takes place after the upload has completed
That's a bit strange because when I issue a video.list right after the upload the API returns a status for the uploaded video. So even if the video is not published and it seems like YouTube is still indexing/processing the video it already knows the status of the "just uploaded video". So why can it not return the status as part of the response?
It's important that the response include the status because if not then, in the code, we have to do two API calls each time we do an upload: (1) insertmediaupload then (2) video.list. It'd a very costly operation especially that not all uploads will be duplicate.
EDIT
As a response to Jeff-Posnick's comment below the question is "can the API wait for a few seconds and check if the processing is done and then include the status as part of the response?".
I came up with that question because of the behavior I've seen: That's a bit strange because when I issue a video.list right after the upload the API returns a status for the uploaded video. But I've been playing around with the API and got inconsistent results. I have uploaded the same video over and over and sometimes there is "a duplicate" status and sometimes there is none. Please take note of the steps I took, #1 and #2 above. There are no other codes in between of those two API calls.
I'm not sure what the question is here.
You seem to understand the limitations of the way uploads work with the YouTube API, and those limitations still apply with v3 of the YouTube Data API. At the time that a response is returned from the videos.insert() request, the status of the video is not known, because it hasn't been processed yet. The actual processing might happen a second or two after the video has been uploaded, or it might happen a few minutes (or longer) after the video has been uploaded, especially for larger video files. It's not done in real time, and it's not reasonable to expect the videos.insert() API call to block waiting for the processing to be finished.
I'd disagree with your assessment that performing a videos.list(id=...,part=status) is a "very costly operation". The amount of bandwidth and YouTube API quota that consumes is minimal compared to an actual video upload. It would be nice to provide a way to communicate back the processing status independent of the videos.insert() call via some sort of callback or push update mechanism, but we don't have anything available like that at this time. You have to poll videos.list(id=...,part=status).