The file directly modifies the global table (_G) so it does not
seem necessary at all to expose anything explicitly.
(cherry picked from commit 33c7a44fd8)
Signed-off-by: Marvin Scholz <epirat07@gmail.com>
Due to the severely increased complexity of "n" descrambling code, a
quick fix is unfortunately not foreseeable. For now, let users know more
clearly what's going on and what's to expect or not.
Ref #27227
(cherry picked from commit 90dcfa0e78)
Signed-off-by: David Fuhrmann <dfuhrmann@videolan.org>
The descrambling script section was updated from a simple and linear
chain of calls, to a complex execution tree with conditional branches.
Failure to recognize and parse this call structure (or lack thereof)
resulted in a silent no-op. Add a check to properly report an error.
Ref #27227
(cherry picked from commit b735ef2cde)
Signed-off-by: David Fuhrmann <dfuhrmann@videolan.org>
It was possible, when encountering different code from what was expected
for some known transformations, to void the code parsing pointer instead
of advancing it, resulting in a subsequent crash of the script and total
playback failure. Add a fallback and check, to prevent and gracefully
deal with this, and still allow playback, even if throttled, in case of
descrambling failure.
(cherry picked from commit 1494441075)
Signed-off-by: David Fuhrmann <dfuhrmann@videolan.org>
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.
(cherry picked from commit 3c9c32ab3b)
Signed-off-by: David Fuhrmann <dfuhrmann@videolan.org>
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
(cherry picked from commit 3df28fc51e)
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
Due to a bug in the directory, some streams lack a listen URL.
Fix#25309
(cherry picked from commit c8c78f75e7)
Signed-off-by: Marvin Scholz <epirat07@gmail.com>
They now appear; add support for parsing them.
Fixes#26317
(cherry picked from commit 6b5bc195a9)
Signed-off-by: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
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
(cherry picked from commit 7f6614cbaf)
Signed-off-by: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
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.
(cherry picked from commit fd2e937f28)
Signed-off-by: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
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.
(cherry picked from commit 174e12b3bc)
Signed-off-by: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
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
(cherry picked from commit 03e6957832)
Signed-off-by: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
This should help against transient errors, and parsing of the javascript
URL isn't the part that's most likely to break.
(cherry picked from commit f3963e68c1)
Signed-off-by: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
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.
(cherry picked from commit 4cfa8b65ef)
Signed-off-by: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
Use a more specific name as this isn't the only parameter anymore that
we'll be descrambling by parsing and emulating javascript.
(cherry picked from commit 095f093093)
Signed-off-by: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
Javascript variables can contain other, special characters, also %a
depends on the locale.
(cherry picked from commit a178691270)
Signed-off-by: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
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.
(cherry picked from commit c7b4efcf75)
Signed-off-by: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
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
(cherry picked from commit f21c063ea3)
Signed-off-by: Pierre Ynard <linkfanel@yahoo.fr>
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
(cherry picked from commit 302d55967b)
Signed-off-by: Pierre Ynard <linkfanel@yahoo.fr>