]> jfr.im git - yt-dlp.git/commitdiff
[jsinterp] Fix splice to handle float
authorpukkandan <redacted>
Tue, 23 Nov 2021 15:03:55 +0000 (20:33 +0530)
committerpukkandan <redacted>
Tue, 23 Nov 2021 15:04:34 +0000 (20:34 +0530)
Needed for new youtube js player f1ca6900
Closes #1767

test/test_youtube_signature.py
yt_dlp/jsinterp.py

index df4c36047337bcb2faf2accfb92f923deaddd42a..3359ac457bccd94bf26a966a55ce6b9e760bd072 100644 (file)
         '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',
+    ),
 ]
 
 
index bb2a0ae0b9f8902d2546c461f94cae5e491f3088..a6084ab821c50adecfd5622540b7355a2b919977 100644 (file)
@@ -397,7 +397,7 @@ def eval_method():
                 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:]