chrippa / livestreamer

Command-line utility that extracts streams from various services and pipes them into a video player of choice. No longer maintained, use streamlink or youtube-dl instead.
http://livestreamer.io/
BSD 2-Clause "Simplified" License
3.88k stars 582 forks source link

douyutv.com not working. error msg. #809

Closed HHGBC closed 9 years ago

HHGBC commented 9 years ago

Microsoft Windows Version 6.3.9600 2013 Microsoft Corporation. All rights reserved.

...... livestreamer douyutv.com/.... best [cli][info] Found matching plugin douyutv for URL douyutv.com/4809 error: Unable to validate JSON: Unable to validate key 'data': {u'owner_weight': u'132.14t', u'rtmp_url': u'', u'show_time': u'1426888138', u'show_details': u'\ u4ee3\u7ec3\u901a www.dailiantong.com \uff08\u5b9e\u529b\u6253\u624b\u53ef\u6 765\u770b\u770b\uff09', u'servers': [{u'ip': u'182.18.47.17', u'port': u'8048'}, {u'ip': u'182.18.47.52', u'port': u'8028'}, {u'ip': u'182.18.47.18', u'port': u '8056'}, {u'ip': u'182.18.47.10', u'port': u'8004'}, {u'ip': u'182.18.47.51', u' port': u'8017'}, {u'ip': u'182.18.47.10', u'port': u'8005'}, {u'ip': u'182.18.47 .51', u'port': u'8013'}, {u'ip': u'182.18.47.52', u'port': u'8024'}, {u'ip': u'1 82.18.47.17', u'port': u'8042'}, {u'ip': u'182.18.47.10', u'port': u'8006'}], u' rtmp_cdn': u'', u'room_src': u'http://staticlive.douyutv.com/upload/web_pic/9/48 09_1503210731_thumb.jpg', u'subject': u'', u'fans': u'422723', u'room_id': u'480 9', u'online': 127251, u'specific_status': u'1', u'tags': u'', u'room_name': u'\ u65cb\u98ce\u5c0f\u76d6\u4f26\uff0c\u9a6c\u6765\u897f\u4e9a\u6253\u91ce~', u'use _p2p': u'0', u'vod_quality': u'0', u'rtmp_multi_bitrate': u'', u'owner_avatar': u'http://uc.douyutv.com/avatar.php?uid=184165&size=big', u'game_url': u'/directo ry/game/LOL', u'nickname': u'\u997c\u5e72\u72c2\u9b54MasterB', u'rtmp_live': u'' , u'owner_uid': u'184165', u'specific_catalog': u'', u'url': u'/4809', u'cate_id ': u'1', u'game_name': u'\u82f1\u96c4\u8054\u76df', u'show_status': u'1'} does n ot equal None or Unable to validate key 'rtmp_multi_bitrate': Type of u'' should be 'list' but is 'unicode' or Type of u'' should be 'dict' but is 'unicode'

could you please solve this issue?

thx

eloitay commented 9 years ago

Hi I did a check on this in an attempt to fix this but it seems that the API that the plugin is using is no longer returning enough information for the plugin to work. It is lacking all the streaming information. Probably in an attempt to block livestreamer or any form of non official website based streaming. Unfortunately I do not understand the plugin well enough to modify it such that it parse the website instead. I am trying to see if there is any other alternative.

eloitay commented 9 years ago

I do realise that there is an alternative api that still return the correct information. But the problem I think is it needs to get a key that expires every 5 minutes. http://www.douyutv.com/swf_api/room/{ROOMNUMBER}?cdn=&nofan=yes&_t=23792847&sign={SOMEKEYTHATEXPIREEVERY5MINUTES} I have not figure out what is with the t though.

Anyone familiar with updating of plugin, can drop me some hint on how exactly such problem can be tackled?

chrippa commented 9 years ago

Anyone familiar with updating of plugin, can drop me some hint on how exactly such problem can be tackled?

Your best bet is to decompile the SWF and look at the code.

eloitay commented 9 years ago

Hi I have nearly a complete feature on what to call but I am just not sure how to actually write it properly in the plugin since the plugin have no documentation so pretty much I am guessing what can be done in there. Another question is how do I test my modification?

chrippa commented 9 years ago

I have nearly a complete feature on what to call but I am just not sure how to actually write it properly in the plugin since the plugin have no documentation so pretty much I am guessing what can be done in there.

Sorry about that, you can look at the existing plugins to get an idea how it works. Bascially you have access to these APIs and the Python standard library.

Another question is how do I test my modification?

The Hitchhiker's Guide to Python will get you started on Python development.

eloitay commented 9 years ago

Hi I do understand the test that I have to run to see if the code breaks anything but whatever testing the fix that I created? I tried python main.py on cli to "run" it but that does not work. I believe I am not supposed to do that but I cannot figure out which is the correct method to do so.

chrippa commented 9 years ago

I'm not sure what main.py you're talking about, but I forgot to link these Livestreamer specific instructions which might be a bit clearer.

eloitay commented 9 years ago

Hi maybe I was not clear enough but I did follow those steps already. My problem being how do I run the cli part to do a test. Like when i normally use the application I do livestreamer douyutv.com/23142, and I encounter an error. So I did the steps in livestreamer specific instructions to actually get the latest base and test if it is actually fixed. If not I will start do modify the source to get it to work but lets assume I done the necessary change I require. How could I run the modified version?

chrippa commented 9 years ago

When you have the virtualenv activated it will use the code from the directory you ran python setup.py develop from.

eloitay commented 9 years ago

Ah that explain why. Thanks a lot for the help. I actually have problem with the virtual environment install so I skipped it thinking that it will just pollute my main Python environment but did not realize the impact. Thanks for solving the mystery.

On 29 Mar 2015, at 10:00 pm, Christopher Rosell notifications@github.com wrote:

When you have the virtualenv activated it will use the code from the directory you ran python setup.py develop from.

— Reply to this email directly or view it on GitHub.

intact commented 9 years ago

fix intact/livestreamer@c5ff12bdacd30369605ff8a7496f886774af87d7

ghost commented 9 years ago

@intact

Submit a pull request. (Contributing)