Posted: . At: 11:12 AM. This was 2 years ago. Post ID: 15970
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.



Sponsored



Youtube RSS feeds died temporarily but now they are back.


Youtube RSS feeds died for a short time, but now they are back. These are a great way to get information about a Youtube user`s latest uploaded videos. This can allow access to the thumbnail file and the views count.

Here is an example URL.

https://www.youtube.com/feeds/videos.xml?channel_id=UCgc4xqIMDoiP4KOTFS21TJA.

This is a sample from a Youtube RSS feed from a user`s channel.

videos.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<entry>
<id>yt:video:gakM3eWqku8</id>
<yt:videoId>gakM3eWqku8</yt:videoId>
<yt:channelId>UCgc4xqIMDoiP4KOTFS21TJA</yt:channelId>
<title>Mega64 Last Laugh: The Official Tour Movie TRAILER</title>
<link rel="alternate" href="https://www.youtube.com/watch?v=gakM3eWqku8"/>
<author>
<name>Mega64</name>
<uri>
</uri>
</author>
<published>2022-02-22T14:00:26+00:00</published>
<updated>2022-02-23T06:20:20+00:00</updated>
<media:group>
<media:title>Mega64 Last Laugh: The Official Tour Movie TRAILER</media:title>
<media:content url="https://www.youtube.com/v/gakM3eWqku8?version=3" type="application/x-shockwave-flash" width="640" height="390"/>
<media:thumbnail url="https://i4.ytimg.com/vi/gakM3eWqku8/hqdefault.jpg" width="480" height="360"/>
<media:description>
Mega64 Last Laugh: The Official Tour Movie coming to Blu-ray on March 18 at http://shop.mega64.com Whether you experienced Mega64's hit live show for yourself, or never got the chance to witness the magic yourself... get ready to be mystified by our brand new tour Blu-ray! This physical release, made possible by our friends at Limited Run Games, contains not only the full live Mega64 comedy show full of skits, songs, and sorcery- it also contains the official tour documentary, following us around on our first full tour ever. With commentary, bonus footage, and more, you'll want to make sure you get the Last Laugh! Blu-ray on sale on Friday, March 18, 2022! http://mega64.com http://patreon.com/mega64 http://shop.mega64.com http://twitter.com/mega64 http://instagram.com/mega64official http://facebook.com/mega64 http://youtube.com/mega64archives https://twitch.tv/mega64podcast
</media:description>
<media:community>
<media:starRating count="357" average="5.00" min="1" max="5"/>
<media:statistics views="6455"/>
</media:community>
</media:group>
</entry>

The bash script below will parse a Youtube feed URL and then download the RSS feed and parse it.

xml.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
jason@jason-Lenovo-H50-55:~$ cat xml.sh
#!/bin/sh
 
ID="UCgc4xqIMDoiP4KOTFS21TJA"
URL="https://www.youtube.com/feeds/videos.xml?channel_id="
 
wget $URL$ID -O test.xml
 
cat test.xml | while read line;do
[ "$(echo "$line" | grep "<media:title>")" ]&& echo "$line" |  cut -f3 -d'[' | cut -f1 -d']'
[ "$(echo "$line" | grep "<media:content>")" ]&& echo "$line" |  cut -f3 -d'[' | cut -f1 -d']'
[ "$(echo "$line" | grep "<media:thumbnail>")" ]&& echo "$line" |  cut -f3 -d'[' | cut -f1 -d']'
[ "$(echo "$line" | grep "<media:description>")" ]&& echo "$line" |  cut -f3 -d'[' | cut -f1 -d']'
done

Just supply the Youtube channel ID number and then it will work fine. This is very useful information. So, this is how to get a Youtube RSS feed and then parse it for information about the user`s latest uploaded videos using bash. I hope this is useful to someone out there. I think this could be great.


2 thoughts on “Youtube RSS feeds died temporarily but now they are back.”

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.