1
1
mirror of https://github.com/ytdl-org/youtube-dl synced 2024-11-24 00:36:52 +01:00

[le] Move urshift() to utils.py

This commit is contained in:
Yen Chi Hsuan 2016-06-26 15:17:26 +08:00
parent 1143535d76
commit 30105f4ac0
No known key found for this signature in database
GPG Key ID: 3FDDD575826C5C30

View File

@ -23,6 +23,7 @@ from ..utils import (
sanitized_Request,
str_or_none,
url_basename,
urshift,
)
@ -74,15 +75,11 @@ class LeIE(InfoExtractor):
'only_matching': True,
}]
@staticmethod
def urshift(val, n):
return val >> n if val >= 0 else (val + 0x100000000) >> n
# ror() and calc_time_key() are reversed from a embedded swf file in KLetvPlayer.swf
def ror(self, param1, param2):
_loc3_ = 0
while _loc3_ < param2:
param1 = self.urshift(param1, 1) + ((param1 & 1) << 31)
param1 = urshift(param1, 1) + ((param1 & 1) << 31)
_loc3_ += 1
return param1