GET YouTube Video URL - Data API 3.0

Supertecnoboff

I have been looking through the Google docs on how to get a JSON list of videos for a channel. And I figured out how to get the videos list with thumbnails and title and so on..... but nowhere can I find how to get a VIDEO MP4 (or whatever other format) URL's.

You see I need to play the videos in a iOS app and my app needs the actual VIDEO URL not some annoying url which just returns a list of thumbnails or playlists...

I found these instructions online and they work apart from the last part:

You have to get the upload playlist id to get each videos uploaded. To get that, you need to get the channel id. After you have the playlist id from the channel id, it is pretty simple. I have written out the steps for all three below.

Also, we offer PubSubHubBub which allows you to be alerted every time a new video is added to a channel, or you could use SUP (V2) to see which resources have changed before making the calls.

Instructions to get video ids for all uploaded videos for a channel in V3

Get the channel id for the channel you want (you probably only need to do this once, then you can save it)

Use search.list Set type to channel Set q to the name of the channel you want Grab the channel id (something like this: "channelId": "UC0X2VuXXXXXXXXXXXXXXXX") Get the playlist id for the channel uploads using the channel id from step 1 (you probably only need to do this once, then you can save it)

Use channels.list Set id to UC0X2VuXXXXXXXXXXXXXXXX from step 2 Grab the uploads key from contentDetails (something like this: "uploads": "UU0XXXXXXXXXXXXXXXXXXXX") Get the videos via the playlistitems in the playlist using the playlist id from step 2

Use playlistItems.list Set playlistId to UU0XXXXXXXXXXXXXXXXXXXX from step 2 Go through each PlaylistItem and pull out the video id

As you can see the very LAST part says to go through thr playlistitem and pull out the video id. I have done that, but what do I need to do with the video id in order to get the video URL???

Can anyone help me?

Thanks, Dan.

Michael M
      NSString *youtubeHTML = [[NSString alloc] initWithFormat:@"\
                             <html><head>\
                             <style type=\"text/css\">\
                             body {    background-color: transparent;\
                             color: white; \
                             }\
                             </style>\
                             </head><body style=\"margin:0\">\
                             <iframe class=\"youtube-player\" width=\"280\" height=\"210\" src=\"http://www.youtube.com/embed/%@?\" frameborder=\"0\" allowfullscreen=\"true\"></iframe>\
                             </body></html>", videoID];

You can also use the URL to show/hide stuff, hd, start at a certain time.

youTubeView = [[UIWebView alloc] initWithFrame:CGRectMake(yourframe)];
[youTubeView loadHTMLString:youtubeHTML baseURL:nil];

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to get number of video views with YouTube API?

How do I get video durations with YouTube API version 3?

Youtube Data API V3 - No Video url

How to get Youtube video title with v3 URL API in javascript w Ajax & JSON

Given the video ID, how to get it's title using YouTube Data API v.3

How to get number of video views with YouTube API V3?

Get video duration with YouTube Data API?

How to Get Youtube Video URL Programmatically

How can I get a Youtube video ID from the Youtube API given the video url?

How to find if video is syndicated on YouTube data api v3

How to get thumbnail of youtube video from url using php and API

Youtube Data API V3 - Error fetching video with google.youtube.videos.list()

Access Youtube Video URL or ID in MediaWiki API

Get youtube video title without API key

set video as favorite in youtube data api v3

Video meta data using YouTube Data API v3

If I want to get the thumbnail URL for a YouTube video, should I be using the "videos" API or the "thumbnails" API?

How to play video using Youtube Data API v3 and video id in Windows Universal App

how to get youtuber video information in youtube api v3..?

Google Youtube API V3 Just Get Data

Get Youtube Video URL using Youtube V3 API & JavaScript

how to get full description of youtube video using youtube api v3

YouTube API v3 get last video in playlist

Youtube data api v3 Video Upload Error

Youtube API - get video's guideCategory

How to get video url with youtube api(v3)

Youtube v3 Api Get video by ID

Youtube Data API: Get Title and Transcript for each video of a playlist

Youtube Data API - How to get video comments from multiple video id