Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Douyutv error #1411

Open
bupmc opened this issue Jul 22, 2016 · 18 comments
Open

Douyutv error #1411

bupmc opened this issue Jul 22, 2016 · 18 comments

Comments

@bupmc
Copy link

bupmc commented Jul 22, 2016

Windows nightly build was working fine until hours ago:
URL: www.douyutv.com/321358
error: Unable to validate JSON: Unable to validate key 'data': u'api\u8eab\u4efd
\u4fe1\u606f\u9519\u8bef' does not equal None or Type of u'api\u8eab\u4efd\u4fe1
\u606f\u9519\u8bef' should be 'dict' but is 'unicode'

@dojima
Copy link

dojima commented Jul 23, 2016

Same.

@ChaosTong
Copy link

the api have been changed so....

@steven7851
Copy link
Contributor

steven7851 commented Jul 24, 2016

#1414

@dojima
Copy link

dojima commented Jul 24, 2016

Thanks for the fix, steven. It seems to work with the majority of streams, specifically the ones that use a six digit number for the user URL, but it's not working for me in the streams that don't follow this format.

For example, douyu.com/chtmac produces the following error:

error: Unable to open URL: http://www.douyu.com/lapi/live/getPlay/chtmac (403 Cl
ient Error: Forbidden)

@steven7851
Copy link
Contributor

steven7851 commented Jul 24, 2016

@dojima
I have tried to fix, see my PR and feedback if get error again.

@bupmc
Copy link
Author

bupmc commented Jul 24, 2016

现在人气高的直播间Available streams只剩source,以前人气高的直播间Available streams还有一个middle可选,请问还能和以前一样吗?

@steven7851
Copy link
Contributor

steven7851 commented Jul 24, 2016

@bupmc
谢谢你的建议
新增了画质选择, source = 超清, middle = 高清, low = 普清
选择高清或普清时, 若直播间人数不足, api 还是返回超清串流

@dojima
Copy link

dojima commented Jul 25, 2016

@steven7851
Works flawlessly. Thanks a bunch.

@bupmc
Copy link
Author

bupmc commented Jul 25, 2016

Thanks a lot!

@xingchch
Copy link

xingchch commented Aug 5, 2016

现在斗鱼应该改版了,域名改成www.douyu.com,

livestreamer -l debug http://www.douyu.com/692053 worst
error: No plugin can handle URL: http://www.douyu.com/692053

如果把域名改成www.douyutv.com,会有以下错误:

livestreamer -l debug http://www.douyutv.com/692053 worst
[cli][info] Found matching plugin douyutv for URL http://www.douyutv.com/692053
[cli][info] Available streams: source (worst, best)
[cli][info] Opening stream: source (http)
[cli][error] Could not open stream: Unable to open URL: http://hdl1a.douyutv.com/live/ (403 Client Error: Forbidden)

@dojima
Copy link

dojima commented Aug 5, 2016

Yeah, I had that issue when douyutv.com first started redirecting to douyu.com. To fix it, I just made a copy of douyutv.py in the plugins directory and renamed it as douyu.py, then changed every instance of 'douyutv' inside the file to 'douyu'. There should be two mentions that need to be replaced. After that, just save the file, and it should work fine.

@steven7851
Copy link
Contributor

steven7851 commented Aug 5, 2016

@xingchch @dojima
The code is compatible with "douyu.com" and "douyutv.com".
403 error is caused by lapi returning wrong stream URL.
I think that it's because channel just start recently. (or else. Just my guess.)
The only way is waiting for a while until stream URL is generated.

@ximellon
Copy link

@steven7851 I've tried your patch. It's awesome! Thanks a lot. But I also found a problem for rooms of non-digit room ID. And I fix it. Here the code is. The problem only exists for rooms that have particular pages for promotion, like LPL, Blizzard, etc. I did this only for LPL channel and haven't tested a lot for other cases. Feel free to use it and report any problems that you encounter!

@steven7851
Copy link
Contributor

steven7851 commented Aug 11, 2016

Thanks for your work. I find the code problem: When in a event page, it exists many "data-room_id=". Livestreamer doesn't have list moudle, so there is no method to handle that.
It will pick the first data-room_id as channel.

exp. http://www.douyu.com/cms/zt/lpl.html

<a class="cur" href="javascript:;" data-owner_name="Riot赛事直播" data-room_name="LPL春季赛30日比赛重播" data-room_id="288016" data-owner_uid="19344409"> <b></b> 
<h3>主房间</h3>
</a> <a href="javascript:;" data-owner_name="Riot赛事直播二" data-room_name="LPL春季赛30日比赛重播" data-room_id="424559" data-owner_uid="19344409"> <b></b> 
<h3>副房间</h3>

Or you can try another project like ykdl which has list moudle.

@bnlou9
Copy link

bnlou9 commented Aug 21, 2016

@steven7851 請教該怎麼使用/下載您所提供的檔案/code?

@steven7851
Copy link
Contributor

steven7851 commented Aug 22, 2016

@bnlou9 Download the raw file and copy to livestreamer\plugins with replacing the old one.

@bnlou9
Copy link

bnlou9 commented Aug 23, 2016

@steven7851 thank you very much

@bupmc
Copy link
Author

bupmc commented Feb 28, 2017

这里可以参考
spacemeowx2/DouyuHTML5Player@97c72a8

各位高手有时间受累看看,2月28斗鱼改版后:
[cli][info] Found matching plugin douyutv for URL www.douyu.com/17732
error: Unable to open URL: https://www.douyu.com/lapi/live/getPlay/17732 (403 C
lient Error: Forbidden)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants