GithubHelp home page GithubHelp logo

tuna / danmaq Goto Github PK

View Code? Open in Web Editor NEW
186.0 23.0 46.0 587 KB

danmaku implemented in Qt5

License: GNU General Public License v3.0

Python 1.52% CMake 3.15% C++ 13.15% Shell 0.22% HTML 0.54% JavaScript 81.41%

danmaq's Introduction

DanmaQ

Travis CI status

DanmaQ, pronounced as /danmakju:/ is a small QT program to play danmaku on any screen.

DanmaQ is still under development, documents might be outdated.

Dependencies

danmaQ depends on Qt5, version >= 5.6.2 preferred.

Installation

AppImage

On Linux X86-64, you can download the bundled AppImage.

wget https://github.com/tuna/danmaQ/releases/download/cpp-0.1/danmaQ.AppImage
chmod +x danmaQ.AppImage
./danmaQ.AppImage

Source

apt-get install qt5-default qttools5-dev qttools5-dev-tools libqt5x11extras5-dev cmake  # for ubuntu trusty (aka 14.04 LTS) and debian jessie (aka 8)
apt-get install qt5-default qttools5-dev-tools qtwebengine5-dev libqt5x11extras5-dev cmake  # for ubuntu and debian
zypper install libqt5-qtx11extras-devel libqt5-linguist-devel cmake        # for openSUSE
dnf install qt5-devel qt5-qtx11extras-devel qt5-linguist cmake             # for fedora
brew install qt                                                            # for macOS

mkdir build && cd build 
cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release 
make && sudo make install

Windows

Download binary from releases page.

Or you can also use CMake and Qt to build it yourself, but there is no help available temporarily.

Arch Linux

pacman -S danmaq

Fedora

dnf install danmaq

AOSC OS / Ubuntu 18.04+ / Debian 10+

apt install danmaq

Usage

Use TUNA Service

First you need to create a channel, go to https://dm.tuna.moe:8443/ and create a channel, (let's use ooxx as the channel name and passw0rd as the password)

Then run danmaQ and fill https://dm.tuna.moe:8443 to server, and channel name (ooxx) & channel password (passw0rd).

Then any audiences can open https://dm.tuna.moe:8443/ and click to your channel page, lauch danmaku in your screen!

Self Hosted Service

See gdanmaku-server.

TODO

  • Multi-Screen support
  • Chatting
  • RPM package
  • Deb package

danmaq's People

Contributors

acgtyrant avatar bigeagle avatar dotkrnl avatar felixonmars avatar harry-chen avatar hexchain avatar hosiet avatar jiegec avatar kireinahoro avatar lionnatsu avatar noirgif avatar prnake avatar sztsian avatar wi24rd avatar xen0n avatar z4yx 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

danmaq's Issues

微信端发送弹幕绕过了审核功能

如题,在微信发送弹幕时,似乎直接走的是 channel.new_danmaku(danmaku) ,使得微信端发的弹幕绕过了审核直接发送。我自己试着在里面加了个 need_exam 的判断,似乎可以解决问题。(其实我并不会Python,自己改是依葫芦画瓢,有问题请轻喷QWQ)

Rearrange the class names, file names

Since the class name of main window is changed, the file names and class names doesn't match quite well. So it's preferable to rename these files, for example, like below:

danmaku.h -> danmaq.hpp
danmaku_ui.{cpp, h} -> Danmaku.{cpp, hpp}
danmaku_window.{cpp, h} -> DMWindow.{cpp, hpp}
danmaq_app.{cpp, h} -> DMMainWindow.{cpp, hpp}

The include directives, the translation file, and cmake file are subject to this change.

Also, I'd recommend some class name change, but it's just my personal taste and I'll leave it open to comment :)

  • 'Comment' is better since 'danmaku' refers to a barrage of comments, not a single one.
  • We can replace 'DMWindow' with 'DMCanvas' or something else, since it's not really a window, but I'm not sure the word 'canvas' is good enough.

lrelease should be a required build dependency

When lrelease is not present, the cmake step generates a warning instead of an error, and proceeding with make will result in the following error:

[ 25%] Generating danmaQ.1
/bin/sh: LRELEASE-NOTFOUND: command not found
make[2]: *** [src/translations/CMakeFiles/translations.dir/build.make:63: /build/danmaq/src/danmaQ-0.2.3/src/translations/zh_CN.qm] Error 127
make[2]: *** Waiting for unfinished jobs....
/bin/sh: LRELEASE-NOTFOUND: command not found
make[2]: *** [src/translations/CMakeFiles/translations.dir/build.make:71: /build/danmaq/src/danmaQ-0.2.3/src/translations/ja_JP.qm] Error 127
/bin/sh: LRELEASE-NOTFOUND: command not found
make[2]: *** [src/translations/CMakeFiles/translations.dir/build.make:67: /build/danmaq/src/danmaQ-0.2.3/src/translations/zh_TW.qm] Error 127
make[1]: *** [CMakeFiles/Makefile2:216: src/translations/CMakeFiles/translations.dir/all] Error 2

This should be caught during the cmake process.

Consider providing man pages

Man page is not a "must-have" for this project but it doesn't do any harm too. Please consider installing it into UNIX-like systems when doing "make install".

(Also consider installing icons into /usr/share/icons/ please.)

Proposed example man page (danmaQ.1):

.\"                                      Hey, EMACS: -*- nroff -*-
.\" (C) Copyright 2017 Boyuan Yang <[email protected]>,
.\"
.TH DANMAQ 1 "2017-10-17" "Tsinghua TUNA Association"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
.\" .nh        disable hyphenation
.\" .hy        enable hyphenation
.\" .ad l      left justify
.\" .ad b      justify to both left and right margins
.\" .nf        disable filling
.\" .fi        enable filling
.\" .br        insert line break
.\" .sp <n>    insert n+1 empty lines
.\" for manpage-specific macros, see man(7)
.SH NAME
danmaQ \- desktop danmaku client implemented in Qt5
.SH SYNOPSIS
.B danmaQ
.SH DESCRIPTION
This manual page documents briefly the
.B danmaQ
commands.
.PP
.\" TeX users may be more comfortable with the \fB<whatever>\fP and
.\" \fI<whatever>\fP escape sequences to invode bold face and italics,
.\" respectively.
\fBdanmaQ\fP is a program that act as the danmaku client. When connected
with a server, it receives danmaku from the server and displays them
on the screen running \fBdanmaQ\fP.
.SH OPTIONS
This program does not accept any command line option now.
.SH BUGS
It is known that current program does not function well when network status
changes. In such case, please restart the program or select
"Toggle subscription" menu twice from its tray icon.
.SH SEE ALSO
.BR gdanmaku-server (1).

I'm not familiar with CMake thus not providing patch for CMakeLists.txt here.

Re-layout main window

Now the main window's layout is ugly when the dimension and/or language changes.
Try using proper subclass of QLayout to resolve it.

Update build dependency for Debian

To build this project properly, we need lrelease tool. A new build dependency is needed.

From a23f27a9d2ddb5a29a6cc5c6a54fab0215314b88 Mon Sep 17 00:00:00 2001
From: Boyuan Yang <[email protected]>
Date: Sat, 18 Nov 2017 21:45:03 +0800
Subject: [PATCH] README.md: add missing deb build-dep qttools5-dev-tools

---
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.md b/README.md
index d2b880e..ca72dc7 100644
--- a/README.md
+++ b/README.md
@@ -24,7 +24,7 @@ On Linux X86-64, you can download the bundled AppImage.
 
 ### Source
 
-    apt-get install qt5-default libqt5x11extras5-dev cmake  # for ubuntu and debian
+    apt-get install qt5-default qttools5-dev-tools libqt5x11extras5-dev cmake  # for ubuntu and debian
     zypper install  libQt5X11Extras5 cmake          # for openSUSE
     dnf install  qt5-qtx11extras-devel cmake        # for fedora
     brew install qt                                 # for macOS
-- 
2.15.0

Failed to handle network changes (e.g., VPN disconnect)

No danmaku will be displayed after network status changes.

% /usr/bin/danmaQ
QLayout: Attempting to add QLayout "" to DMApp "", which already has a layout
QLayout: Attempting to add QLayout "" to DMApp "", which already has a layout
QLayout: Attempting to add QLayout "" to DMApp "", which already has a layout
QLayout: Attempting to add QLayout "" to DMApp "", which already has a layout
"在路径 org.freedesktop.DBus.Properties 的对象上没有 /org/freedesktop/NetworkManager/ActiveConnection/5 接口"
"在路径 org.freedesktop.DBus.Properties 的对象上没有 /org/freedesktop/NetworkManager/ActiveConnection/4 接口"
"在路径 org.freedesktop.DBus.Properties 的对象上没有 /org/freedesktop/NetworkManager/ActiveConnection/5 接口"
"在路径 org.freedesktop.DBus.Properties 的对象上没有 /org/freedesktop/NetworkManager/ActiveConnection/4 接口"
"在路径 org.freedesktop.DBus.Properties 的对象上没有 /org/freedesktop/NetworkManager/ActiveConnection/5 接口"
"在路径 org.freedesktop.DBus.Properties 的对象上没有 /org/freedesktop/NetworkManager/ActiveConnection/4 接口"
"在路径 org.freedesktop.DBus.Properties 的对象上没有 /org/freedesktop/NetworkManager/ActiveConnection/5 接口"
"在路径 org.freedesktop.DBus.Properties 的对象上没有 /org/freedesktop/NetworkManager/ActiveConnection/4 接口"
"在路径 org.freedesktop.DBus.Properties 的对象上没有 /org/freedesktop/NetworkManager/ActiveConnection/5 接口"
"在路径 org.freedesktop.DBus.Properties 的对象上没有 /org/freedesktop/NetworkManager/ActiveConnection/4 接口"
"在路径 org.freedesktop.DBus.Properties 的对象上没有 /org/freedesktop/NetworkManager/ActiveConnection/5 接口"
"在路径 org.freedesktop.DBus.Properties 的对象上没有 /org/freedesktop/NetworkManager/ActiveConnection/4 接口"
"在路径 org.freedesktop.DBus.Properties 的对象上没有 /org/freedesktop/NetworkManager/ActiveConnection/6 接口"
"在路径 org.freedesktop.DBus.Properties 的对象上没有 /org/freedesktop/NetworkManager/ActiveConnection/6 接口"
"在路径 org.freedesktop.DBus.Properties 的对象上没有 /org/freedesktop/NetworkManager/ActiveConnection/7 接口"
"在路径 org.freedesktop.DBus.Properties 的对象上没有 /org/freedesktop/NetworkManager/ActiveConnection/6 接口"
"在路径 org.freedesktop.DBus.Properties 的对象上没有 /org/freedesktop/NetworkManager/ActiveConnection/7 接口"
"在路径 org.freedesktop.DBus.Properties 的对象上没有 /org/freedesktop/NetworkManager/ActiveConnection/6 接口"
"在路径 org.freedesktop.DBus.Properties 的对象上没有 /org/freedesktop/NetworkManager/ActiveConnection/7 接口"
"在路径 org.freedesktop.DBus.Properties 的对象上没有 /org/freedesktop/NetworkManager/ActiveConnection/6 接口"
"在路径 org.freedesktop.DBus.Properties 的对象上没有 /org/freedesktop/NetworkManager/ActiveConnection/7 接口"
"在路径 org.freedesktop.DBus.Properties 的对象上没有 /org/freedesktop/NetworkManager/ActiveConnection/6 接口"

l10n support needed

Plan to add translation for:

  • zh_CN
  • zh_TW
  • ja_JP

Then:

  • Rename translation files and the looking-up mechanism

Please fulfill GPL licence requirements

The package failed rpmlint due to following files do not have licence info while your project licence is GPLv3. Please fix it.

Unknown or generated

danmaQ-ab838667d53c71c6cf8ac94dd109fcd009460530/.travis.yml
danmaQ-ab838667d53c71c6cf8ac94dd109fcd009460530/CMakeLists.txt
danmaQ-ab838667d53c71c6cf8ac94dd109fcd009460530/LICENSE
danmaQ-ab838667d53c71c6cf8ac94dd109fcd009460530/README.md
danmaQ-ab838667d53c71c6cf8ac94dd109fcd009460530/screenshots/window.png
danmaQ-ab838667d53c71c6cf8ac94dd109fcd009460530/screenshots/xiaowang.png
danmaQ-ab838667d53c71c6cf8ac94dd109fcd009460530/src/.ycm_extra_conf.py
danmaQ-ab838667d53c71c6cf8ac94dd109fcd009460530/src/CMakeLists.txt
danmaQ-ab838667d53c71c6cf8ac94dd109fcd009460530/src/danmaQ_app.cpp
danmaQ-ab838667d53c71c6cf8ac94dd109fcd009460530/src/danmaQ_app.h
danmaQ-ab838667d53c71c6cf8ac94dd109fcd009460530/src/danmaku.h
danmaQ-ab838667d53c71c6cf8ac94dd109fcd009460530/src/danmaku_ui.cpp
danmaQ-ab838667d53c71c6cf8ac94dd109fcd009460530/src/danmaku_ui.h
danmaQ-ab838667d53c71c6cf8ac94dd109fcd009460530/src/danmaku_window.cpp
danmaQ-ab838667d53c71c6cf8ac94dd109fcd009460530/src/danmaku_window.h
danmaQ-ab838667d53c71c6cf8ac94dd109fcd009460530/src/icons.qrc
danmaQ-ab838667d53c71c6cf8ac94dd109fcd009460530/src/icons/statusicon.ico
danmaQ-ab838667d53c71c6cf8ac94dd109fcd009460530/src/icons/statusicon.png
danmaQ-ab838667d53c71c6cf8ac94dd109fcd009460530/src/icons/statusicon.svg
danmaQ-ab838667d53c71c6cf8ac94dd109fcd009460530/src/icons/statusicon_disabled.png
danmaQ-ab838667d53c71c6cf8ac94dd109fcd009460530/src/main.cpp
danmaQ-ab838667d53c71c6cf8ac94dd109fcd009460530/src/subscriber.cpp
danmaQ-ab838667d53c71c6cf8ac94dd109fcd009460530/src/subscriber.h
danmaQ-ab838667d53c71c6cf8ac94dd109fcd009460530/tests/CMakeLists.txt
danmaQ-ab838667d53c71c6cf8ac94dd109fcd009460530/tests/json_test.cpp

v0.2.3 Failed to build on Fedora

When compiling following the readme, following error happened.

[zsun@x240 danmaQ-0.2.3]$ mkdir build
[zsun@x240 danmaQ-0.2.3]$ cd build/
[zsun@x240 build]$ cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release
-- The C compiler identification is GNU 7.1.1
-- The CXX compiler identification is GNU 7.1.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for XOpenDisplay in /usr/lib64/libX11.so;/usr/lib64/libXext.so
-- Looking for XOpenDisplay in /usr/lib64/libX11.so;/usr/lib64/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Found X11: /usr/lib64/libX11.so
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/danmaQ-0.2.3/build
[zsun@x240 build]$ make
Scanning dependencies of target translations
[ 5%] Generating ../../../src/translations/zh_CN.qm
/bin/sh: LRELEASE-NOTFOUND: command not found
make[2]: *** [src/translations/CMakeFiles/translations.dir/build.make:63: ../src/translations/zh_CN.qm] Error 127
make[1]: *** [CMakeFiles/Makefile2:216: src/translations/CMakeFiles/translations.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

Versions on my laptop:

qt5-qtxmlpatterns-5.7.1-5.fc26.x86_64
qt5-qtx11extras-5.7.1-3.fc26.x86_64
qt5-qtbase-gui-5.7.1-19.fc26.x86_64
qt-4.8.7-28.fc26.x86_64
qt5-qtsvg-5.7.1-3.fc26.x86_64
qt5-qtwayland-5.7.1-4.fc26.x86_64
qt-settings-26-1.fc26.noarch
qt5-qttools-libs-designer-5.7.1-5.fc26.x86_64
qt5-qtx11extras-devel-5.7.1-3.fc26.x86_64
qt5-qtdeclarative-5.7.1-8.fc26.x86_64
qt5-srpm-macros-5.8.0-2.fc26.noarch
qt5-qtbase-5.7.1-19.fc26.x86_64
qt5-qttools-5.7.1-5.fc26.x86_64
qt5-qttools-common-5.7.1-5.fc26.noarch
qt3-3.3.8b-69.fc26.x86_64
qt5-qtbase-devel-5.7.1-19.fc26.x86_64
qt5-qtdeclarative-devel-5.7.1-8.fc26.x86_64
qt-common-4.8.7-28.fc26.noarch
qt5-rpm-macros-5.8.0-2.fc26.noarch
qt-x11-4.8.7-28.fc26.x86_64
qt5-qtbase-common-5.7.1-19.fc26.noarch
cmake-3.9.0-8.fc26.x86_64

'QString' object has no attribute 'join' ERROR and color setting not work

openSUSE 13.1 64位 KDE桌面
Python 2.7.6
Qt version 4.8.5
发弹幕的时候不显示弹幕且有如下错误。
Traceback (most recent call last):
File "/home/xuxiao/Projects/danmaQ/danmaQ/app.py", line 104, in on_new_danmaku
dm = Danmaku(text, style=style, position=position, parent=self)
File "/home/xuxiao/Projects/danmaQ/danmaQ/danmaq_ui.py", line 67, in init
text = self.escape_text(text)
File "/home/xuxiao/Projects/danmaQ/danmaQ/danmaq_ui.py", line 62, in escape_text
text = re.sub(r'\n', r'\n', text)
File "/usr/lib64/python2.7/re.py", line 151, in sub
return compile(pattern, flags).sub(repl, string, count)
AttributeError: 'QString' object has no attribute 'join'
如果我把danmaq_ui.py", line 67注释掉,可以显示弹幕,但是颜色设置无效(就是说全都是白色弹幕)
@bigeagle 大大说“目测是参数类型不对,再试试?”
经过N次试错……
file danmaq_ui.py, line 67:
text = self.escape_text(text)
change to
text = self.escape_text(unicode(text))

file danmaq_ui.py, line 113:
tcolor, bcolor = color_styles.get(style, color_styles['white'])
change to
tcolor, bcolor = color_styles.get(str(style), color_styles['white'])
不知道是不是根治方法。

danmaQ is not work on RHEL6.5 host

Hi, Not sure you want to fix or not ,I find sth wrong on RHEL6u5 host to run the scripts

packages
kernel-2.6.32-422.el6.x86_64
PyQt4-4.6.2-9.el6.x86_64
qt-4.6.2-28.el6_5.x86_64
python-2.6.6-52.el6.x86_64

Each time I send shoot in wechat ,it will shows :
$ python danmaQ.py
Traceback (most recent call last):
File "/home/bcao/git/danmaQ/danmaQ/app.py", line 126, in on_subscription_started
"Subscribing danmaku from {}".format(self.workThread.server)
ValueError: zero length field name in format
Traceback (most recent call last):
File "/home/bcao/git/danmaQ/danmaQ/app.py", line 103, in on_new_danmaku
dm = Danmaku(text, style=style, position=position, parent=self)
File "/home/bcao/git/danmaQ/danmaQ/danmaq_ui.py", line 74, in init
self.init_text(text, style)
File "/home/bcao/git/danmaQ/danmaQ/danmaq_ui.py", line 93, in init_text
effect = QtGui.QGraphicsDropShadowEffect(self)
AttributeError: 'module' object has no attribute 'QGraphicsDropShadowEffect'

RFE: Way to exit when transparent compositor is no supported/enabled

Description:
A elegant way to exit the danmaQ client is needed when there are no transparent support or transparent compositor is not enabled for the desktop environment.

Environment
Fedora 29, LXQt 0.14.1. Compton not running.

Steps to reproduce:
If I launch danmaQ without compton enabled, the whole screen will be black (with the mouse still visible). I cannot terminate the program in an elegant way. And I have to switch to another console to kill danmaQ.
I know compositor is needed for danmaQ to run, but I still suggest to make it possible for people that happen to run without transparent support to quit in a straightforward way, rather than kill it by command.

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.