LifeActor / ykdl

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

下载斗鱼时 出现 keyerror #542

Closed yoyosnart closed 3 years ago

yoyosnart commented 3 years ago

在提交前,请确保您已经检查了以下内容!

请将错误输出粘贴在下面:

Traceback (most recent call last): File "C:\Users\pig\AppData\Local\Programs\Python\Python37-32\Scripts\ykdl-script.py", line 11, in load_entry_point('ykdl==1.7.0', 'console_scripts', 'ykdl')() File "c:\users\pig\appdata\local\programs\python\python37-32\lib\site-packages\cykdl__main__.py", line 197, in main info = parser(u) File "c:\users\pig\appdata\local\programs\python\python37-32\lib\site-packages\ykdl\extractor.py", line 23, in parser info = self.prepare() File "c:\users\pig\appdata\local\programs\python\python37-32\lib\site-packages\ykdl\extractors\douyu\live.py", line 105, in prepare error_msg = get_live_info() File "c:\users\pig\appdata\local\programs\python\python37-32\lib\site-packages\ykdl\extractors\douyu\live.py", line 83, in get_live_info stream = self.profile_2_id[video_profile] KeyError: '原画'

C:\Users\pig>ykdl -o D:\Metadata\douyu_0107\c\13.flv https://www.douyu.com/1126960 --debug
DEBUG:html:Add <urllib.request.ProxyHandler object at 0x03947D90> to default handlers
DEBUG:common:video_host> www.douyu.com
DEBUG:common:short_name> douyu
DEBUG:html:get_content> URL: https://www.douyu.com/1126960
DEBUG:html:get_content> Charset: UTF-8
DEBUG:html:get_content> URL: https://open.douyucdn.cn/api/RoomApi/room/1126960
DEBUG:html:get_content> Charset: utf-8
DEBUG:斗鱼直播 (DouyuTV):ub98484234: {'decryptedCodes': [], 'resoult': 'v=220120210107&did=c7ae41ab22954d8e987556d2b5955397&tt=1610012690&sign=cb03bd0f070709dcc8169a423b283787'}
DEBUG:html:get_content> URL: https://www.douyu.com/lapi/live/getH5Play/1126960
DEBUG:html:get_content> Charset: utf-8
DEBUG:斗鱼直播 (DouyuTV):{"error":0,"msg":"ok","data":{"room_id":1126960,"is_mixed":false,"mixed_live":"","mixed_url":"","rtmp_cdn":"tct-h5","rtmp_url":"https://tc-tct.douyucdn2.cn/dyliveflv1","rtmp_live":"1126960rPXROLJ7f.flv?wsAuth=244c1a0d45ae47b530e306f77531dd9c\u0026token=web-h5-0-1126960-97b8314bb93dc18ac3fc2370463f76890c5bcfd8644a39d2\u0026logo=0\u0026expire=0\u0026did=c7ae41ab22954d8e987556d2b5955397\u0026pt=2\u0026st=0\u0026origin=hw\u0026mix=0\u0026isp=\u0026pushdouyu=1","client_ip":"114.33.129.168","inNA":0,"rateSwitch":1,"rate":0,"cdnsWithName":[{"name":"备用线路5","cdn":"tct-h5"},{"name":"备用线路7","cdn":"hw-h5"},{"name":"备用线路6","cdn":"ali-h5"}],"multirates":[{"name":"原画","rate":0,"highBit":1,"bit":6098},{"name":"蓝光4M","rate":4,"highBit":1,"bit":4000},{"name":"超清","rate":3,"highBit":0,"bit":2000},{"name":"高清","rate":2,"highBit":0,"bit":1200}],"isPassPlayer":0,"eticket":null,"online":0,"mixedCDN":"","p2p":0,"streamStatus":1,"smt":0,"p2pMeta":null,"p2pCid":0,"p2pCids":"","player_1":"","h265_p2p":0,"h265_p2p_cid":0,"h265_p2p_cids":""}}

Traceback (most recent call last):
  File "C:\Users\pig\AppData\Local\Programs\Python\Python37-32\Scripts\ykdl-script.py", line 11, in <module>
    load_entry_point('ykdl==1.7.0', 'console_scripts', 'ykdl')()
  File "c:\users\pig\appdata\local\programs\python\python37-32\lib\site-packages\cykdl\__main__.py", line 197, in main
    info = parser(u)
  File "c:\users\pig\appdata\local\programs\python\python37-32\lib\site-packages\ykdl\extractor.py", line 23, in parser
    info = self.prepare()
  File "c:\users\pig\appdata\local\programs\python\python37-32\lib\site-packages\ykdl\extractors\douyu\live.py", line 105, in prepare
    error_msg = get_live_info()
  File "c:\users\pig\appdata\local\programs\python\python37-32\lib\site-packages\ykdl\extractors\douyu\live.py", line 83, in get_live_info
    stream = self.profile_2_id[video_profile]
KeyError: '原画'

如果您有其他附言,例如问题只在某个视频发生,或者是一般性讨论或者提出新功能,请在下面添加:

[您的内容]

cherinyy commented 3 years ago

@yoyosnart 你可以先自行下载 https://github.com/zhangn1985/ykdl/blob/b1faf1d9da5a2e71904787db2b0f9354e88eb52b/ykdl/extractors/douyu/live.py 并替换 c:\users\pig\appdata\local\programs\python\python37-32\lib\site-packages\ykdl\extractors\douyu\live.py再等待正式更新。

yoyosnart commented 3 years ago

@yoyosnart 你可以先自行下载 https://github.com/zhangn1985/ykdl/blob/b1faf1d9da5a2e71904787db2b0f9354e88eb52b/ykdl/extractors/douyu/live.py 并替换 c:\users\pig\appdata\local\programs\python\python37-32\lib\site-packages\ykdl\extractors\douyu\live.py再等待正式更新。

替换后问题已解决