Skip to content

Files

Latest commit

author
Yingnan Song
Jun 22, 2016
03f4796 · Jun 22, 2016

History

History
26 lines (16 loc) · 501 Bytes

README.md

File metadata and controls

26 lines (16 loc) · 501 Bytes

pydouyu

Python Wrapper for DouyuTV APIs, including support for accessing ChatRoom, e.g. DanMu/弹幕.

Installation

pip install douyu

Example Usage

from douyu.chat.room import ChatRoom

def on_chat_message(msg):
    print '[%s]:%s' % (msg.attr('nn'), msg.attr('txt'))

def run():
    room = ChatRoom('70068')
    room.on('chatmsg', on_chat_message)
    room.knock()

if __name__ == '__main__':
     run()

References