1
mirror of https://code.videolan.org/videolan/vlc synced 2024-10-03 01:31:53 +02:00
Commit Graph

1680 Commits

Author SHA1 Message Date
Lyndon Brown
ce0868d1e0 vlcsub: switch API URLs to HTTPS 2022-03-13 06:05:33 +00:00
Lyndon Brown
e1194a5f29 Switch various user facing URLs to HTTPS
Fixes #26687.
2022-03-13 06:05:33 +00:00
Rémi Denis-Courmont
d64976fd7e share: fix appdata.xml rules 2022-03-08 21:16:13 +00:00
Rémi Denis-Courmont
db3b4b964e ytdl: switch over to yt_dlp
YoutubeDL is pretty much dead.
Fixes #26206.
2022-02-22 18:39:28 +00:00
Pierre Ynard
3c9c32ab3b vocaroo.lua: pass HTTP referrer to media URL request
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.
2022-02-06 08:24:28 +00:00
Pierre Ynard
3df28fc51e youtube.lua: update "n" descrambling function name parsing
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
2022-02-06 08:24:28 +00:00
Hugo Beauzée-Luyssen
e253894672 VLSub: Fix userdata directory creation
Fix #26356
2021-12-15 13:01:33 +00:00
Hannes Domani
c8c78f75e7 lua: icecast: fix nil value error for some streams
Due to a bug in the directory, some streams lack a listen URL.

Fix #25309
2021-11-30 15:27:53 +00:00
Pierre Ynard
6b5bc195a9 youtube.lua: exponential form integers in "n" descrambling input data
They now appear; add support for parsing them.

Fixes #26317
2021-11-25 11:33:31 +00:00
Pierre Ynard
84ba044df1 youtube.lua: document an "n" descrambling transformation 2021-11-25 11:33:31 +00:00
Pierre Ynard
7f6614cbaf youtube.lua: add "n" descrambling split compound transformations
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
2021-11-16 08:18:00 +00:00
Pierre Ynard
fd2e937f28 youtube.lua: "n" descrambling transformations with two extra arguments
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.
2021-11-16 08:18:00 +00:00
Pierre Ynard
174e12b3bc youtube.lua: simplify "n" descrambling compound transformation
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.
2021-11-16 08:18:00 +00:00
Pierre Ynard
03e6957832 youtube.lua: descramble "n" video URL parameter by parsing javascript
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
2021-10-20 19:15:53 +02:00
Pierre Ynard
f3963e68c1 youtube.lua: retry fetching descrambling javascript asset once
This should help against transient errors, and parsing of the javascript
URL isn't the part that's most likely to break.
2021-10-20 19:15:51 +02:00
Pierre Ynard
4cfa8b65ef youtube.lua: factor out descrambling javascript fetching
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.
2021-10-20 19:15:50 +02:00
Pierre Ynard
095f093093 youtube.lua: rename signature descrambling function
Use a more specific name as this isn't the only parameter anymore that
we'll be descrambling by parsing and emulating javascript.
2021-10-20 19:15:48 +02:00
Pierre Ynard
8473b3bf3b youtube.lua: rework error handling for signature descrambling 2021-10-20 19:15:46 +02:00
Pierre Ynard
a178691270 youtube.lua: fix up signature descrambling function name extraction
Javascript variables can contain other, special characters, also %a
depends on the locale.
2021-10-20 19:15:44 +02:00
Pierre Ynard
c7b4efcf75 youtube.lua: remove fallback to retired alternate video info API
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.
2021-10-20 19:15:43 +02:00
Pierre Ynard
b2c32b5eda youtube.lua: add extra "out of use" comment 2021-10-20 19:15:41 +02:00
Kung Lao
c05eb00c25 youtube.lua - js_descramble function name return fix: the string pattern match now returns 2 or 3 char length function names. Issue ref: #25988, #25995 (closed) 2021-09-04 07:57:17 +00:00
Pierre Ynard
55456d7c1e liveleak.lua: fix video resolution selection 2021-04-03 15:46:41 +02:00
Pierre Ynard
e02e408c34 liveleak.lua: fix title metadata parsing 2021-04-03 15:46:02 +02:00
Pierre Ynard
3f40193298 liveleak.lua: support new video URL format 2021-04-03 15:38:08 +02:00
Pierre Ynard
f21c063ea3 youtube.lua: disable cookies if redirected to consent page
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
2021-04-03 12:02:34 +02:00
Pierre Ynard
302d55967b soundcloud.lua: don't treat JavaScript assets as line-based
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 #24957
Fixes #25508
2021-03-07 00:44:41 +01:00
Rémi Denis-Courmont
af9f183006 ytdl: fix/update parameter for playlist extraction 2021-02-13 09:00:31 +02:00
Rémi Denis-Courmont
f42783cd70 Revert "lua/http: add pl_sd_(add|remove) HTTP requests"
This reverts commit 9708665a0f,
broken by 3159dad5eb.
2020-11-20 22:20:48 +02:00
Pierre Ynard
6e0f4a28c6 youtube.lua: retry alternate API fallback using either possible parameter
This improves the interoperability of the fallback mechanism and makes
the script more resilient as a whole.
2020-11-12 07:22:04 +01:00
Pierre Ynard
8ea54417ba youtube.lua: look for javascript descrambling URL on any line
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.
2020-11-12 06:21:27 +01:00
Pierre Ynard
2d0f63a61b youtube.lua: forward javascript descrambling URL to alternate API
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.
2020-11-12 05:58:28 +01:00
Pierre Ynard
95cf2a33e9 youtube.lua: support music.youtube.com URLs
Simply redirect to the main domain

Fixes #25241
2020-11-12 05:53:40 +01:00
Pierre Ynard
77f19929db youtube.lua: make gaming.youtube.com subdomain support more generic
And mark it as out of use: gaming.youtube.com URLs now get redirected to
the main domain.
2020-11-12 05:42:59 +01:00
Pierre Ynard
7b7eac1461 youtube.lua: fix escaped '\r' in metadata from alternate API 2020-11-12 03:38:58 +01:00
Pierre Ynard
61b51a0dfd youtube.lua: always use long line workaround with new HTML code layout
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.
2020-11-04 19:22:10 +01:00
Pierre Ynard
c20877a8b4 youtube.lua: split long line workaround into reusable helper 2020-11-04 19:17:23 +01:00
Pierre Ynard
671afe05eb youtube.lua: support new HTML code layout
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.
2020-11-03 01:20:21 +01:00
Pierre Ynard
611ba98b65 youtube.lua: stricter check for applying peek() long line workaround
Required with a new HTML code layout apparently getting phased in
2020-11-03 01:02:03 +01:00
Pierre Ynard
f3d206499b youtube.lua: more robust meta tag metadata parsing
Required for a new HTML code layout apparently getting phased in
2020-11-03 00:41:48 +01:00
Pierre Ynard
ff8edf3493 youtube.lua: stop trying to double XML-decode title metadata
This attribute isn't double-encoded now, and so attempting this is not
just pointless but can theoretically lead to wrong output.
2020-11-03 00:26:39 +01:00
Pierre Ynard
083059cd88 youtube.lua: fix escaped characters issue in artist metadata
The double encoding of \u0026 wasn't handled.
2020-11-03 00:14:45 +01:00
Pierre Ynard
9d4c4d2fb9 vocaroo.lua: dispatch to correct CDN server
Vocaroo has started using different server locations for different
media, and the client has to dispatch to the correct one based on the
media ID.
2020-10-30 13:11:28 +01:00
Pierre Ynard
eb4ee4f682 vocaroo.lua: remove obsolete {old,beta}.vocaroo.com support
These domains are now instead directly redirected to the main
vocaroo.com domain and platform.
2020-10-30 12:55:12 +01:00
Pierre Ynard
43a5da94af youtube.lua: new signature descrambling javascript URL parameter name
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
2020-10-26 08:27:28 +01:00
David Fuhrmann
f1534626c6 macosx: Add explanatory strings for access to restricted resources
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
2020-10-19 19:19:22 +02:00
Lyndon Brown
b17332fa77 .gitignore generated vlc-*.desktop files
missed in 488e0d6b64

Signed-off-by: Steve Lhomme <robux4@ycbcr.xyz>
2020-10-06 14:21:50 +02:00
Rémi Denis-Courmont
fa78491d58 ytdl: extract playlist non-recursively ("flat")
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.
2020-09-27 16:09:34 +03:00
Rémi Denis-Courmont
3f5d4031d9 share: add wrapper script for the YoutubeDL Python module
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.
2020-09-27 15:43:11 +03:00
Pierre Ynard
b42890f04c youtube.lua: return title as name field from alternate API too
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
2020-09-19 08:18:13 +02:00