niconiconi on Nostr: Note to self: how to grep YouTube videos. # download channel metadata yt-dlp '' ...
Note to self: how to grep YouTube videos.
# download channel metadata
yt-dlp '
https://www.youtube.com/@example'; --dump-single-json --skip-download --flat-playlist > example-channel.json
# for each element in array "entries", print(title + "\t" + url)
jq -r '.entries[].title + "\t" + .entries[].url' example-channel.json | grep keyword
Published at
2024-03-22 13:57:57Event JSON
{
"id": "967fbba19500f9f86053149cb2f05b2263cecf3ec149270b42bae12f8ce411eb",
"pubkey": "26fdcfc5f6ff27a9926ef372554241c70b1042094ec7749aa301091e34d17aa0",
"created_at": 1711115877,
"kind": 1,
"tags": [
[
"proxy",
"https://mk.absturztau.be/notes/9r6aixzwmg7y01wr",
"activitypub"
]
],
"content": "Note to self: how to grep YouTube videos.\n\n\n# download channel metadata\nyt-dlp 'https://www.youtube.com/@example' --dump-single-json --skip-download --flat-playlist \u003e example-channel.json\n\n# for each element in array \"entries\", print(title + \"\\t\" + url)\njq -r '.entries[].title + \"\\t\" + .entries[].url' example-channel.json | grep keyword",
"sig": "4067a652eeaef5db4004b10a1574980e8c6a51ecb12df7800667fa1175795f6c51dad11e75e267e31f195026ecad062068b6d7879784e7369d98a5c18717b7ee"
}