Same results for Youtube API GetMostRecentVideoFeed() and GetMostViewedVideoFeed() methods

StackOverflow https://stackoverflow.com/questions/20287618

  •  06-08-2022
  •  | 
  •  

Question

I am trying to save information about video feeds in Youtube Data API. (eg. video title for each entry in the feed and save it to a file).

def SaveFeed(feed,filename):
   with open(filename,"w") as f:
      counter = 0;
      for e in feed.entry:
          counter += 1;
          f.write("\n\n===================================\n")
          f.write("Counter: "+ str(counter) + '\n');
          file.write('Video title: %s\n' % e.media.title.text)        

yt_service = gdata.youtube.service.YouTubeService()
yt_service.ssl = True
feed = yt_service.GetMostRecentVideoFeed();
feed2 = yt_service.GetMostViewedVideoFeed();
feed3 = yt_service.GetMostRespondedVideoFeed();
feed4 = yt_service.GetMostDiscussedVideoFeed();
SaveFeed(feed,"mostrecent.txt");
SaveFeed(feed2,"mostviewed.txt");
SaveFeed(feed3,"mostresponded.txt");
SaveFeed(feed4,"mostdiscussed.txt");

However, what I get is the same list of videos in each feed (most recent, most viewed, most responded). Starting with "Video title: Charlie bit my finger - again !".

Was it helpful?

Solution

Problem was not solved, but it was eventually explained.

The methods I used had been deprecated. [https://developers.google.com/youtube/2.0/developers_guide_protocol_video_feeds#Standard_feeds] is explaining why there is always the same output.

All standard video feeds except the most_popular feed have been deprecated. In response to requests for other feeds, the API will return the most_popular feed with a default time parameter value of today.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top