This is actually very easy, I adapted the one-liner I used to get entries from a news website`s RSS feed and I managed to work out how to get a listing of all titles of the videos on a Youtube channel. This was pretty simple once I worked out the syntax, this could be very useful indeed.
┌──(john㉿DESKTOP-PF01IEE)-[~] └─$ curl -s https://www.youtube.com/feeds/videos.xml?channel_id=UC_x5XG1OV2P6uZZ5FSM9Ttw | xmlstarlet sel -t -v "//media:title" Google Summer of Code 2023, Cloud Workstations, and more dev news What does it mean to be a Google Developer Expert (GDE)? 4.7.2: Beyond perceptrons: Convolutional Neural Network (CNNs) - Implementation with TensorFlow.js 4.7.1: Beyond perceptrons: Convolutional Neural Network (CNNs) in the web browser 4.6.2: Multi-layer perceptrons for classification - Implementing a classifier in TensorFlow.js 4.6.1: Multi-layer perceptrons for classification 4.5.2: Multi-layer perceptrons - Deep neural networks for non linear data 4.5.1: Multi-layer perceptrons - The limits of a single neuron 4.4.3: Implement a neuron for linear regression - Model creation and training 4.4.2: Implement a neuron for linear regression - Importing and normalizing training data 4.4.1: Implement a neuron for linear regression - Training data and outliers 4.3.2: How to train a neuron? 4.3.1: What's a neuron? 4.2: Gathering, refining, and using data effectively for ML model datasets 4.1: Rolling your own Web ML models from a blank canvas |
This is a very useful one-liner.
Here is the actual command.
curl -s https://www.youtube.com/feeds/videos.xml?channel_id=UC_x5XG1OV2P6uZZ5FSM9Ttw | xmlstarlet sel -t -v "//media:title |
Here is another example.
┌─jason-Lenovo-H50-55@jason⬎┓ ┗━━━━━┫└─◉ 5.1-~-13:44-⚫ ◉--[$] ☕ curl -s https://www.youtube.com/feeds/videos.xml?channel_id=UC9RJ1bK-L2UN_crbXezWaRA | xmlstarlet sel -t -v "//media:title" 10 MINUTES OF GAMER RAGE #5 10 MINUTES OF GAMER RAGE #4 10 MINUTES OF MINECRAFT FAILS 10 MINUTES OF GAMER RAGE #3 10 MINUTES OF GAMER RAGE #2 10 MINUTES OF GAMER RAGE VALORANT 999 IQ PLAYS SHROUD absolutely destroying in VALORANT for 10 minutes straight. XQC RAGE & FUNNY MOMENTS COMPILATION. Asmongold funny stream moments. TOP FUNNIEST AND MOST AWESOME CLIPS IN MINECRAFT AMONG US Funny Moments & 900 IQ plays(base) |
Go to the Youtube channel page and select “View Source”. Then Press Control-F and search for “youtube.com/feeds” to get the RSS feed URL. This is a very simple trick to get information about a Youtube channel with the command line.
And this is how to list all video descriptions for every video on the channel.
(base) ┌─jason-Lenovo-H50-55@jason⬎┓ ┗━━━━━┫└─◉ 5.1-~-13:49-⚫ ◉--[$] ☕ curl -s https://www.youtube.com/feeds/videos.xml?channel_id=UC9RJ1bK-L2UN_crbXezWaRA | xmlstarlet sel -t -v "//media:description" |
Another useful Youtube trick.
If you need to get all Youtube video thumbnails from the Youtube videos on a channel, use this very long one-liner. This is how to get the value of a certain XML entry.
(base) ┌─jason-Lenovo-H50-55@jason⬎┓ ┗━━━━━┫└─◉ 5.1-~-14:04-⚫ ◉--[$] ☕ curl -s https://www.youtube.com/feeds/videos.xml?channel_id=UC9RJ1bK-L2UN_crbXezWaRA | xmlstarlet sel -t -v "//*[local-name()='feed']/*[local-name()='entry']/media:group/media:thumbnail/@url" ; echo https://i4.ytimg.com/vi/krxaKvOrBbg/hqdefault.jpg https://i4.ytimg.com/vi/3wcjMoX_7tc/hqdefault.jpg https://i1.ytimg.com/vi/lVjoWoHgduo/hqdefault.jpg https://i2.ytimg.com/vi/edU8xZhmPeI/hqdefault.jpg https://i1.ytimg.com/vi/p3KlS-cnNDM/hqdefault.jpg https://i1.ytimg.com/vi/DvMt4Vt9NUM/hqdefault.jpg https://i2.ytimg.com/vi/Yti-5vWpZ88/hqdefault.jpg https://i2.ytimg.com/vi/qUjY-ccXIbc/hqdefault.jpg https://i1.ytimg.com/vi/DPRN8LSO-Is/hqdefault.jpg https://i1.ytimg.com/vi/twVMYTUczqY/hqdefault.jpg https://i3.ytimg.com/vi/6PKByZ8MfLw/hqdefault.jpg https://i1.ytimg.com/vi/0AJg9hzG6AI/hqdefault.jpg |
This is the actual command.
curl -s https://www.youtube.com/feeds/videos.xml?channel_id=UC9RJ1bK-L2UN_crbXezWaRA | xmlstarlet sel -t -v "//*[local-name()='feed']/*[local-name()='entry']/media:group/media:thumbnail/@url" ; echo |
The @url option is the name of the actual XML entry value.
And finally, this version will print all video IDs in the list.
(base) ┌─jason-Lenovo-H50-55@jason⬎┓ ┗━━━━━┫└─◉ 5.1-~-15:43-⚫ ◉--[$] ☕ curl -s https://www.youtube.com/feeds/videos.xml?channel_id=UC9RJ1bK-L2UN_crbXezWaRA | xmlstarlet sel -t -v "//*[local-name()='feed']/*[local-name()='entry']/yt:videoId/text()" ; echo krxaKvOrBbg 3wcjMoX_7tc lVjoWoHgduo edU8xZhmPeI p3KlS-cnNDM DvMt4Vt9NUM Yti-5vWpZ88 qUjY-ccXIbc DPRN8LSO-Is twVMYTUczqY 6PKByZ8MfLw 0AJg9hzG6AI |