Posted by surprisetalk 4 hours ago
> This is the only yt-dlp wrapper that allowed me to properly maintain the Playlist structure to any extent
I have the same requirement and it's possible to do it with the default yt-dlp:
yt-dlp --embed-metadata --parse-metadata "playlist_index:%(track_number)s" "PLAYLIST_URL"
There's videos from ~15 years ago that I consider gone for good - lost to the great copyright apocalypse - having been unable to find them anywhere on the today's internet.
I saw a similar thing some years back: playlists I had created began to be missing videos.
Been scraping ever since…
Many from my generation, who grew up during an era of information scarcity, have huge stashes of hoarded data. But what can we do with it? There is no way to legally share it, so we take it with us in our graves.
EDIT: Many good comments, but they all suffer from one blind spot, so I answer here instead of individually.
A lot of content is only legal because it is on YouTube (or any other platform that has deals with the content industry). Sure, we can share illegally in a way that is obscure enough that no one gets sued. But what help is that, eventually it will get either popular and sued out of existence or forgotten and fade.
Then there is old content that is not legally shareable at all, like old game ROMs. Plenty of millennial stuff there but the Gen-X world is already half forgotten.
Cooyright is just too long and too unreliable. What we need at least is exemptions from Copyright for archivists, otherwise a lot of stuff will simply be lost in the coming decades.
But you just mentioned the RSS thing ... Doctor, heal thyself!
My arguments line for the extension looks something like this: /C C:\Users\[user]\youtube-dl\yt-dlp.exe -v -P "D:\Media\Videos" -f "bv[vcodec!=av01]+ba/b" --write-subs --embed-subs --sub-langs "en.*" --compat-options no-keep-subs --merge-output-format mkv [HREF]
HN is messing with the formatting. bv and vcodec! should have an asterisk after them.
Not sure what you're exactly asking for. Google/Youtube does provide an "official" API for youtube searches:
https://developers.google.com/youtube/data/reference/rest/v3...
It's rate-limited but other hacks to scrape Youtube without the API will also be rate-limited as well unless you try to trick Google via unapproved hostile methods such as commanding an army of residential ip zombies and aggregate it.
Fundamentally, the index of Youtube videos lives in Google's servers so you're beholden to Google to get results from it. If the issue is that the Google's official results from search queries are not surfacing the videos you think are actually there, it means you'd have to build a duplicate (massive) "shadow" index to return those missing videos. To build such a beast, you're back to hitting the brick wall of rate-limits again.
> API key not valid. Please pass a valid API key.
A script that streams clipboard changes.
Next i run a bunch of user services that do:
`await-clipboard.sh | grep --line-buffered -z -e "youtu" | ...`
I just use youtube like normal, but instead of clicking a video i right-click copy to clipboard and a mpv+sponsorblock window pops up
It worked decently well. However, I started running into API limits when it would refresh to fetch updates. Things could likely be tweaked to avoid this, but I haven’t revisited it yet.
I didn’t make a generic search, but did allow pulling up one-off videos to download and favorite them.
copy(
'yt-dlp ' +
[...document.querySelectorAll('ytd-video-renderer a#video-title')]
.map(a => {
const u = new URL(a.href);
return `"https://www.youtube.com/watch?v=${u.searchParams.get('v')}"`;
})
.join(' ')
)Since youtube api won't help with this someone needs to build a video index and a good search algorithm on top. Would be nice to be able to search through indexed subtitles too.
It's intended to be used as a youtube-to-podcast-player tool, but seems like it fits your use, too.
That's kinda the nature of YouTube downloaders/scrapers including yt-dlp. It's not exactly a public API that YouTube's offering to support.
I wanted to rewatch some of his videos recently and as far as I can tell most of his videos are now lost media. I should have downloaded them when I had the chance.