Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 004a07f

Browse files
committedFeb 6, 2025·
[JSInterp] Fix bit-shift coercion for player 9c6dfc4a
1 parent c866c83 commit 004a07f

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed
 

‎test/test_jsinterp.py

+4
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,10 @@ def test_bitwise_operators_typecast(self):
459459
self._test('function f(){return undefined >> 5}', 0)
460460
self._test('function f(){return 42 << NaN}', 42)
461461
self._test('function f(){return 42 << Infinity}', 42)
462+
self._test('function f(){return 0.0 << null}', 0)
463+
self._test('function f(){return NaN << 42}', 0)
464+
self._test('function f(){return "21.9" << 1}', 42)
465+
self._test('function f(){return 21 << 4294967297}', 42)
462466

463467
def test_negative(self):
464468
self._test('function f(){return 2 * -2.0 ;}', -4)

‎test/test_youtube_signature.py

+4
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,10 @@
219219
'https://www.youtube.com/s/player/2f1832d2/player_ias.vflset/en_US/base.js',
220220
'YWt1qdbe8SAfkoPHW5d', 'RrRjWQOJmBiP',
221221
),
222+
(
223+
'https://www.youtube.com/s/player/9c6dfc4a/player_ias.vflset/en_US/base.js',
224+
'jbu7ylIosQHyJyJV', 'uwI0ESiynAmhNg',
225+
),
222226
]
223227

224228

‎youtube_dl/compat.py

+5
Original file line numberDiff line numberDiff line change
@@ -3116,17 +3116,21 @@ def compat_kwargs(kwargs):
31163116
compat_kwargs = lambda kwargs: kwargs
31173117

31183118

3119+
# compat_numeric_types
31193120
try:
31203121
compat_numeric_types = (int, float, long, complex)
31213122
except NameError: # Python 3
31223123
compat_numeric_types = (int, float, complex)
31233124

31243125

3126+
# compat_integer_types
31253127
try:
31263128
compat_integer_types = (int, long)
31273129
except NameError: # Python 3
31283130
compat_integer_types = (int, )
31293131

3132+
# compat_int
3133+
compat_int = compat_integer_types[-1]
31303134

31313135
if sys.version_info < (2, 7):
31323136
def compat_socket_create_connection(address, timeout, source_address=None):
@@ -3532,6 +3536,7 @@ def compat_datetime_timedelta_total_seconds(td):
35323536
'compat_http_client',
35333537
'compat_http_server',
35343538
'compat_input',
3539+
'compat_int',
35353540
'compat_integer_types',
35363541
'compat_itertools_count',
35373542
'compat_itertools_zip_longest',

0 commit comments

Comments
 (0)
Please sign in to comment.