Giter Club home page Giter Club logo

danmu's Issues

交互模式确定

@tempdban
兄弟,我在想这个包应该做成什么样子给用户使用。
没找到什么好的想法,有什么建议吗?

运行后无反应,一段时间后报错

fangs-mac:danmu fang$ python3 a.py
^CTraceback (most recent call last):
File "a.py", line 24, in
dmc.start(blockThread = True)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/danmu/init.py", line 55, in start
self.__client.start()
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/danmu/Abstract.py", line 29, in start
time.sleep(self.anchorStatusRescanTime)
KeyboardInterrupt

有时候能爬到弹幕有时候什么反应都没有

python test.py
success
但是爬不到东西

昨天晚上还能爬到东西的,同样的设置早上就爬不到了 ,换了好几个正在直播的页面都爬不到

import time
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
from danmu import DanMuClient

def pp(msg):
    print(msg.encode(sys.stdin.encoding, 'ignore').
        decode(sys.stdin.encoding))

dmc = DanMuClient('https://www.douyu.com/778895')
if not dmc.isValid(): print('Url not valid')
else: print ('success')

@dmc.danmu
def danmu_fn(msg):
    pp('[%s] %s' % (msg['NickName'], msg['Content']))
    with open ('danmu.txt','a') as f:
      #  f.write('%s [%s] %s \n' % (time.strftime("%a %b %d %H:%M:%S %Y", time.localtime()) ,msg['NickName'], msg['Content'])
		f.write('%s \n' %(msg['Content']))
		
@dmc.gift
def gift_fn(msg):
    pp('[%s] sent a gift!' % content['NickName'])

@dmc.other
def other_fn(msg):
    pp('Other message received')

dmc.start(blockThread = True)

其他平台实现问题

想问一下大佬们,douyu这些是平台给了接口才能访问到的吗,如果平台没有给接口该如何拿到数据?

斗鱼bug

获取弹幕的时候,如果有用户发送礼物会报错

b站失效了

测试b站的时候 发现网页里面不能直接获取到ROOMID了 但感谢解析的过程

pandatv 运行无反应

import time, sys

from danmu import DanMuClient

def pp(msg):
    print(msg.encode(sys.stdin.encoding, 'ignore').
        decode(sys.stdin.encoding))

#dmc = DanMuClient('https://www.douyu.com/32892')
#dmc = DanMuClient('https://live.bilibili.com/324')
dmc = DanMuClient('https://www.panda.tv/66666')

if not dmc.isValid(): print('Url not valid')

@dmc.danmu
def danmu_fn(msg):
    pp('[%s] %s' % (msg['NickName'], msg['Content']))

@dmc.gift
def gift_fn(msg):
    pp('[%s] sent a gift!' % msg['NickName'])

@dmc.other
def other_fn(msg):
    pp('Other message received')

dmc.start(blockThread=True)

[误报]无法获取礼物消息

问题描述:

斗鱼,全民,熊猫,战旗这4个平台测试了有50个主播,都只能截获到普通danmu消息,礼物的截获不到,求大神指教

系统:

centos6.5

代码:

@dmc.danmu
def danmu_fn(msg):
    payload = {
        "star_id": star_id,
        "text": msg['Content'],
        "type": "danmu",
        "plat": plat
    }
    r = requests.get("http://localhost:9203/save", params=payload)
@dmc.gift
def gift_fn(msg):
    pp('[%s] sent a gift!' % content['NickName'])
    payload = {
        "star_id": star_id,
        "text": "gift",
        "type": "gift",
        "plat": plat
    }
    r = requests.get("http://localhost:9203/save", params=payload)
@dmc.other
def other_fn(msg):
    pp('Other message received')

dmc.start(blockThread = True)

DouYu Danmu issue

i find a problem that when using DanmuClient, some new douyu room url seems not wroking for the same version client, ex: 'https://www.douyu.com/65000'
but some other douyu_url i crawled before is also useful, did someone has the same problem here ?

ModuleNotFoundError

前几天是好的,这几天出现这种情况
λ python pilirun.py
Traceback (most recent call last):
File "pilirun.py", line 3, in
from danmu import DanMuClient
ModuleNotFoundError: No module named 'danmu'
用的anaconda带的python,装的时候是3.5版本,这两天看了好像自动升级到3.6版本了,是不是因为3.6不兼容的原因?

cannot import name 'DanMuClient'

Traceback (most recent call last):
File "D:/Users/yidian/PycharmProjects/trans/danmu.py", line 3, in
from danmu import DanMuClient;
File "D:\Users\yidian\PycharmProjects\trans\danmu.py", line 3, in
from danmu import DanMuClient;
ImportError: cannot import name 'DanMuClient'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.