Commit Graph

58 Commits (c052a16f72af7dd7671d4dd62826de71cd99dfb6)

Author SHA1 Message Date
dirkf c052a16f72 [JSInterp] Add tests and relevant functionality from yt-dlp
* thx seproDev, bashonly: yt-dlp/yt-dlp#12760, yt-dlp/yt-dlp#12761:
  - Improve nested attribute support
  - Pass global stack when extracting objects
  - interpret_statement: Match attribute before indexing
  - Fix assignment to array elements with nested brackets
  - Add new signature tests
  - Invalidate JS function cache
  - Avoid testdata dupes now that we cache by URL

* rework nsig function name search
* fully fixes #33102
* update cache required versions
* update program version
2 months ago
dirkf 2b4fbfce25 [YouTube] Support player `4fcd6e4a`
thx seproDev, bashonly: yt-dlp/yt-dlp#12748
2 months ago
dirkf b982d77d0b [YouTube] Align signature tests with yt-dlp
thx bashonly, yt-dlp/yt-dlp#12725
2 months ago
dirkf 087d865230 [YouTube] Support new player URL patterns 2 months ago
dirkf a464c159e6 [YouTube] Make `_extract_player_info()` use `_search_regex()` 2 months ago
dirkf da7223d4aa [YouTube] Improve support for tce-style player JS
* improve extraction of global "useful data" Array from player JS
* also handle tv-player and add tests: thx seproDev (yt-dlp/yt-dlp#12684)

Co-Authored-By: sepro <sepro@sepr0.com>
2 months ago
dirkf 283dca56fe [YouTube] Initially support tce-style player JS
* resolves #33079
3 months ago
dirkf 711e72c292 [JSInterp] Fix bit-shift coercion for player 9c6dfc4a 4 months ago
dirkf eeafbbc3e5 [YouTube] Fix signature function extraction for `2f1832d2`
* `_` was omitted from patterns
* thx yt-dlp/yt-dlp#11801

Co-authored-by: bashonly
6 months ago
dirkf cd7c7b5edb [YouTube] Simplify pattern for nsig function name extraction 6 months ago
dirkf eed784e15f [YouTube] Pass nsig value as return hook, fixes player `3bb1f723` 6 months ago
dirkf b4469a0f65 [YouTube] Handle player `3bb1f723`
* fix signature code extraction
* raise if n function returns input value
* add new tests from yt-dlp

Co-authored-by: bashonly
6 months ago
dirkf dbc08fba83 [jsinterp] Improve slice implementation for player b12cc44b
Partly taken from yt-dlp/yt-dlp#10664, thx seproDev
        Fixes #32896
10 months ago
Aiur Adept 71223bff39
[Youtube] Fix nsig extraction for player 20dfca59 (#32891)
* dirkf's patch for nsig extraction
* add generic search per  yt-dlp/yt-dlp/pull/10611 - thx bashonly

---------

Co-authored-by: dirkf <fieldhouse@gmx.net>
10 months ago
dirkf e1b3fa242c [Youtube] Find `n` function name in player `3400486c`
Fixes #32877
10 months ago
dirkf 16f5bbc464 [YouTube] Fix nsig processing for player `b22ef6e7`
* improve extraction of function name (like yt-dlp/yt-dlp#10390)
* always use JSInterp to extract function code (yt-dlp/yt-dlp#10396, thx seproDev, pukkandan)
11 months ago
dirkf ad01fa6cca [jsinterp] Add Debugger from yt-dlp
* https://github.com/yt-dlp/yt-dlp/commit/8f53dc4
* thx pukkandan
12 months ago
dirkf a25e9f3c84 [compat] Use `compat_open()` 2 years ago
pukkandan 9112e668a5 [YouTube] Improve nsig function name extraction
Fixes player b7910ca8, using `,` vs `;`
See https://github.com/ytdl-org/youtube-dl/issues/32292#issuecomment-1602231170

Co-authored-by: dirkf
2 years ago
dirkf ae8ba2c319 [YouTube] Fix `KeyError QV` in signature extraction failed
* temporarily force missing global definition into sig JS
* improve test: thanks https://github.com/yt-dlp/yt-dlp/issues/7327#issuecomment-1595274615
* resolves #32314
2 years ago
dirkf a2534f7b88 [jsinterp] Fix div bug breaking player 8c7583ff
Thx bashonly: https://github.com/ytdl-org/youtube-dl/issues/32292#issuecomment-1585639223
Fixes #32292
2 years ago
dirkf d89c2137ba [jsinterp] Small updates for a85a875
* update signature tests
* clarify NaN handling
2 years ago
pukkandan 3e92c60fcd [jsinterp] Handle `Date` at epoch 0
See yt-dlp/yt_dlp#6400
2 years ago
pukkandan 14ef89a8da Support `if` statements
Fix for yt-dlp/yt_dlp#6131
Closes #31509
2 years ago
pukkandan 7009bb9f31 [jsinterp] Workaround operator associativity issue
* temporary fix for player 5a3b6271 [1]

1. https://github.com/yt-dlp/yt-dlp/issues/4635#issuecomment-1235384480
3 years ago
dirkf 55c823634d [jsinterp] Handle new YT players 113ca41c, c57c113c
* add NaN
* allow any white-space character for `after_op`
* align with yt-dlp f26af78a8ac11d9d617ed31ea5282cfaa5bcbcfa (charcodeAt and bitwise overflow)
* allow escaping in regex, fixing player c57c113c
3 years ago
dirkf d619dd712f [jsinterp] Fix bug in operator precedence
* from 164b03c486
* added tests
3 years ago
dirkf 46b8ae2f52 [jsinterp] Clean up and pull yt-dlp style
* add compat_re_Pattern
* improve compat_collections_chain_map
* use class JS_Undefined
* remove unused code
3 years ago
dirkf 538ec65ba7
[jsinterp] Handle regexp literals and throw/catch execution (#31182)
* based on f6ca640b12, thanks pukkandan
* adds parse support for regexp flags
3 years ago
dirkf b0a60ce203
[jsinterp] Improve JS language support (#31175)
* operator ??
* operator ?.
* operator **
* accurate operator functions
* `undefined` handling
* object literals {a: 1, "b": expr}
* more tests for weird JS comparisons: see https://github.com/ytdl-org/youtube-dl/issues/31173#issuecomment-1217854397.
3 years ago
dirkf d231b56717
[jsinterp] Overhaul JSInterp to handle new YT players 4c3f79c5, 324f67b9 (#31170)
* back-port from yt-dlp 8f53dc44a0cc1c2d98c35740b9293462c080f5d0, thanks pukkandan
* also support void, improve <</>> precedence, improve expressions in comma-list
* add more tests
3 years ago
dirkf 1e677567cd
[YouTube] Fix n-sig for player e06dea74 (#30582)
From yt-dl commit 48416bc
3 years ago
dirkf 9d142109f4 Back-port test_youtube_signature.py from yt-dlp and fix JSInterp accordingly 3 years ago
Remita Amine 99c68db0a8 [youtube] add support phone/tablet JS player(closes #26424) 4 years ago
Remita Amine b46483a6ec [youtube/test_youtube_signature] fix test 4 years ago
Sergey M․ e40c758c2a
[youtube] Improve player id extraction and add tests 5 years ago
Yen Chi Hsuan 582be35847
Update coding style after pycodestyle 2.1.0
In pycodestyle 2.1.0, E305 was introduced, which requires two blank
lines after top level declarations, too.

See https://github.com/PyCQA/pycodestyle/issues/400

See also #10689; thanks @stepshal for first mentioning this issue and
initial patches
9 years ago
Philipp Hagemeister 3eff81fbf7 [jsinterp] Disable comment support
We need a proper lexer to be able to understand YouTube's code, which contains /* inside of strings.
For now it's sufficient to just disable comment support altogether.

Fixes #4976, fixes #4979, fixes #4980, fixes #4981, fixes #4982.
Closes #4977.
10 years ago
Philipp Hagemeister 6a78740211 [test/test_youtube_signature] Use fake YDL 10 years ago
Michael Käufl 498942f187 [test_youtube_signature] Fix import
Broken in commit 8c25f81bee
11 years ago
Philipp Hagemeister 6be451f422 [youtube] Remove swf signature test cases
These files are now 0 Bytes
11 years ago
Philipp Hagemeister 4bc7009e8a [jsinterp] Add new testcase 11 years ago
Philipp Hagemeister 42f4dcfe41 [test_youtube_signatures] Modernize 11 years ago
Jaime Marquínez Ferrándiz ebe832dc37 [jsinterp] 'reverse' modifies the array in place (fixes #3334) 11 years ago
Philipp Hagemeister 9f43890bcd [jsinterp] Allow digits in function names 11 years ago
Philipp Hagemeister b6ea11b967 [youtube] Add swf signature test case (#3270) 11 years ago
Philipp Hagemeister 7fd48d0413 [youtube] Correct signature testcase 11 years ago
Philipp Hagemeister 5425626790 [youtube] Move swfinterp into its own file 11 years ago
Jaime Marquínez Ferrándiz ad25aee245 [youtube & jsinterp] Fix signature extraction (fixes #3255)
Some functions are defined now inside an object, the jsinterp will search its definition if the variable is not defined in the local namespace.
11 years ago
Philipp Hagemeister f64ebfe3e5 [youtube] Correct signature test 11 years ago