Coder Social home page Coder Social logo

barrage's People

Contributors

octavianlee avatar superfashi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

barrage's Issues

ValueError: Unmatched ''"' when when decoding 'string'

Traceback (most recent call last):
File "main.py", line 6, in
hime = DanmakuHime()
File "/Users/JOE/Downloads/Barrage-master-2/danmaku/hime.py", line 19, in init
self.run()
File "/Users/JOE/Downloads/Barrage-master-2/danmaku/hime.py", line 39, in run
self.create_service(option, room_id)
File "/Users/JOE/Downloads/Barrage-master-2/danmaku/hime.py", line 57, in create_service
service.cmd_run()
File "/Users/JOE/Downloads/Barrage-master-2/danmaku/services/reciever.py", line 18, in cmd_run
run_recieve(self.room_id)
File "/Users/JOE/Downloads/Barrage-master-2/danmaku/cores/socket_process.py", line 69, in run_recieve
produce_danmaku.switch(sock, danmaku_queue, True)
File "/Users/JOE/Downloads/Barrage-master-2/danmaku/cores/produce_and_consume.py", line 49, in produce_danmaku
status = process_recieve_data(sock, danmaku_queue, data)
File "/Users/JOE/Downloads/Barrage-master-2/danmaku/cores/danmaku_process.py", line 40, in process_recieve_data
msg = ujson.loads(data)
ValueError: Unmatched ''"' when when decoding 'string'

目测是有人发了引号导致的。

TypeError: Odd-length string

您所在直播间(Exit 退出助手):92075
请求服务器连接
Traceback (most recent call last):
File "main.py", line 6, in
hime = DanmakuHime()
File "/Users/JOE/Downloads/Barrage-master-2/danmaku/hime.py", line 19, in init
self.run()
File "/Users/JOE/Downloads/Barrage-master-2/danmaku/hime.py", line 39, in run
self.create_service(option, room_id)
File "/Users/JOE/Downloads/Barrage-master-2/danmaku/hime.py", line 57, in create_service
service.cmd_run()
File "/Users/JOE/Downloads/Barrage-master-2/danmaku/services/reciever.py", line 18, in cmd_run
run_recieve(self.room_id)
File "/Users/JOE/Downloads/Barrage-master-2/danmaku/cores/socket_process.py", line 68, in run_recieve
with generate_socket(room_id) as sock:
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/contextlib.py", line 17, in enter
return self.gen.next()
File "/Users/JOE/Downloads/Barrage-master-2/danmaku/cores/socket_process.py", line 31, in generate_socket
send_data = unhexlify(data)
TypeError: Odd-length string

测试其他房间的时候没问题,不知道这个房间的问题是什么。

[BUG]发送弹幕功能修改

晚上我尝试了许久没有试过的发送弹幕的代码,发现已经不能使用了,未来需要对这个功能进行重新修改,解决该问题。

[技术]如何去除requests库的使用?

目前项目由于技术上困难,导致requests和urllib2并行使用,为了统一依赖环境,要纯粹依赖python原生的库进行开发,从而使项目变的简便可行。

困难点在于:

  • 登陆之后,如何使用登录后的cookie继续进行其他的操作而不会丢失;
  • urllib2向b站发送请求,似乎不稳定,容易返回400错误。

[技术]生产者-消费者模式

为了快速实现功能,仅仅是概念上的分成了生产者和消费者,目前是一种不安全的实现方法,会产生部分不安的状况。

对于接受弹幕部分,需要按照生产者消费者的方式重新编写这块的逻辑,让整个服务能够更加平滑。

[技术]解决连接服务器的诸多问题。

许久没有更新这个项目,能够使用就当作完成了。由于目前b站增加了新的功能,所以打算进行调整开发,不过目前要解决一下代码遗留下来的连接问题,包含:

  • 连接阻塞;
  • 连接不稳定;
  • 退出异常;
  • ...

这些问题的解决涉及到python socket深入的使用,预计代码后能提升整体稳定体验。

[问题]安装遇到Error:ImportError: No module named requests

输入代码$: python main.py
反馈如下:
Traceback (most recent call last):
File "main.py", line 3, in
from danmaku.hime import DanmakuHime
File "/Users/RunzeZhao/Downloads/Barrage-master/danmaku/hime.py", line 3, in
from services.sender import SenderService
File "/Users/RunzeZhao/Downloads/Barrage-master/danmaku/services/sender.py", line 5, in
import requests
ImportError: No module named requests

[技术]选择那种图形库作为GUI版本开发?

目前弹幕姬的基础功能在命令行下已经完成,现在急需做出界面来以便推广使用。

初步方案如下:

  • 更新一个curses库的一个命令行的图形界面系统,作为临时解决方案;
  • 使用kivy库,做出一个UI界面来作为正式版本使用。

[业务]添加新增弹幕类型支持

B站对直播间的功能已经了延展推广,也可以赠送礼物等等,弹幕类型变多了。

现在的方法只是采用try..except做的一个临时性质的解决方案,需要针对新的弹幕结果来进行提取,作为一个新的功能更新。

[技术]编写完备的单元测试

弹幕姬基础功能库已经完成,为了开发的稳定性,需要编写相应的单元测试。

技术采用 nose+mock的方式编写测试。

服务器连接失败

请输入你的选择(Exit 退出):1
您所在直播间(Exit 退出助手):324
请求服务器连接
服务器连接失败...
开始接收弹幕。(Ctrl + C 退出)

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.