3

i have made an application in which i am fetching YouTube videos using this url:

http://gdata.youtube.com/feeds/api/users/GoogleDevelopers/uploads?v=2&alt=jsonc

in a same way i want to fetch YouTube videos using this url:

http://www.youtube.com/playlist?list=PL34F010EEF9D45FB8

Problem: I don't know how can i get YouTube JSON GData URL for this link...

http://www.youtube.com/playlist?list=PL34F010EEF9D45FB8

ρяσѕρєя K
  • 132,198
  • 53
  • 198
  • 213
Udhikriman
  • 162
  • 1
  • 11

3 Answers3

4

if you want to get playlists from gdata.youtube.com then use this API as:

http://gdata.youtube.com/feeds/api/playlists/PASS_PLAYLIST_ID_HERE?v=2&alt=json

then change your url as:

http://gdata.youtube.com/feeds/api/playlists/PL34F010EEF9D45FB8?v=2&alt=json

ρяσѕρєя K
  • 132,198
  • 53
  • 198
  • 213
0

Dont use gdata for youtube. Use OhEmbed feature of youtube. for your link the youtube ohembed link is

http://www.youtube.com/oembed?url=http://www.youtube.com/playlist?list=PL34F010EEF9D45FB8

san
  • 1,845
  • 13
  • 23
  • friend but i have written my complete code for JSON, so can i use this link? because i am using link like this: http://gdata.youtube.com/feeds/api/users/GoogleDevelopers/uploads?v=2&alt=jsonc – Udhikriman Dec 19 '12 at 09:56
  • @Udhikriman: just open youtube console and check all API's means how we query play-list ,how we get latest video list etc... – ρяσѕρєя K Dec 19 '12 at 10:05
  • @ρяσѕρєя K ok bhaiya i will read that, and thanks for guidance – Udhikriman Dec 19 '12 at 10:06
  • I upvoted ρяσѕρєя K's answer. @Udhikriman. You should accept ρяσѕρєя K's answer. His answer makes sense to me. – san Dec 19 '12 at 10:07
  • @san i very well know him, he is one of the genius developer who helped me a lot, i always follow his guidance....please... – Udhikriman Dec 19 '12 at 10:10
0

if you want to retrive playlist data from YT Playlist then use

    var feedUrl = "http://gdata.youtube.com/feeds/api/playlists/"+nPlaylistID+"?max-results=8";
    if (result.error || !result.url) 
    {
$('#divid').hide();
return;
}

  var feed = new google.feeds.Feed(result.url);
  feed.setNumEntries(50);
  feed.load(function (result) {

   for (var i = 0; i < result.feed.entries.length; i++) {
var entry = result.feed.entries[i];
var vidhash = /=(.*)&(.*)$/.exec (entry.link)[1];

  container.append('<div><a href="http://www.youtube.com/embed/'+vidhash+'" class="html5lightbox" title="'+entry.title+'"><img src="http://img.youtube.com/vi/'+vidhash+'/0.jpg" /><br />'+entry.title+'</a></div>\n');
Rushikesh jogle
  • 591
  • 2
  • 9
  • 29