Is it possible to find the context of a video in respect to any playlist that it is included in? I would like to be able to check if the videoEntry is included in a playlist and, if so, figure out the next video in the playlist.
Flickr has a lot of great photo context methods, I hope YouTube does too, I just can't find anything on it.
Well, obviously you want to know the VideoId of the video in question first, right? So say it's "4eUibFQKJqI" and it's in a playlist whose Id is "6C0464B5CC81A607" (You can easily get those Ids from your 'My Account' section in YouTube).
If I get the feed for that playlist, then the resulting xml file gives you all the information you need to check if that Video is present, and the order that you have set in 'My Account' is preserved.
So, you have two ways of analysing the results that YouTube sends you. One is to make a request to that playlist address and parsing the results using Linq-to-Sql, if you use Asp.Net, for example. Whatever language you use, it will have Xml-parsing capabilities, so it's just a case of iterating through the entries in the feed.
If you use a library for your language, it may well have a specific method to determine whether a given video is in a given playlist, but if it doesn't, it's pretty easy to query the raw xml file and get that information, as described above.
Hope that helps - it's hard to tell from your question what level you're at with this stuff... Anyway, it's all at the Developers' Guide.
http://gdata.youtube.com/feeds/api/playlists/PLAYLIST_ID?v=2
from http://code.google.com/apis/youtube/2.0/reference.html
Related
I have an idea for an app that would take a YouTube link and determine the music within the video. I noticed that below some videos with music, you can see the track title and artist in the description.
Can I access that info in any way with the API?
To see the track, this SO thread can best answer that.
The best you can do is to add a videoCategoryId parameter in your
query to the YouTube Data API. This ensures that only videos belonging
to this category are returned.
And for the artist, I think there is no other way as this SO post suggested.
No, it's not possible to get the artist list via youtube data api.
Because the acceptable "type" values for search.list() does not have
artist resource:
From the documentation:
Acceptable values are: channel, playlist, video
As written in previous answer, there is no data identifying artist and song title for the video.
You could get video description and parse it.
This is scraping and no guarantees that you will have structure there, however, usually uploaders have some standard way of posting description, e.g., from this response's description you could get Slam Van by Stefan Kartenberg (c).
what is the approach to store multiple videos from an author in his named folder, but then there are 1-n videos from this author?
YouTube has for every video a complete different URL with an ID. Casual/Older users don't know where they are.
News sites seem use /topic/title-id123
Cnn uses /yyyy/mm/dd/title
To keep this question answerable: What URL structure would you recommend for me?
- every person has some videos without interesting title we could use
- the date from start day to end day is more likely important (2005-12-12 to 2005-12-17)
- every video should be social media shareable, so I think they all need a single URL and can't just be all embedded in /videos/name
Store them however is the best for the backend editor workflow (you didn't mention, how and when new videos are added), in 6.2 you have file abstraction layer, so each file in fileadmin has assigned ID. If you want to make your videos nicely social media sharable, you need to provide additional metadata such as video name and thumbnail etc, so I would suggest building a plugin for this which would take the video ID from the URL and display it with all the additional data necessary.
If you are using EXT:realurl (which I hope you are), you can configure to the video title in the URL, which would look like: /somepage/video/video-title/ or even /somepage/video-title/ . Adding /yyyy/mm/dd/ in the URL only makes sense if you are producing multiple videos every day, otherwise it feels pointless.
for building unique URLs with realurl for news you find solutions to include the uid of the news.
As TYPO3 handles all files with FAl you might use the unique file_sys:uid in your video URL. You might use realurl to generate and resolve URLs like:
/videos/123/title_of_video/
Here's the same video, under two different channels:
https://www.youtube.com/watch?v=gYh9DCN8ads
https://www.youtube.com/watch?v=5_v7QrIW0zY
The second one is the original I believe. But if you query the api using the id 'gYh9DCN8ads', it seems like there's no information that points you to the original content creator, is there? All you can get is the channel, which is FlorianPurcarus, not Isaac Lamb.
Unfortunately, it is not possible to get the original video ID since YouTube does not make this information available to the public.
However, if you are the owner of the content and you are a Content ID partner, you are able to list active claims on one of your assets. For more information about that, please reach out to your Partner Technology Manager for more information.
Hi guys, this is my first time to post on this awesome community so
please bear with me.
I am working with a Wordpress Plugin that can display a Youtube Search Results into Video Playlist.
My settings are:
Keywords
Author
Content- channel/keyword
My first Approach was this:
with this api as reference,
search for the keyword > display the relevant results according to the author as playlist
*I'm in doubt if I this is possible, coding 30%
*I'm not sure where could I use my settings for Content
but then when my coding is in progress I recently bumped an article that says Youtube Search is differrent on Searching a Youtube Playlist
Now I can't continue my coding because I'm not sure If I'm doing it
right. Can you give me some advise with this situation or show me some
similar project/examples?
You don't have to write any YouTube Data API code for this; it's a built-in feature of the YouTube Player.
This blog post has an example of loading a list player that takes its content from the recent uploads of a channel. You can do something similar by setting listType=search&list=SEARCH_TERM, where SEARCH_TERM is whatever string you want to search for (be sure to URL escape it). You can read more in the documentation.
So I'm working on switching to using the v3 version of the YouTube api (which is so much better it's like a completely different product), but I'm either missing something or it is ...
Being able to fetch an arbitrary list of videos, and their details, in one call is going to make life significantly better, but in the videos list method, the the video details "snippet" contains the "channelId", not the "author".
I've spent quite a bit of time looking through the documentation, but can't find any way of getting from a channelId to the human readable author name.
How am I expected to map a video to an author?
It's not possible to get back a display name (either legacy YouTube name or Google+ name) for a channel as part of the video.snippet response. You need to take the channelId and perform a channels.list(id=channelId1,channelId2,...,part=snippet) operation to get that information. The good part is that you can pass in up to 50 channel ids in a single call.
This sort of separation of information into different resources with ids effectively serving as keys linking the resources was a deliberate decision. The engineering team is aware that it will require developers to make an additional API call, but they're in favor of that design.
At the same time, the API is still in an experimental release, and if you have any feedback about using the API while doing real-world development, feel free to open a feature request in the issue tracker. If enough people give feedback about a certain aspect of the API, that could factor in to the final revision's design.
The accepted answer may have been correct at the time of writing, but as of 2/2018 the snippet part now includes a channelTitle property.