Duplicate video when upload via youtube api - php

I'm using Youtube API v3 to upload video. At the first time I use, it requires authorization then do upload but there are two videos is created. They are exactly the same but there is no error, the API returns the latest id. I checked in my channel, two videos could be view.
When I try to upload the previous video, another id returns, too, but if I use this, Youtube will show me "This video is a duplicate of another video". Other times, the API works right. Did anyone encounter this problem?

Related

Catching Duplicate Upload Error within YouTube API v3

At this time I'm able to upload Videos to my own YouTube channel on the back-end using API V3 with OAuth 2.0 seamlessly, the need I have is to notify users when they upload the same video twice. As far as I can see YouTube API V3 does not detects this issue until upload has finished. So this means that even if a video is a duplicated one, the upload will always succeed and then the YouTube interface will show the message: "ID Duplicated Video" to the right side of video list on my channel.
How can I read this info (ID Duplicated Video) through the API in PHP so that I can be able to notify user about this duplicated upload?
There is no interface to check if a user is uploading a duplicate video before uploading the entire file. Presumably, YouTube performs some kind of hash on the file after the upload has completed in order to check if it is a duplicate upload. Because the video file needs to be uploaded in its entirety for this check to happen, there is no way to check for a duplicate upload (currently) before an upload has completed.

youtube api playlistitems deleted videos

I noticed some inconsistencies between the data retrieved via the Youtube API v3 and what Youtube shows accessing directly the website.
Sometimes, the data returned via the playlistitem list contains a lower number of items (videos) than the playlist shown in the website.
This happens when the playlist contains deleted videos. In fact, at times, a video marked as deleted on youtube's playlist, it is still reported in the returned data of a playlistitems call, other times it is not, leading to a playlist having 2 different sizes (i.e. 20 videos on the website and only 18 returned via the api).
This is puzzling for my users when they compare the playlists on youtube and in my application, as they see 2 different results...
Anyone knows how to handle playlists with deleted videos? Or how to retrieve the same data as it is shown in the website?
I'm using php and youtube v3 apis and youtube's php libraries if it is relevant.
I think it is a bug in the YouTube API version 3.
You should check if it is already reported as a bug and if not you can file it yourself here:
https://code.google.com/p/gdata-issues/issues/list?q=label:API-YouTube
if you decide to file it as a bug you should mention a playlistID that shows the problem.
I have noticed it too. However, it does not bother me.
In my case:
Using API version 3. The response is missing one or more items.
Missing playlist items always appear as DELETED on youtube.com
It happens on some playlists but not all.
The playlist is PUBLIC and contains only videos from other channels.

YouTube data download with cclive & gcap

In a PHP system, my client suggested to download videos AND MAINLY captions from YouTube using the following tools:
cclive
gcap
As I have never heard of these before, my question is does anyone have any experience with them? Both projects seem to be inactive for like one year or so... Do they still work?
Is it possible to download captions for any YT video with them? I have stumbled upon some YT API info that the captions are not available for unauthorized users (i.e. you can only get your own captions if you are authorized with the API)?
Caption tracks can only be accessed via the Data API by the authorized owner of a given video.
The official YouTube Players can access caption data, but they use a different mechanism for accessing that data which is not part of a public API.

Uploading Videos in Graph API

I'm putting together an application in facebook, part of which requires a user to input a bunch of information into a form, including a video and a number of text fields.
For my application, I'm using a combination of HTML, PHP, mySQL and Javascript.
I want to be able to upload the users video file to facebook using the PHP SDK in the same page as I am inserting their info into my database. I want something similiar to the photo solution here: Exception when uploading photo with Facebook Graph API. But I'm not sure what the array key should be for the video itself.
Can any give me any ideas?
My apologies,
I realized that the solution I linked to works. However, you have to give facebook time to process the video, otherwise the graph api replies false.

Is it possible to Implement youtube channels uploaded videos list into website?

What I want to do is, to show uploaded videos list of my youtube channel to website's visitors.
Something like that. (Image take from youtube channel, I want to show exactly this way)
Don't want to create iframe. Can I fetch data from channels exact page with PHP or something else? I have no idea if it's possible with youtube api. Any suggestions?
Yes you can. The videos on a channel are essentially a user's so using the YouTube GData API you can make a call to http://gdata.youtube.com/feeds/api/videos?author=ahmednuaman (my videos for example).

Categories