上海 Pythonista 一枚
- 人在上海、刚下航母
- 普本毕业、长相彦祖
- 代码世家、派森老祖
- 涉猎颇广、心无旁骛
- 熟人太多、千星再补
douyutv danmu 斗鱼TV 弹幕助手
archlinux系统,python3,运行
danmu.fm -q 3 -m 1 -p 0 -vvvv http://www.douyu.com/60531、
from danmufm.danmu import main
import click
请帮看看是什么问题
哪怕是后面自己调整时间轴都可以
$ danmu.fm -q 3 -m 1 -p 0 -vvvv http://www.douyu.com/226855
_____ ______ __ __
| __ \ | ____| \/ |
| | | | __ _ _ __ _ __ ___ _ _ | |__ | \ / |
| | | |/ _` | '_ \| '_ ` _ \| | | | | __| | |\/| |
| |__| | (_| | | | | | | | | | |_| |_| | | | | |
|_____/ \__,_|_| |_|_| |_| |_|\__,_(_)_| |_| |_|
---- A Terminal Tools For DouyuTV
@author Micheal Gardner ([email protected])
last_update 2017-07-10 08:54:59
[15:44:30] INFO::danmu - 正在检查环境
[15:44:30] INFO::danmu - 程序正在启动,检查环境配置
[15:44:30] INFO::danmu - 开始配置环境
[15:44:30] INFO::danmu - 环境检查完毕,正在开启斗鱼客户端(请等待15s~30s)
Traceback (most recent call last):
File "/usr/local/bin/danmu.fm", line 11, in
sys.exit(main())
File "/usr/local/lib/python3.6/site-packages/danmufm/danmu.py", line 117, in main
parse_command()
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 722, in call
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/danmufm/danmu.py", line 107, in parse_command
start_douyu_client()
File "/usr/local/lib/python3.6/site-packages/danmufm/danmu.py", line 112, in start_douyu_client
DouyuClient(url).start()
File "/usr/local/lib/python3.6/site-packages/danmufm/client/douyu_client.py", line 51, in start
auth_server_ip, auth_server_port = self.fetch_room_info(self.url)
File "/usr/local/lib/python3.6/site-packages/danmufm/client/douyu_client.py", line 62, in fetch_room_info
html = urlopen(url).read().decode()
File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 223, in urlopen
return opener.open(url, data, timeout)
File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 532, in open
response = meth(req, response)
File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 642, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 564, in error
result = self._call_chain(*args)
File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 504, in _call_chain
result = func(*args)
File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 756, in http_error_302
return self.parent.open(new, timeout=req.timeout)
File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 532, in open
response = meth(req, response)
File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 642, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 570, in error
return self._call_chain(*args)
File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 504, in _call_chain
result = func(*args)
File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 650, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden
MPlayer 已经停止开发多年了,而 MPV 继承了 MPlayer 的代码,并还在活跃地开发。
同时 MPV 支持硬件加速的解码的播放。
启动时会抛如下的异常
File "/usr/local/lib/python3.5/site-packages/danmufm/client/douyu_client.py", line 106, in fetch_rtmp_info
if str(js_data["data"]["rtmp_live"]).strip() == "":
TypeError: string indices must be integers
我用项目中构造的如下 url
http://douyutv.com/api/v1/room/499656?aid=android&client_sys=android&time=1469440818&auth=df0506b570038c2eea6d273c95f25b70
请求的结果为:
{'data': 'api身份信息错误', 'error': 1002}
Traceback (most recent call last):
File "/usr/local/bin/danmu.fm", line 7, in
from danmufm.danmu import main
File "/usr/local/lib/python3.4/dist-packages/danmufm/danmu.py", line 73, in
import click
ImportError: No module named 'click'
Traceback (most recent call last):
File "/home/carl/.local/bin/danmu.fm", line 7, in
from danmufm.danmu import main
File "/home/carl/.local/lib/python3.5/site-packages/danmufm/danmu.py", line 73, in
import click
ImportError: No module named 'click'
[21:42:58] INFO::danmu - 正在检查环境
[21:42:58] INFO::danmu - 程序正在启动,检查环境配置
[21:42:58] INFO::danmu - 开始配置环境
[21:42:58] INFO::danmu - 环境检查完毕,正在开启斗鱼客户端(请等待15s~30s)
Traceback (most recent call last):
File "/usr/local/bin/danmu.fm", line 11, in
sys.exit(main())
File "/usr/local/lib/python3.6/dist-packages/danmufm/danmu.py", line 117, in main
parse_command()
File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 722, in call
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/danmufm/danmu.py", line 107, in parse_command
start_douyu_client()
File "/usr/local/lib/python3.6/dist-packages/danmufm/danmu.py", line 112, in start_douyu_client
DouyuClient(url).start()
File "/usr/local/lib/python3.6/dist-packages/danmufm/client/douyu_client.py", line 51, in start
auth_server_ip, auth_server_port = self.fetch_room_info(self.url)
File "/usr/local/lib/python3.6/dist-packages/danmufm/client/douyu_client.py", line 75, in fetch_room_info
room["gg_show"] = js["room_gg"]["show"]
KeyError: 'room_gg'
$ pip3 install danmu.fm
Collecting danmu.fm Using cached danmu.fm-0.3.4-py3-none-any.whl Collecting requests (from danmu.fm) Using cached requests-2.12.1-py2.py3-none-any.whl Installing collected packages: requests, danmu.fm Successfully installed danmu.fm-0.3.4 requests-2.12.1
显示安装成功了,但是输入danmu.fm 显示未找到命令
$ danmu.fm -q 3 -m 1 -p . -vvvv http://www.douyu.com/444360
Traceback (most recent call last):
File "/usr/local/bin/danmu.fm", line 7, in
from danmufm.danmu import main
File "/usr/local/lib/python3.4/dist-packages/danmufm/danmu.py", line 76, in
@click.command()
AttributeError: 'module' object has no attribute 'command'
项目启动的时候出现了这个
TimeoutError: [Errno 60] Operation timed out
请问一下现在这个项目不再维护了么,看到最新版本还是停留在7102年。
Exception in thread Thread-1:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/threading.py", line 914, in _bootstrap_inner
self.run()
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/threading.py", line 862, in run
self._target(_self._args, *_self._kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/danmufm/client/douyu_danmu_manager.py", line 63, in keeplive
self.send_auth_keeplive_msg()
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/danmufm/client/douyu_danmu_manager.py", line 178, in send_auth_keeplive_msg
self.danmu_auth_socket.sendall(msg)
BrokenPipeError: [Errno 32] Broken pipe
https://www.douyu.com/ztCache/WebM/room/{房间id}
如果斗鱼做活动更换了直播间界面的话,在页面上是获取不了房间信息的,需要使用这个接口去获取。如果主播的房间是个性化(也就是使用拼音的)可以先在页面上获取他的房间 id,暂时没发现个性化域名获取房间号的接口。
in mac after I install from pip3,and I use:
danmu.fm -q 3 -m 1 -p 0 -vvvv http://www.douyu.com/74751
but I receive the following errors info:
File "/usr/local/lib/python3.5/site-packages/danmufm/client/douyu_danmu_manager.py", line 81, in do_login
self.username = re.search('/username@=(.+)/nickname', recv_msg).group(1)
AttributeError: 'NoneType' object has no attribute 'group'
Traceback (most recent call last):
File "/usr/local/bin/danmu.fm", line 11, in
sys.exit(main())
File "/usr/local/lib/python3.5/dist-packages/danmufm/danmu.py", line 117, in main
parse_command()
File "/usr/local/lib/python3.5/dist-packages/click/core.py", line 716, in call
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/click/core.py", line 696, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.5/dist-packages/click/core.py", line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.5/dist-packages/click/core.py", line 534, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/danmufm/danmu.py", line 107, in parse_command
start_douyu_client()
File "/usr/local/lib/python3.5/dist-packages/danmufm/danmu.py", line 112, in start_douyu_client
DouyuClient(url).start()
File "/usr/local/lib/python3.5/dist-packages/danmufm/client/douyu_client.py", line 51, in start
auth_server_ip, auth_server_port = self.fetch_room_info(self.url)
File "/usr/local/lib/python3.5/dist-packages/danmufm/client/douyu_client.py", line 75, in fetch_room_info
room["gg_show"] = js["room_gg"]["show"]
KeyError: 'room_gg'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.