import
requests
import
time
from
Crypto.Cipher
import
AES
from
hashlib
import
md5
from
base64
import
b64encode
from
urllib.parse
import
unquote, unquote_plus, quote, quote_plus
def
md5_hash(data):
hash_object
=
md5(data.encode(
'utf-8'
)).hexdigest()
return
hash_object.encode(
'utf-8'
)
def
aes_encrypt(data, key, iv):
cipher
=
AES.new(key, AES.MODE_CBC, iv)
encrypted_text
=
cipher.encrypt(data.encode())
return
b64encode(encrypted_text).decode(
'utf-8'
)
def
sign(data):
plaintext
=
md5(data.encode(
'utf-8'
)).hexdigest()
key
=
md5_hash(plaintext)
iv
=
b
'3cccf88181408f19'
encrypted
=
aes_encrypt(plaintext, key, iv)
return
encrypted
url
=
quote(
'https://v.qq.com/x/cover/mzc00200yxnj6nj/n41009m0vya.html'
, safe
=
'')
headers
=
{
'Host'
:
'122.228.8.29:4433'
,
'Origin'
:
'https://jx.xmflv.com'
,
'User-Agent'
:
'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101 Firefox/128.0'
,
}
tm
=
int
(
round
(time.time()
*
1000
))
payload
=
{
'wap'
:
1
,
'url'
: url,
'time'
: tm,
'key'
: sign(f
"{tm}{url}"
)
}
con_url
=
f
'https://122.228.8.29:4433/xmflv.js'
res
=
requests.post(con_url, headers
=
headers, data
=
payload)
print
(res.status_code)
print
(res.text)