I have a solution of sorts. Here's what I did.
Open the YouTube home page. Open the Network Monitor. It's best to have the Network
Monitor open before you go to a video you are interested in.
Surf to a video. This one happened to be the very first one on the YouTube home page at
the moment I went there. I think the content of this page changes based on criteria I
can't possibly imagine. I suspect it's some combination of your location, whatever
leftover YouTube cookies happen to be in your cookie cache thus telling YouTube what you
looked at recently, time of day, phase of the moon, ambient temperature, the color of
your clothes, & your heart rate, plus some untold number of other conditions. (Some of
those may be mildly exaggerated.) So this is the video I tested with:
https://www.youtube.com/watch?v=8TUbup9yijU
After the page loaded & reached an equilibrium state, I just started looking through the
Network Monitor for anything that might catch my eye. This is total improvisation &
guesswork. Will it work on another page? Hey, you try it & post your experience here.
I always sort the Network Monitor on the Type column. That causes all items of type jpeg
to be grouped together, same for css, same for html, same for anything. When I got to
the json group, the first one had the name player?key= and a bunch of other junk. These
things are always inscrutable collections of apparently random junk. It has always been
my assumption that these random strings associate the object with my web session, & they
have a shelf life, meaning they expire. So there's no point in my showing any of this
because it will be different for you if you try to follow my example here. About the
only thing that is likely to be the same for you is the URL of the web page, which is why
I quoted that.
Anyway, on this player json, I popped up the context menu, cascaded out the Copy Value
submenu, & executed the Copy Response entry on the submenu. This is something we've
discussed at length over here:
https://groups.google.com/g/video-downloadhelper-q-and-a/c/sNfTCMYfiTU
In fact, I'm basically trying do what we talk about in that thread.
Copy Response places something, presumably the contents of the json, into the system
clipboard. So from there, I pasted it into my text editor & just started scrolling
through it. More guesswork & improvisation.
I noticed there were URLs in there. The usual, typical long ugly ones. But I noticed
that below each URL, there was a collection of things that looked like they were
descriptions that applied to the URL above them. Since such a collection was not above
the first URL, I jumped to the pretty safe conclusion that the pattern was URL first,
descriptors after. At first, I just searched for "mimeType" because that's what I
noticed. Eventually, I refined my searching to look for
"mimeType":"video/
"mimeType":"audio/
After the / in each of those strings it showed the specific type of the object. I found
videos of types mp4 & webm. I found audios of types mp4 & webm.
In hunting through the videos, I saw that just after the mimeType string there were
"width" & "height" values. Great. This told me resolution of the thing referred to by
the URL right above it.
In hunting through the audios, I saw that just after the mimeType string there was a
"bitrate" value. Great. This told me the quality of the audio of the thing referred to
by the URL right above it.
I settled on a video webm of resolution 3840x2160. Since that was a webm, I chose an
audio that was also webm. Among my choices, the one with a bitrate of 115896 had the
highest value.
I ran both those URLs through ffprobe & got results. This is significant. I've been
trying URLs offered by VDH & they have all gotten "invalid data encountered in the input
stream." So this was a distinct step forward.
So I ran 2 invocations of ffmpeg, one to download the video webm, the other to download
the audio webm. I'm attaching the ffmpeg logs from those 2 downloads. You'll note that
the download speeds for both downloads were utterly horrific. (That information is in
those logs. Just look for it.) In the case of the video, the duration of the download
was utterly ridiculous, far worse than what VDH used to get when it actually worked on
YouTube.
The video download completed with the error you can see. My interpretation of the
situation is that the download was so stinkin slow, making it last so stinkin long, that
my URL finally timed out. I had only about 70% of the video after all that time. I did
play the 2 files I downloaded synchronously in VLC. What I had played fine, it just
wasn't the whole thing.
But this isn't meant as a practical alternative. This is meant as a feasibility study, a
proof of concept. I have probably disproved my earlier speculation that the content is
being encoded differently. It's certainly not encrypted. The information for retrieving
any YouTube video is still being supplied. Now all VDH has to do is find it & use it. I
would hope that however Michel gets these streams, it doesn't end up being this slow. If
that's all we end up with, I will choose from among the alternatives that my fellow users
have offered here for my YouTube downloads in future. I sure won't use VDH.