mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-02-07 04:50:08 +01:00
Fix ruff checks
This commit is contained in:
parent
68c034ba81
commit
3b0a867b77
|
@ -1344,14 +1344,14 @@ def _generate_token(self, tweet_id: str) -> str:
|
|||
# Convert to base 36
|
||||
base_36 = ''
|
||||
while result >= 1:
|
||||
base_36 = "0123456789abcdefghijklmnopqrstuvwxyz"[int(result % 36)] + base_36
|
||||
base_36 = '0123456789abcdefghijklmnopqrstuvwxyz'[int(result % 36)] + base_36
|
||||
result = math.floor(result / 36)
|
||||
|
||||
# Append fractional part in base 36
|
||||
while fractional_part > 0 and len(base_36) < 11: # Limit to avoid infinite loop
|
||||
fractional_part *= 36
|
||||
digit = int(fractional_part)
|
||||
base_36 += "0123456789abcdefghijklmnopqrstuvwxyz"[digit]
|
||||
base_36 += '0123456789abcdefghijklmnopqrstuvwxyz'[digit]
|
||||
fractional_part -= digit
|
||||
|
||||
# Remove leading zeros and dots
|
||||
|
|
Loading…
Reference in New Issue
Block a user