接口平台

https://jx.playerjy.com/?url=
https://jiekou.xiaobaikejiwang.top/?url=

视频教程(已被投诉下架)

https://www.bilibili.com/video/BV1MZ4y1q7Ho/

演示结果

python代码 2022/7/13更新

import requests,re,base64,json,urllib3,time
from Crypto.Cipher import AES
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)

def aesCbcDecode(content,key, iv,pkcs=5):
    try:
        key_bytes = bytes(key, encoding='utf-8')
        iv = bytes(iv, encoding='utf-8')
        cipher = AES.new(key_bytes, AES.MODE_CBC, iv)
        aes_encode_bytes = base64.b64decode(content)
        aes_decode_bytes = cipher.decrypt(aes_encode_bytes)
        result = str(aes_decode_bytes, encoding='utf-8')
        if pkcs==7:
            result = pkcs7unpadding(result)
    except:
        pass
    else:
        return result

def pkcs7unpadding(text):
    try:
        length = len(text)
        unpadding = ord(text[length - 1])
        return text[0:length - unpadding]
    except Exception as e:
        pass

def deKeyCode(enstr):
    rstr=''
    for i in enstr:
        rstr+=chr(ord(i)-1)
    return str(base64.b64decode(rstr.encode("utf-8")), "utf-8")

def getPlayUrl(url,jkurl):
    r=requests.Session()
    purl=f'{jkurl}/?url={url}'
    html=r.get(purl,verify=False).text
    htm=html.replace('\t','').replace('\r','').replace('\n','').replace(' ','')
    vkey=re.search("varvkey='(.*?)';",htm).group(1)
    authorization=re.search("varauthorization='(.*?)';",htm).group(1)
    print(f'vkey: {vkey}')
    print(f'authorization: {authorization}')

    va = deKeyCode(authorization)
    nkey = json.loads(aesCbcDecode(va, 'd4375381b6e68c1e', '16b711c80da1bb7b', 7))['key']
    urlDeKey = nkey[16:]
    urlDeIv = nkey[0:16]
    print(f'urlDeKey: {urlDeKey} , urlDeIv: {urlDeIv}')

    vkey=deKeyCode(vkey)
    print(f'Postvkey: {vkey}')
    pdat={
        'type':'parse',
        'vkey':vkey
    }

    headers={
        "Referer":purl,
    }
    ###这里现在需要添加referer headers
    htm=r.post(f'{jkurl}/api.php',data=pdat,headers=headers,verify=False)
    print(htm.text)
    rvkey=htm.json()['vkey']
    print(f'Response vkey: {rvkey}')

    rjson=aesCbcDecode(rvkey,urlDeKey,urlDeIv,7)
    url=json.loads(rjson)['url']
    url=f'{jkurl}/{url}'
    resp=requests.get(url, allow_redirects=False,verify=False)
    m3u8= resp.headers['Location']
    if(m3u8[0:3].lower()!='http'):
        m3u8=jkurl+'/'+m3u8
    print(m3u8)
    fname=str(int(time.time()))
    resp=requests.get(m3u8,verify=False)
    with open(f'./{fname}.m3u8','wb') as F:
        F.write(resp.content)
    print(f'{fname}.m3u8 下载完成.')

if __name__ == '__main__':
    url='https://v.qq.com/x/cover/mzc00200xahwmw1/t00433addjz.html'
    getPlayUrl(url,'https://jx.playerjy.com') #平台1
    getPlayUrl(url, 'https://jiekou.xiaobaikejiwang.top') #平台2

本站所有资源版权均属于原作者所有,这里所提供资源均只能用于参考学习使用,请在下载后24小时内删除,严禁商用。若由于商用引起版权纠纷,一切责任均由使用者承担。 【注意:本站发布资源来源于网络搜集,均有较强时效性,请在下载前注意查看文章资源发布或更新时间,距离当前时间太久的资源不建议下载,特别是安卓专区相关资源,会有大概率失效无法使用】