Commit Graph

1106 Commits (6c40d9f8472b5e98ca3a3880cfce01a8403f3a9f)

Author SHA1 Message Date
dirkf cedeeed56f [cache] Align further with yt-dlp
* use compat_os_makedirs
* support non-ASCII characters in cache key
* improve logging
2 weeks ago
dirkf 2b4fbfce25 [YouTube] Support player `4fcd6e4a`
thx seproDev, bashonly: yt-dlp/yt-dlp#12748
4 weeks ago
dirkf b982d77d0b [YouTube] Align signature tests with yt-dlp
thx bashonly, yt-dlp/yt-dlp#12725
4 weeks ago
dirkf 087d865230 [YouTube] Support new player URL patterns 4 weeks ago
dirkf a464c159e6 [YouTube] Make `_extract_player_info()` use `_search_regex()` 4 weeks 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>
1 month ago
dirkf 420d53387c [JSInterp] Improve tests
* from yt-dlp/yt-dlp#12313
* also fix d7c2708
1 month ago
dirkf 283dca56fe [YouTube] Initially support tce-style player JS
* resolves #33079
1 month ago
dirkf 94849bc997 [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.
1 month ago
dirkf 711e72c292 [JSInterp] Fix bit-shift coercion for player 9c6dfc4a 3 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
4 months ago
dirkf cd7c7b5edb [YouTube] Simplify pattern for nsig function name extraction 4 months ago
dirkf eed784e15f [YouTube] Pass nsig value as return hook, fixes player `3bb1f723` 4 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
4 months ago
dirkf f487b4a02a [jsinterp] Strip /* comments */ when parsing
* NB: _separate() is looking creaky
4 months ago
dirkf 60835ca16c [jsinterp] Fix and improve "methods"
* push, unshift return new length
* impove edge cases for push/pop, shift/unshift, forEach, indexOf, charCodeAt
* increase test coverage
4 months ago
dirkf 94fd774608 [jsinterp] Fix and improve split/join
* improve split/join edge cases
* correctly implement regex split (not like re.split)
4 months ago
dirkf 5dee6213ed [jsinterp] Fix and improve arithmetic operations
* addition becomes concat with a string operand
* improve handling of edgier cases
* arithmetic in float like JS (more places need cast to int?)
* increase test coverage
4 months ago
dirkf 81e64cacf2 [jsinterp] Support multiple indexing (eg a[1][2])
* extend single indexing with improved RE (should probably use/have used _separate_at_paren())
* fix some cases that should have given undefined, not throwing
* standardise RE group names
* support length of objects, like {1: 2, 3: 4, length: 42}
4 months ago
dirkf c1a03b1ac3 [jsinterp] Fix and improve loose and strict equality operations
* reimplement loose equality according to MDN (eg, 1 == "1")
* improve strict equality (eg, "abc" === "abc" but 'abc' is not 'abc')
* add tests for above
4 months ago
dirkf 118c6d7a17 [jsinterp] Implement `typeof` operator 4 months ago
dirkf dbc08fba83 [jsinterp] Improve slice implementation for player b12cc44b
Partly taken from yt-dlp/yt-dlp#10664, thx seproDev
        Fixes #32896
9 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>
9 months ago
dirkf e1b3fa242c [Youtube] Find `n` function name in player `3400486c`
Fixes #32877
9 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)
10 months ago
dirkf d35ce6ce95 [jsinterp] Support functionality for player `b22ef6e7`
* support `prototype` for call() and apply() (yt-dlp/yt-dlp#10392, thx Grub4k)
* map JS `Array` to `list`
10 months ago
dirkf 756f6b45c7 [jsinterp] Re-align JSInterp and tests (esp.) with yt-dlp
Thx: various yt-dlp authors
10 months ago
dirkf 4652109643 [core,utils] Implement unsafe file extension mitigation
* from https://github.com/yt-dlp/yt-dlp/security/advisories/GHSA-79w7-vh3h-8g4, thx grub4k
10 months ago
dirkf ad01fa6cca [jsinterp] Add Debugger from yt-dlp
* https://github.com/yt-dlp/yt-dlp/commit/8f53dc4
* thx pukkandan
10 months ago
dirkf 3bde6a5752 [test] Improve download test
* skip reason can't be unicode in Py2
* remove duplicate assert...Equal functions
11 months ago
dirkf 21924742f7 [InfoExtractor] Misc yt-dlp back-ports, etc
* add _yes_playlist() method
* avoid crash using _NETRC_MACHINE
* use _search_json() in _search_nextjs_data()
* _search_nextjs_data() default is JSON, not text
* test for above
11 months ago
dirkf eee9a247eb [utils] Split out traversal.py dummy and traversal tests 11 months ago
dirkf 06da64ee51 [utils] Update traverse_obj() from yt-dlp
* remove `is_user_input` option per https://github.com/yt-dlp/yt-dlp/pull/8673
* support traversal of compat_xml_etree_ElementTree_Element per https://github.com/yt-dlp/yt-dlp/pull/8911
* allow un/branching using all and any per https://github.com/yt-dlp/yt-dlp/pull/9571
* support traversal of compat_cookies.Morsel and multiple types in `set()` keys per https://github.com/yt-dlp/yt-dlp/pull/9577
thx Grub4k for these
* also, move traversal tests to a separate class
* allow for unordered dicts in tests for Py<3.7
11 months ago
dirkf c2766cb80e [test/test_download] Support 'playlist_maxcount:count' expected value
* parallel to `playlist_mincount'
* specify both for a range of playlist lengths
* if max < min the test will always fail!
1 year ago
dirkf 21792b88b7 [external/FFmpeg] Fix and improve --ffmpeg-location handling
* pass YoutubeDL (FileDownloader) to FFmpegPostProcessor constructor
* consolidate path search in FFmpegPostProcessor
* make availability of FFmpegFD depend on existence of FFmpegPostProcessor
* detect ffmpeg executable on instantiation of FFmpegFD
* resolves #32735
1 year ago
dirkf acc383b9e3 [utils] Let int_or_none() accept a base, like int() 1 year ago
Hubert Hirtz f0812d7848
[utils] Handle user:pass in URLs (#28801)
* Handle user:pass in URLs

Fixes "nonnumeric port" errors when youtube-dl is given URLs with
usernames and passwords such as:

    http://username:password@example.com/myvideo.mp4

Refs:
- https://en.wikipedia.org/wiki/Basic_access_authentication
- https://tools.ietf.org/html/rfc1738#section-3.1
- https://docs.python.org/3.8/library/urllib.parse.html#urllib.parse.urlsplit

Fixes #18276 (point 4)
Fixes #20258
Fixes #26211 (see comment)

* Align code with yt-dlp

---------

Co-authored-by: dirkf <fieldhouse@gmx.net>
1 year ago
dirkf 4eaeb9b2c6 [InfoExtractor] Support byte range for DASH
* adapted from https://github.com/ytdl-org/youtube-dl/pull/30279
* thx former GH user kikuyan
1 year ago
dirkf c58b655a9e [InfoExtractor] Support DASH subtitle extraction (yt-dlp back-port) 1 year ago
dirkf dc512e3a8a [YouTube] Fix `like_count` extraction using `likeButtonViewModel`
* also fix various tests
* TODO: check against yt-dlp tests
1 year ago
dirkf 6651871416 [compat] Rework compat for `method` parameter of `compat_urllib_request.Request` constructor
* fixes #32573
* does not break `utils.HEADrequest` (eg)
1 year ago
dirkf 66ab0814c4 [utils] Revert bbd3e7e, updating docstring, test instead 2 years ago
dirkf 21caaf2380 [test] Remove redundancy from lambda expected value regex 2 years ago
dirkf abef53466d [utils] Rework URL path munging for ., .. components
* move processing to YoutubeDLHandler
* also process `Location` header for redirect
* use tests from https://github.com/yt-dlp/yt-dlp/pull/7662
2 years ago
dirkf e7926ae9f4 [utils] Rework decoding of `Content-Encoding`s
* support nested encodings
* support optional `br` encoding, if brotli package is installed
* support optional 'compress' encoding, if ncompress package is installed
* response `Content-Encoding` has only unprocessed encodings, or removed
* response `Content-Length` is decoded length (usable for filesize metadata)
* use zlib for both deflate and gzip decompression
* some elements taken from yt-dlp: thx especially coletdjnz
2 years ago
dirkf a25e9f3c84 [compat] Use `compat_open()` 2 years ago
dirkf aac33155e4 [build] Add and use `devscripts/utils` 2 years ago
dirkf 2b7dd3b2a2 [utils] Fix update_Request() with empty data (not None) 2 years ago
dirkf 44faa71b19 [test/test_execution.py] Use `compat_subprocess_get_DEVNULL()` 2 years ago
dirkf 7bce2ad441 [build] Fix various Jython CI and test issues 2 years ago