LifeActor / ykdl

a video downloader focus on China mainland video sites.(一款专注于中国大陆视频网站的视频下载器。)
https://github.com/LifeActor/ykdl
Other
1.45k stars 285 forks source link

斗鱼主线路现在是hls #540

Closed steven7851 closed 3 years ago

steven7851 commented 3 years ago
site:                斗鱼直播 (DouyuTV)
title:               喵放送☀️喵呜~ - 喵放送
artist:              喵放送
streams:
    - format:        BD4M
      container:     flv
      video-profile: 蓝光4M
    # download-with: ykdl --format=BD4M [URL]
Now downloading: 2020-12-13-10-06-14-71771.flv
WARNING:wrap:
=================================
  stop downloading by press 'q'
=================================

[tls @ 0000000000479440] Creating security context failed (0x80090302)
https://hls3-akm.douyucdn.cn/live/71771r0CLh8PznCh/playlist.m3u8?wsAuth=cc15c0405bf5c98a6abca59ae4576b8d&token=web-h5-0-71771-b1682775e063195fb66e0b57836c09b8b51c980728603b3a&logo=0&expire=0&did=f9f2ab9f0544417e8e4205ee647d398f&pt=2&st=0&origin=tct&mix=0&isp=: Unknown error occurred
cherinyy commented 3 years ago

无法复现,走的是备用线路5

ykdl -i --debug https://www.douyu.com/71771
DEBUG:html:Add <urllib.request.ProxyHandler object at 0x000001D005718C70> to default handlers
DEBUG:common:video_host> www.douyu.com
DEBUG:common:short_name> douyu
DEBUG:html:get_content> URL: https://www.douyu.com/71771
DEBUG:html:get_content> Charset: UTF-8
DEBUG:斗鱼直播 (DouyuTV):ub98484234: {'yxdf056J': [], 'e6AxvEY2': 'v=220120201215&did=99352686151c41e08e577318fcffa4ce&tt=1607965319&sign=925bba89261b7588d619e57a801a37a9'}
DEBUG:html:get_content> URL: https://www.douyu.com/lapi/live/getH5Play/71771
DEBUG:html:get_content> Charset: utf-8
DEBUG:斗鱼直播 (DouyuTV):{"error":0,"msg":"ok","data":{"room_id":71771,"is_mixed":false,"mixed_live":"","mixed_url":"","rtmp_cdn":"tct-h5","rtmp_url":"https://tc-tct.douyucdn2.cn/dyliveflv3","rtmp_live":"71771r0CLh8PznCh.flv?wsAuth=ab997570bc6487d02d2379850dbf9229\u0026token=web-h5-0-71771-b1682775e063195f7ca1de5424a1ca525e8f4f4592b2c446\u0026logo=0\u0026expire=0\u0026did=99352686151c41e08e577318fcffa4ce\u0026pt=2\u0026st=0\u0026origin=tct\u0026mix=0\u0026isp=","client_ip":"183.24.58.39","inNA":0,"rateSwitch":1,"rate":0,"cdnsWithName":[{"name":"备用线路5","cdn":"tct-h5"}],"multirates":[{"name":"蓝光4M","rate":0,"highBit":1,"bit":4000},{"name":"高清","rate":2,"highBit":0,"bit":1200}],"isPassPlayer":0,"eticket":null,"online":0,"mixedCDN":"","p2p":2,"streamStatus":1,"smt":0,"p2pMeta":null,"p2pCid":0,"p2pCids":"","player_1":"","h265_p2p":0,"h265_p2p_cid":0,"h265_p2p_cids":""}}

DEBUG:html:get_content> URL: https://www.douyu.com/lapi/live/getH5Play/71771
DEBUG:html:get_content> Charset: utf-8
DEBUG:斗鱼直播 (DouyuTV):{"error":0,"msg":"ok","data":{"room_id":71771,"is_mixed":false,"mixed_live":"","mixed_url":"","rtmp_cdn":"tct-h5","rtmp_url":"https://tc-tct.douyucdn2.cn/dyliveflv3","rtmp_live":"71771r0CLh8PznCh_900.flv?wsAuth=d5bb01e06602dcd70c9c20f20cff162b\u0026token=web-h5-0-71771-b1682775e063195f848b0f54cc6b24037dc5bce6d4201247\u0026logo=0\u0026expire=0\u0026did=99352686151c41e08e577318fcffa4ce\u0026pt=2\u0026st=0\u0026origin=tct\u0026mix=0\u0026isp=","client_ip":"183.24.58.39","inNA":0,"rateSwitch":1,"rate":2,"cdnsWithName":[{"name":"备用线路5","cdn":"tct-h5"}],"multirates":[{"name":"蓝光4M","rate":0,"highBit":1,"bit":4000},{"name":"高清","rate":2,"highBit":0,"bit":1200}],"isPassPlayer":0,"eticket":null,"online":0,"mixedCDN":"","p2p":2,"streamStatus":1,"smt":0,"p2pMeta":null,"p2pCid":0,"p2pCids":"","player_1":"","h265_p2p":0,"h265_p2p_cid":0,"h265_p2p_cids":""}}

site:                斗鱼直播 (DouyuTV)
title:               喵放送☀️喵呜~ - 喵放送
artist:              喵放送
streams:
    - format:        BD4M
      container:     flv
      video-profile: 蓝光4M
    # download-with: ykdl --format=BD4M [URL]
Real urls:
https://tc-tct.douyucdn2.cn/dyliveflv3/71771r0CLh8PznCh.flv?wsAuth=ab997570bc6487d02d2379850dbf9229&token=web-h5-0-71771-b1682775e063195f7ca1de5424a1ca525e8f4f4592b2c446&logo=0&expire=0&did=99352686151c41e08e577318fcffa4ce&pt=2&st=0&origin=tct&mix=0&isp=
    - format:        HD
      container:     flv
      video-profile: 高清
    # download-with: ykdl --format=HD [URL]
Real urls:
https://tc-tct.douyucdn2.cn/dyliveflv3/71771r0CLh8PznCh_900.flv?wsAuth=d5bb01e06602dcd70c9c20f20cff162b&token=web-h5-0-71771-b1682775e063195f848b0f54cc6b24037dc5bce6d4201247&logo=0&expire=0&did=99352686151c41e08e577318fcffa4ce&pt=2&st=0&origin=tct&mix=0&isp=
steven7851 commented 3 years ago

https://github.com/zhangn1985/ykdl/blob/08923e678d5632e11ca94286d3913800b3a40e12/ykdl/extractors/douyu/live.py#L61 改成'cdn': 'akm-h5',就是主线路了

SeaHOH commented 3 years ago

感觉你修改的地方不止这一点,我还是无法复现。

CJN1986 commented 3 years ago

请问能不能用参数来手动指定线路? 我的情况是(没有修改ykdl任何文件) 国内本机录dy正常 外国的vps录dy时,录几秒就断开,要修改ykdl/ykdl/extractors/douyu/live.py,'cdn': 'ali-h5',才正常了

SeaHOH commented 3 years ago

请问能不能用参数来手动指定线路? 我的情况是(没有修改ykdl任何文件) 国内本机录dy正常 外国的vps录dy时,录几秒就断开,要修改ykdl/ykdl/extractors/douyu/live.py,'cdn': 'ali-h5',才正常了

添加站点参数又要全部改一次,虽然其它站点也可以搞些花样出来,但是会有人来改吗?我是不太想弄了,真没那种特细致的需求,你还是直接修改吧。

steven7851 commented 3 years ago

我没有修改任何东西,就是跑主线路akm-h5,PC网页端主线路也是akm-h5,估计是海外IP的问题,只能暂时修改成tct-h5ali-h5来解决了,如果你没打算对hls做适配的话 snipaste_20201216_063754

SeaHOH commented 3 years ago

@steven7851 修改适配格式容易,只不过想弄清状况。看来还是 IP 问题。