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.
Related
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?
Iam building a social network website.
I want to crawl information of ALL images by a hashtag on Instagram by using Instagram API. ( I only store url link to instagram image, without store image on my server )
Is is possible ? Or Instagram API only response a limit number of recent images ?
Thanks all!
When looking at the API docs, it seems that the total amount of media on a certain hashtag can be looked up, but the actual media can only be found for recent posts.
So if you actually want to save all media, you might want to scrape all data every now and then. You do have a limit on how many times you can scrape though.
Using API you can get all hashtag media, it will start with most recent posts, you have to paginate and can get call data.
https://api.instagram.com/v1/tags/{tag-name}/media/recent?access_token=ACCESS-TOKEN
As of Oct 1, 2017, Instagram no longer gives permission for public_content scope that is required to access this data, if dont already have your app approved, you will not be able to use this API :(
I have been using the YouTube search, channel, playlist api to collect video info.
But recently, some problem has occurred.
For example, I want to collect all videos and playlists in 'MassageASMR' channel.
https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=UCgOfiuubHnhVrc9IEcSk1Nw&maxResults=50&key={YOUR_API_KEY}
but some videos info was not returned.
https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=UCgOfiuubHnhVrc9IEcSk1Nw&q=ASMR+Crinkle+Heaven+5&key={YOUR_API_KEY}
This video(title is 'ASMR Crinkle Heaven 5') is definitely belong in this channel.
And this video info can be viewed using '/search' api with 'q' param.
But when searching all videos using '/search' api without 'q' param, I can't find this video info with in all pages.
I guess, many videos can not be retrieved.
I received a feedback message that some videos in my app are not visible.
Is there a problem with the API or do I change the param value?
YouTube has a soft limit of 500 video results returned for a search query. Since your channel has ~600 videos, 'ASMR Crinkle Heaven 5' must be one of the 100 that was left out.
Using the q parameter for 'ASMR Crinkle Heaven 5' returns 352 results, that's why you see it in that request.
To get all videos, I would suggest using multiple search queries using a filter like publishedAfter by month/year so that each result returned is less than 500. That way you can be sure of getting them all.
I've been playing around with the google/google-api-php-client. I've noticed that it says "build-failing", but some parts are working as expected, so I've been pressing on with it.
So I have built a search field that queries the YouTube API for videos containing a search string and prints the results. You'll see that I've also hooked up the YouTube Player iFrame API to play the video if it is clicked.
Now these results do contain snippet data (title, description, channelId, etc...), but the item description's are limited to 160 characters and appended with an ellipsis ….
So now in an attempt to get a full description, I am sending another call to the YouTube API. I am calling $youtube->videos->listVideos('snippet',array('id' => '7dR02ebri9c')). The call is successful, but does not contain any snippet data.
I've logged the response to the console so you can see it here:
And printed it here incase the above image does not show.
{"etag":"\"43qFkeEQBKio26KDSq1ZQMzjhSo/3nlK0uyD_p1CFvvGkbiQcGORv5w\"","eventId":null,"kind":"youtube#videoListResponse","nextPageToken":null,"prevPageToken":null,"visitorId":null}
If I run the same request via the YouTube API Explorer, I receive a response complete with snippet data and a full description.
So I ask, is the problem the google/google-api-php-client I am using, the YouTube API itself, or perhaps something else?
Edit: I've found and thought about using madcoda/php-youtube-api instead, and will do-so if all else fails.
I've discovered that google/google-api-php-client was the problem here.
I've had success using madcoda/php-youtube-api instead.
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.