Since last month, requests without a valid referrer get rejected with an
HTTP 403 error.
We might want to consider that the lua script API should track and pass
such referrers by itself.
The descrambling function is now called through an intermediate array
variable. This change has also added two extra ways to recover the
function name. Add support to parse and resolve any of them.
Fixes#26574
A new variant of compound transformation has the Base64 alphabet
generation and the compounding itself as two separate data array
elements, contrary to what was observed so far. Add support for those.
Fixes#26285
A new standalone compound transformation, taking its Base64 alphabet
as extra input argument, has revealed itself. We support parsing and
passing this one more argument from the script section.
Technically this last argument can be a function or rather the result
of its call, but with no argument, we know what's always returned, and
don't need to treat it as a function. This is less clean but simpler and
will do for now.
Newly observed transformations reveal that the uncertain character
code variable used as constant offset, really isn't one and is simply
supposed to be the alphabet's length. Thus even more so, it is a no-op
on the alphabet's algebraic modulo group, and probably just an artifact
of how modulo of negative numbers is handled in javascript. Simplify it
away.
User agents are apparently now expected to do this; failure to do so
results in the video file data transfer getting throttled down to rates
such as 80 kB/s, 60 kB/s or 40 kB/s, below playback rate, and usually
resulting in a video that hangs upon loading or every few seconds, and
is impossible to play. This behavior seems to have first appeared in
June, but been fully rolled out only last week.
Just like with URL signatures, we interoperate with YouTube by
fulfilling what's apparently expected from us, using the same approach
as so far: we parse the descrambling rules from the javascript code, and
apply them.
Fixes#26174
We'll be descrambling the "n" parameter in addition to the URL signature
using this same javascript web asset, so we want to be able to share and
reuse it.
After tightening access restrictions to it, the get_video_info YouTube
API was completely retired around July 2021, with an HTTP 410 Gone code.
All this fallback achieves anymore is poor UX.
In the past few days, YouTube has started redirecting requests for video
pages to a cookie consent and preference prompt, on a whole separate
page and domain; which prevents playback. We are not interested in
YouTube cookies, nor in consenting to them on behalf of our users, so
this just retries with cookies disabled. YouTube gets the hint and
simply redirects back to the original video page.
Fixes#25616
Following changes in the SoundCloud JavaScript web assets, the API
magic is only found anymore in assets with lines exceeding the VLC API
line-length limit of 200 kB, making it impossible to extract this way
and causing playback failure.
These JavaScript assets are minified into one-liners, so it makes no
sense anyway to attempt to read and parse them line by line. Instead,
this now reads up to 4 MB of text from them (the relevant asset
currently weighs 1 MB). This way is arguably better and also more
efficient to begin with.
Refs #24957Fixes#25508
This URL is forwarded to the fallback API and the whole point of that is
in case the main stream configuration line can't be found and parsed,
so don't look for it only on that line. The URL can indeed be found in
several other places on the page.
This renders the fallback to the alternate video info API - which
doesn't provide the javascript URL itself - functional with many more
videos, and makes the script as a whole more resilient to future
failures.
This is required for the main configuration line, and possibly another
line before it. Until more is known, it seems more prudent to enable the
workaround unconditionally for now, than to try and guess what should
work correctly.
This new layout is apparently getting phased in. As major differences,
line splitting is more erratic (with overall 10 times fewer lines for a
slightly bigger HTML document), and the main stream configuration isn't
subjected to double JSON string encoding anymore.
Apparently the old parameter has been replaced by a new one, and is now
getting phased out. The signature descrambling javascript URL is still
available in several other places in the HTML page either way.
Fixes#25223
Those strings are read directly by the mac OS to show some reason
in ressource request dialogs.
The strings for NSAppleEventsUsageDescription, NSCameraUsageDescription
and NSMicrophoneUsageDescription are mandatory, otherwise the
application will crash.
InfoPlist.strings needs to be translated to show localized variants
of those strings.
refs #21378
This uses the extract-flat mode of YoutubeDL, which skips parsing
individual items within a playlist. We define a dedicated MRL scheme
to track a YoutubeDL playlist item, and parse it only when the item is
actually opened.
This has two benefits:
1) Extracting a playlist is dramatically faster.
2) Expiring media URL can be played even if the playlist is long.
This does *not* solve the remaining problem that expiring URLs cannot
be saved and replayed later.
This script generates a JSON playlist from a given URL, providing a
simple serial format that can be read and parsed by another process.
The JSON schema is the same as YoutubeDL's.
There are in principles two other alternative ways to access it:
1) Calling the YoutubeDL module directly in-process through CPython.
This poses a number of problems:
- CPython must be loaded by the main executable. Python modules will
fail to resolve their CPython symbols otherwise.
- Multiple CPython interpreters are still very immature; GIL behaves
weirdly. CPython is really not meant for multithread.
- The GIL prevents concurrent uses (that's the whole point of it).
- CPython network I/O cannot be interrupted by VLC interruptions, so
the calling thread may get stuck inside CPython.
- A build-time dependency on CPython is added.
2) Calling the YouTubeDL executable directly. This is impractical
because logging infos get interleaved on the standard output
alongside the proper output data. Worse yet, there are no obvious
ways to separate (flat) playlist extraction and item parsing
(which becomes necessary in a later patch in the series).
3) Using a playlist format already supported by VLC (as done in
previous versions of the patchest). This causes loss of potentially
useful information.
The name is used as fallback if the title is unset, but not conversely:
so setting the item title instead can have interesting side effects.
This was an odd one; like in most lua playlist scripts we really want to
set a name here.
Fixes#25124