Commit Graph

41 Commits (master)

Author SHA1 Message Date
dirkf a25e9f3c84 [compat] Use `compat_open()` 10 months 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
11 months 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
11 months 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
11 months ago
dirkf d89c2137ba [jsinterp] Small updates for a85a875
* update signature tests
* clarify NaN handling
12 months ago
pukkandan 3e92c60fcd [jsinterp] Handle `Date` at epoch 0
See yt-dlp/yt_dlp#6400
1 year ago
pukkandan 14ef89a8da Support `if` statements
Fix for yt-dlp/yt_dlp#6131
Closes #31509
1 year 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
2 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
2 years ago
dirkf d619dd712f [jsinterp] Fix bug in operator precedence
* from 164b03c486
* added tests
2 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
2 years ago
dirkf 538ec65ba7
[jsinterp] Handle regexp literals and throw/catch execution (#31182)
* based on f6ca640b12, thanks pukkandan
* adds parse support for regexp flags
2 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.
2 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
2 years ago
dirkf 1e677567cd
[YouTube] Fix n-sig for player e06dea74 (#30582)
From yt-dl commit 48416bc
2 years ago
dirkf 9d142109f4 Back-port test_youtube_signature.py from yt-dlp and fix JSInterp accordingly 2 years ago
Remita Amine 99c68db0a8 [youtube] add support phone/tablet JS player(closes #26424) 3 years ago
Remita Amine b46483a6ec [youtube/test_youtube_signature] fix test 3 years ago
Sergey M․ e40c758c2a
[youtube] Improve player id extraction and add tests 4 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
8 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.
9 years ago
Philipp Hagemeister 6a78740211 [test/test_youtube_signature] Use fake YDL 9 years ago
Michael Käufl 498942f187 [test_youtube_signature] Fix import
Broken in commit 8c25f81bee
10 years ago
Philipp Hagemeister 6be451f422 [youtube] Remove swf signature test cases
These files are now 0 Bytes
10 years ago
Philipp Hagemeister 4bc7009e8a [jsinterp] Add new testcase 10 years ago
Philipp Hagemeister 42f4dcfe41 [test_youtube_signatures] Modernize 10 years ago
Jaime Marquínez Ferrándiz ebe832dc37 [jsinterp] 'reverse' modifies the array in place (fixes #3334) 10 years ago
Philipp Hagemeister 9f43890bcd [jsinterp] Allow digits in function names 10 years ago
Philipp Hagemeister b6ea11b967 [youtube] Add swf signature test case (#3270) 10 years ago
Philipp Hagemeister 7fd48d0413 [youtube] Correct signature testcase 10 years ago
Philipp Hagemeister 5425626790 [youtube] Move swfinterp into its own file 10 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.
10 years ago
Philipp Hagemeister f64ebfe3e5 [youtube] Correct signature test 10 years ago
Philipp Hagemeister 6f9d4d542f [youtube] Add test for new signature scheme (#3232) 10 years ago
Jaime Marquínez Ferrándiz bc4850908c [test/youtube_signature] Add a test with the last player
To verify it correctly handles function with “$” in their names.
10 years ago
Philipp Hagemeister 8307aa73fb Remove youtube swf signature test
Apparently, swf players are no longer in use. If we find one, we'll readd it.
10 years ago
Philipp Hagemeister d0efb9ec9a [tests] Remove global_setup function 11 years ago
Philipp Hagemeister 44a5f1718a Simplify tests
* Make them directly executable again
* Move common stuff (md5, parameters) to helper
* Never import *
* General clean up
11 years ago
Philipp Hagemeister 45f4a76dbc Work around nosetests nosiness 11 years ago
Philipp Hagemeister 95dbd2f990 Change test target (Verified with node.js) 11 years ago
Philipp Hagemeister e0df6211cc Restore accidentally deleted commits
That's what happens if you let Windows machines write :(
11 years ago