Compare commits

...

2 Commits

Author SHA1 Message Date
sepro
83a8cfdc6c
Update yt_dlp/extractor/shemaroome.py
Co-authored-by: bashonly <88596187+bashonly@users.noreply.github.com>
2024-11-17 00:13:37 +01:00
sepro
0cbcb23fe6 Simplify byte conversion
Co-Authored-By: Simon Sawicki <contact@grub4k.xyz>
2024-11-17 00:07:14 +01:00
2 changed files with 2 additions and 3 deletions

View File

@ -6,7 +6,6 @@ import hmac
import io
import json
import re
import struct
import time
import urllib.parse
import uuid
@ -70,7 +69,7 @@ class AbemaLicenseRH(RequestHandler):
})
res = decode_base_n(license_response['k'], table=self._STRTABLE)
encvideokey = list(struct.pack('>QQ', res >> 64, res & 0xffffffffffffffff))
encvideokey = list(res.to_bytes(16, 'big'))
h = hmac.new(
binascii.unhexlify(self._HKEY),

View File

@ -68,7 +68,7 @@ class ShemarooMeIE(InfoExtractor):
raise ExtractorError('Premium videos cannot be downloaded yet.', expected=True)
url_data = base64.b64decode(data_json['new_play_url'])
key = base64.b64decode(data_json['key'])
iv = bytes([0] * 16)
iv = bytes(16)
m3u8_url = unpad_pkcs7(aes_cbc_decrypt_bytes(url_data, key, iv)).decode('ascii')
headers = {'stream_key': data_json['stream_key']}
formats, m3u8_subs = self._extract_m3u8_formats_and_subtitles(m3u8_url, video_id, fatal=False, headers=headers)