[vlc-devel] PATCHv3 0/4] YoutubeDL stream filter

Pierre Ynard linkfanel at yahoo.fr
Thu Sep 24 09:16:26 CEST 2020


> > Because fixing the URL expiration issue meant that all downstream
> > modules got a URL and byte stream that didn't match, is that it?
> 
> Stream filters convert a byte stream into another byte stream. No news
> there. Decomp has been doing this for years.

Okay. That's reassuring.

> Well, that's a rather offensive way to refer to the Lua code.
> 
> There are no such issues with the YoutubeDL filter, or really any
> other filter. To my knowledge, they all correctly fail in probe when
> they can't handle the source.

Anyway, it's easy to fix one way or another, for example the lua
scripts' probing could at least peek at the first bytes of the stream
and check that it's text and HTML.

So now that this is a stream filter, we can manage its priority towards
other stream filters. But what about demuxes? There are a few of them
that call vlc_stream_NewURL(), in particular the adaptive demux that
fetches m3u8 files with it. We know that youtube-dl tries to do things
with those. I tried passing to youtube-dl one such internal m3u8 URL
from one stream, and it didn't appear to mangle it; but I have limited
expertise in adaptive streaming and I didn't do any kind of real
testing.

Also, if I understand correctly, the HTTP connection already established
by the HTTP access isn't used. I'm not clear what happens to it, is it
left dangling with nothing reading from it? In the case of a web radio
audio stream, for which youtube-dl returns the input URL untouched,
does that mean that VLC keeps two connections to the server open, one
of which unused? Can that cause issues, or at least annoy the server?
There's always the solution of comparing the input and output URLs, and
failing if they're identical to avoid duplicating the connection for
nothing.

Another point that comes to my mind now is that some websites require
tweaking the HTTP user agent, or passing a correct referrer header. I
assume youtube-dl knows what to do, and does it when downloading itself.
It's probably possible to recover those parameters from youtube-dl's
output, and set them on the HTTP access.

These last two points aren't blockers, but I still wanted to bring them
up and share.

-- 
Pierre Ynard
"Une âme dans un corps, c'est comme un dessin sur une feuille de papier."


More information about the vlc-devel mailing list