Compare commits

..

15 Commits

Author SHA1 Message Date
dirkf
74aae99fd8
Merge e5a0422f8db46711deb02dd08c515a6159af8544 into 673277e510ebd996b62a2fcc76169bf3cce29910 2025-03-10 17:19:41 +00:00
dirkf
e5a0422f8d
Merge branch 'master' into df-yt-update202503 2025-03-10 17:19:37 +00:00
dirkf
7de9312078 [JSInterp] Improve tests
* from yt-dlp/yt-dlp#12313
* also fix d7c2708
2025-03-10 11:44:06 +00:00
dirkf
c801971553 [YouTube] Update TVHTML5 client parameters
* resolves #33078
2025-03-07 23:09:54 +00:00
dirkf
e910a6d310 [YouTube] Initially support tce-style player JS
* resolves #33079
2025-03-07 23:09:54 +00:00
dirkf
c61a362378 [YouTube] Temporarily redirect from tce-style player JS 2025-03-07 23:09:53 +00:00
dirkf
bbf708ae3e [JSInterp] Make indexing error handling more conformant
* by default TypeError -> undefined, else raise
* set allow_undefined=True/False to override
2025-03-07 23:09:53 +00:00
dirkf
b524ea38b0 [JSInterp] Handle undefined, etc, passed to JS_RegExp and Exception 2025-03-07 23:09:53 +00:00
dirkf
d7c2708ec5 [JSInterp] Improve Date processing
* add JS_Date class implementing JS Date
* support constructor args other than date string
* support static methods of Date
* Date objects are still automatically coerced to timestamp before using in JS.
2025-03-07 23:09:53 +00:00
dirkf
f4c7afe462 [compat] Fix inheriting from compat_collections_chain_map
* see ytdl-org/youtube-dl#33079#issuecomment-2704038049
2025-03-07 23:09:53 +00:00
dirkf
44456865d3 [compat] Support zstd Content-Encoding
* see RFC 8878 7.2
2025-03-07 23:09:51 +00:00
dirkf
2d3479f0f7 [compat] Clean-up
* make workaround_optparse_bug9161 private
* add comments
* avoid leaving test objects behind
2025-03-07 23:09:05 +00:00
dirkf
c6f27dd88e [YouTube] Extract playlist items from LOCKUP_VIEW_MODEL_...
* resolves #33073
* thx seproDev (yt-dlp/yt-dlp#11615)

Co-authored-by: sepro <sepro@sepr0.com>
2025-02-27 23:14:36 +00:00
dirkf
8ba28b7610 [JSInterp] Fix bit-shift coercion for player 9c6dfc4a 2025-02-06 21:09:00 +00:00
dirkf
c866c8384b [compat] Make casefold private
* if required, not supported:
`from youtube_dl.casefold import _casefold as casefold`
2025-02-03 18:10:15 +00:00

View File

@ -501,6 +501,7 @@ class TestJSInterpreter(unittest.TestCase):
self._test('function f(){return 0.0 << NaN}', 0) self._test('function f(){return 0.0 << NaN}', 0)
self._test('function f(){return null << undefined}', 0) self._test('function f(){return null << undefined}', 0)
def test_negative(self): def test_negative(self):
self._test('function f(){return 2 * -2.0 ;}', -4) self._test('function f(){return 2 * -2.0 ;}', -4)
self._test('function f(){return 2 - - -2 ;}', 0) self._test('function f(){return 2 - - -2 ;}', 0)