wbt5 / real-url

获取斗鱼&虎牙&哔哩哔哩&抖音&快手等 58 个直播平台的真实流媒体地址(直播源)和弹幕,直播源可在 PotPlayer、flv.js 等播放器中播放。
GNU General Public License v2.0
7.31k stars 1.53k forks source link

huya的失效了,大佬能看看不 #177

Open wtf0404 opened 3 years ago

wtf0404 commented 3 years ago

huya 的失效了,播放地址返回403

wbt5 commented 3 years ago

待调试

wtf0404 commented 3 years ago

待调试

好的,谢谢老哥,老哥辛苦了

zqs125 commented 3 years ago

huya我试了是正常的

wtf0404 commented 3 years ago

huya我试了是正常的

一起看这个分类破解出来的地址返回403,其他分类是正常的哈

zqs125 commented 3 years ago

试了下,确实是一起看返回403,等@wbt5修复吧,不过我自用的已经修复了,可以发你

dingzhengjie commented 3 years ago

试了下,确实是一起看返回403,等@wbt5修复吧,不过我自用的已经修复了,可以发你

老哥贴一下代码,谢谢

rain-dl commented 3 years ago
def live(e):
    i, b = e.split('?')
    r = i.split('/')
    s = re.sub(r'.(flv|m3u8)', '', r[-1])
    c = b.split('&')
    c = [i for i in c if i != '']
    n = {i.split('=')[0]: i.split('=')[1] for i in c}
    fm = urllib.parse.unquote(n['fm'])
    u = base64.b64decode(fm).decode('utf-8')
    p = u.split('_')[0]
    f = str(int(time.time() * 1e7))
    ctype = n['ctype']
    t = n['t']
    mf = hashlib.md5((f + '|' + ctype + '|' + t).encode('utf-8')).hexdigest()
    ll = n['wsTime']
    uid = '0'
    h = '_'.join([p, uid, s, mf, ll])
    m = hashlib.md5(h.encode('utf-8')).hexdigest()
    url = "{}?wsSecret={}&wsTime={}&uid={}&seqid={}&ctype={}&ver=1&t={}".format(i, m, ll, uid, f, ctype, t)
    return url
wtf0404 commented 3 years ago
def live(e):
    i, b = e.split('?')
    r = i.split('/')
    s = re.sub(r'.(flv|m3u8)', '', r[-1])
    c = b.split('&')
    c = [i for i in c if i != '']
    n = {i.split('=')[0]: i.split('=')[1] for i in c}
    fm = urllib.parse.unquote(n['fm'])
    u = base64.b64decode(fm).decode('utf-8')
    p = u.split('_')[0]
    f = str(int(time.time() * 1e7))
    ctype = n['ctype']
    t = n['t']
    mf = hashlib.md5((f + '|' + ctype + '|' + t).encode('utf-8')).hexdigest()
    ll = n['wsTime']
    uid = '0'
    h = '_'.join([p, uid, s, mf, ll])
    m = hashlib.md5(h.encode('utf-8')).hexdigest()
    url = "{}?wsSecret={}&wsTime={}&uid={}&seqid={}&ctype={}&ver=1&t={}".format(i, m, ll, uid, f, ctype, t)
    return url

谢谢老哥。试了可行