Live data from Hacker News

Reverse-Engineering YouTube: Revisited

tyrrrz.me

21–30 of 43 posts

Re: Reverse-Engineering YouTube: Revisited

#21

Interestingly I found that YouTube's web UI actually requests range URLs rather than range HTTP headers, allowing it to seek around the video faster than mpv with yt-dlp (and conveniently avoiding throttling as well). I suspect this may be related to DASH: https://github.com/mpv-player/mpv/issues/10601 Unfortunately mpv and ffmpeg do not currently have mature DASH support and cannot benefit from fast seeks: https://g…

> and conveniently avoiding throttling as well

throttling is not avoided. the YouTube web client generates a JavaScript signature that disables the throttling, same as what the code in the article does.

Re: Reverse-Engineering YouTube: Revisited

#22
post #7

Ive said it before on GitHub, I dont think `TVHTML5_SIMPLY_EMBEDDED_PLAYER` is the great solution everyone thinks it is. Yeah, you can get the age-restricted videos anonymously. However you can also get those videos by logging in, which the author doesn't mention: POST /youtubei/v1/player HTTP/1.1 Host: www.youtube.com Authorization: Bearer ya29.a0AVvZVsqRwNWFI3R0MSxnugyNlxbqIOXcwXkeA6NMOcpv_... { "contentCheckOk": t…

> However you can also get those videos by logging in, which the author doesn't mention. > Also not mentioned in the article is that you can actually take the throttled URLs as is, and download pieces concurrently for a pretty good result. The author mentioned both, the login option as well as the chunking mechanism. Sorry, but did you actually read the blog post?

they mention cookies. that not the correct method for authenticating to the API, OAuth is.

Re: Reverse-Engineering YouTube: Revisited

#23
post #18
post #7

Ive said it before on GitHub, I dont think `TVHTML5_SIMPLY_EMBEDDED_PLAYER` is the great solution everyone thinks it is. Yeah, you can get the age-restricted videos anonymously. However you can also get those videos by logging in, which the author doesn't mention: POST /youtubei/v1/player HTTP/1.1 Host: www.youtube.com Authorization: Bearer ya29.a0AVvZVsqRwNWFI3R0MSxnugyNlxbqIOXcwXkeA6NMOcpv_... { "contentCheckOk": t…

If you can afford to always be logged in, then sure, but it's not always an option. Especially if you need a general solution.

who said anything about always? you log in as needed. most videos are open.

Re: Reverse-Engineering YouTube: Revisited

#24
post #12

Does anyone know if YouTube runs Ffmpeg internally?

Circumstantial evidence that they used to: https://multimedia.cx/eggs/googles-youtube-uses-ffmpeg/ These days they use special hardware accelerators: https://gwern.net/doc/cs/hardware/2021-ranganathan.pdf

I built software to efficiently run a large number of GPUs (>120k) in data centers. That second link is fantastic, but it really gives me PTSD. =)

Re: Reverse-Engineering YouTube: Revisited

#25
post #10

While not fully related to the code itself, my daughter has a school provided Chromebook that blocks almost all Youtube video content. You can browse the YT site, but the thumbnails and videos won't load. I'm assuming there is some kind of content block occurring here based on some part of the URL. Well, kids being clever figured out the Chromebook browser shows a preview video if you hit the 'share' button and go to…

[deleted]

Re: Reverse-Engineering YouTube: Revisited

#28
If you really want to understand how streaming video works then it definitely takes you down a couple rabbit holes - but it’s worth it. I think more people and companies should try to stream their own video content rather then be at the mercy of Google, their algorithms, and their censorship. You don’t have to “be” YouTube and host other users content but you should be able to host your content without YouTube’s approval.

Re: Reverse-Engineering YouTube: Revisited

#29
post #11
post #3

> There is one thing that developers like more than building things — and that is breaking things built by other people. Haha. This is not as universal as the author thinks. Every time I need to reverse-engineer something obscured on purpose, I wish we could just get along. Every time I have to reverse-engineer something obscured by accident, I call it debugging. But even if I solve the puzzle, it's like solving cros…

Unfortunately the halting problem takes all your mathematical certainty and throws it out the window. It's very easy to take your application which will halt within a finite amount of time to one that will not. You'll find most programmers and companies are not going to spend the massive amount of time to ensure their logic is correct, but instead throw the application out there quickly and fix it based on crashes an…

Mathematical certainty is what to leverage, not what to fight. You'd use it before you run into the halting prbblem, not after. Just like mathematics was used to discover the halting problem in the first place.

And what you're describing as happening in practice is precisely the disappointing part of prgramming.

Re: Reverse-Engineering YouTube: Revisited

#30

If you really want to understand how streaming video works then it definitely takes you down a couple rabbit holes - but it’s worth it. I think more people and companies should try to stream their own video content rather then be at the mercy of Google, their algorithms, and their censorship. You don’t have to “be” YouTube and host other users content but you should be able to host your content without YouTube’s appr…

There are probably many paid video hosting platforms. You can't save that much by hosting it yourself.

Anyone who is hosting on YouTube is looking for a free service.

Post reply on HN