'Retrieving feeds (uploads) for YouTube user
Sometimes last year I could retrieve (publicly accessible) video feeds for a YouTube user by simply appending/uploads?alt=rss. e.g. http://gdata.youtube.com/feeds/base/users/NTVKenya gave http://gdata.youtube.com/feeds/base/users/NTVKenya/uploads?alt=rss. But this service is no longer available.
Now the recommended way, I guess, is to use GData library. However, using this service is giving me com.google.gdata.util.NoLongerAvailableException exception:
YouTubeService service = new YouTubeService("service");
ArrayList<String> urls = new ArrayList<String>();
VideoFeed videoFeed = service.getFeed(new URL('http://gdata.youtube.com/feeds/base/users/NTVKenya'), VideoFeed.class);
for (VideoEntry videoEntry : videoFeed.getEntries() ) {
urls.add( videoEntry.getHtmlLink().getHref() );
}
This gives:
com.google.gdata.util.NoLongerAvailableException: No longer available
<errors xmlns='http://schemas.google.com/g/2005'><error><domain>GData</domain><code>NoLongerAvailableException</code><internalReason>No longer available</internalReason></error></errors>
Where am I going wrong?
Thanks.
Solution 1:[1]
Another way to get the "uploads" from a given YouTube user, you can follow these steps:
- Go to the YouTube channel you want to get their "upload" feed.
- Get its channel_id - see here more info.
- Replace the second character of the channel_id from "
C" to "U". Example: channel_id:UCqBJ47FjJcl61fmSbcadAVg- modified:UUqBJ47FjJcl61fmSbcadAVg. - Paste the modified channel_id in this URL: https://www.youtube.com/feeds/videos.xml?playlist_id=<>
The result would be this URL:
https://www.youtube.com/feeds/videos.xml?playlist_id=UUqBJ47FjJcl61fmSbcadAVg
It brings the latest 15 uploaded videos.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Marco Aurelio Fernandez Reyes |
