diff options
author | pukkandan <pukkandan.ytdlp@gmail.com> | 2021-11-23 20:33:55 +0530 |
---|---|---|
committer | pukkandan <pukkandan.ytdlp@gmail.com> | 2021-11-23 20:34:34 +0530 |
commit | 57dbe8077f8d00e0fffac53669f40cd7d584474f (patch) | |
tree | 1b893c3a7e301e4b33ac5f40add4c45c3fd73179 | |
parent | e5d731f35dce2e0eb82d7877d6e1001d5e18ced9 (diff) | |
download | hypervideo-pre-57dbe8077f8d00e0fffac53669f40cd7d584474f.tar.lz hypervideo-pre-57dbe8077f8d00e0fffac53669f40cd7d584474f.tar.xz hypervideo-pre-57dbe8077f8d00e0fffac53669f40cd7d584474f.zip |
[jsinterp] Fix splice to handle float
Needed for new youtube js player f1ca6900
Closes #1767
-rw-r--r-- | test/test_youtube_signature.py | 4 | ||||
-rw-r--r-- | yt_dlp/jsinterp.py | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/test/test_youtube_signature.py b/test/test_youtube_signature.py index df4c36047..3359ac457 100644 --- a/test/test_youtube_signature.py +++ b/test/test_youtube_signature.py @@ -78,6 +78,10 @@ _NSIG_TESTS = [ 'https://www.youtube.com/s/player/2dfe380c/player_ias.vflset/en_US/base.js', 'oBo2h5euWy6osrUt', '3DIBbn3qdQ', ), + ( + 'https://www.youtube.com/s/player/f1ca6900/player_ias.vflset/en_US/base.js', + 'cu3wyu6LQn2hse', 'jvxetvmlI9AN9Q', + ), ] diff --git a/yt_dlp/jsinterp.py b/yt_dlp/jsinterp.py index bb2a0ae0b..a6084ab82 100644 --- a/yt_dlp/jsinterp.py +++ b/yt_dlp/jsinterp.py @@ -397,7 +397,7 @@ class JSInterpreter(object): elif member == 'splice': assertion(isinstance(obj, list), 'must be applied on a list') assertion(argvals, 'takes one or more arguments') - index, howMany = (argvals + [len(obj)])[:2] + index, howMany = map(int, (argvals + [len(obj)])[:2]) if index < 0: index += len(obj) add_items = argvals[2:] |