用于 blivechat 的图形界面

Overview

blivechat GUI

用于 blivechat 的图形界面。

有朋友在搞 Vtuber,像 blivechat 类似的项目能通过自定义 CSS 的方式在 OBS 上添加一个非常好看的聊天栏。但是想要在桌面端看到弹幕的话得要再开一个浏览器页面,十分不方便。就想写一个背景透明的浮窗浏览器。
挺喜欢自带服务端的 blibechat, 但是启动后的 Console 窗口不仅丑,还容易误操作,所以就花了点时间写了个UI。

写完了之后 xfgryujk 觉得这个 PR 太大,就只好独立出来,于是就有了这个项目。

桌面截图 游戏截图
桌面截图 游戏截图

特性

  • 添加了控制台图形窗口;
  • 添加了托盘图标,控制台关闭自动缩小到托盘窗口防手滑
  • 添加网页悬浮窗,可以当成桌面弹幕姬来用:
    • 可以配置屏蔽,就像 bilivechat 自动弹窗的管理页面一样;
    • 可以添加自定义 CSS;
    • CSS 设置的不透明度会正常生效;
    • 可调整页面位置、大小和缩放;
  • 没有改动 blivechat 原有的代码,维护成本低;
  • blivechat 原先的命令行参数会正常生效。

使用方法

理论上来说,只要启动时 --host--port 配置合理,网络的其他计算机能通过这个端口连接进来,那也是可以像 blivechat 那样搭成服务器供别人使用。但既然打算去搭建服务器了,Docker不香嘛?

一、发布版

  1. 下载发布版(仅提供x64 Windows版)
  2. 双击 blivechatGUI.exe 运行,也可以像 blivechat 那样添加命令行参数。
blivechatGUI.exe --host 127.0.0.1 --port 12450

二、源代码版

  1. 由于使用了git子模块,clone时需要加上--recursive参数:

blivechatGUI 包含了 blivechat, blivechat 包含了 blivedm。

git clone --recursive https://github.com/sileence114/blivechatGUI.git

如果已经clone,拉子模块的方法:

git submodule update --init --recursive
  1. 安装依赖(Python 3.6+):
pip install -r requirements.txt
  1. 将 blivechat 的代码提取到项目根目录:

由于 blivechat 中并没有将模块文件夹定义为包,所以 blivechatGUI 的文件需要与 blivechat 的入口文件在同一个目录中。

python extract.py
  1. 编译前端(需要安装Node.js):
cd frontend
npm i
npm run build
  1. 运行
    如果想要看 Console 窗口, 请将下面命令中的 pythonw 替换为 python
pythonw gui.py

或者可以指定host和端口号:

pythonw gui.py --host 127.0.0.1 --port 12450

启动命令行参数

blivechatGUI 支持 blivechat 的所有命令行参数:

  • --host 127.0.0.1 设置监听地址为 127.0.0.1
  • --port 12450 设置监听端口为 12450
  • --debug Debug 模式,将显示更多的信息

此外,可以参考 Chromium 命令行开关,添加需要的参数用以修改浮窗浏览器。
下面这些参数已被默认添加:

  • --disable-web-security 禁用网页安全机制:跨域
  • --allow-insecure-websocket-from-https-origin 允许https页面访问不加密的websocket: https页面使用ws消息链连接

下面的参数在 Debug 模式自动添加:

  • --remote-debugging-port=9222 设置 DevTools 远程调试端口为 9222

CSS 代码段

若有需要,可以将 CSS 保存,在悬【浮窗设置】-【额外的CSS】中添加。
若 Github 访问稳定,可复制 CSS 链接,通过【添加路径】按钮添加网络上的 CSS。

上文的桌面截图用了背景透明隐藏滚动条显示虚线边框

  • 背景透明 transparent.css 若没有自定义 CSS,悬浮窗的背景为白色属于正常现象,添加这段 CSS 可变透明。这段代码会覆盖其他 CSS 的背景色设置,添加了其他 CSS 时慎用。

    body{
      background-color: transparent !important;
    }
    yt-live-chat-renderer {
      background-color: transparent !important;
    }
  • 隐藏滚动条 hide-scrollbar.css 这个仅适用于 Chromium 和 Safari。

    body::-webkit-scrollbar {
      display: none;
    }
  • 显示虚线边框 border.css

    body{
      border: dotted;
    }
  • 渐变配色 gradient-back-ground.css

    上文的游戏截图就是这个 CSS,太长,就不贴了。

PyInstaller 打包

  1. 按照前文所述,安装源代码版,确保其正常运行
  2. 安装 PyInstaller,过程略
  3. cd 到项目根目录,打包
pyinstaller -D -w -i frontend\dist\favicon.ico -n blivechatGUI --add-data=".\data\*;.\data" --add-data=".\frontend\dist;.\frontend\dist" --add-data=".\log;.\log" gui.py
  1. 项目中出现了 dist 文件夹,将文件夹 dist\blivechatGUI\PyQt5\Qtdist\blivechatGUI\PyQt5\Qt5 合并(合并后文件夹为 Qt5)。
  2. dist\blivechatGUI 就是打包输出,可以压缩成 zip 分享出去。
You might also like...
Releases(v1.0.0)
Owner
Silence
Silence
AWBW Replay Parser - a Python package to open and step through AWBW game replays.

AWBW Replay Parser This repository is home to the AWBW Replay Parser, a Python package to open and step through AWBW game replays. This project is una

Tarkan Al-Kazily 2 Feb 09, 2022
The main objective of the game is to destroy multiple waves of asteroids with the help of a blaster mounted on the spaceship.

Astronomia: let the exploration begin The main objective of the game is to destroy multiple waves of asteroids with the help of a blaster mounted on t

Aryan Nath 8 Nov 18, 2022
An environment to run atari-like games in VGDL.

vgdl An environment to run atari-like games in VGDL. Requirements python = 3.6 Installation pip install -r requirements.txt Usage # Create an enviro

Sergio Arnaud Gomez 1 Dec 24, 2021
An interactive pygame implementation of quadtree spatial quantization

QuadTree-py An interactive pygame implementation of quadtree spatial quantization Contents Installation Usage API Reference TODO Installation Clone th

Ethan 1 Dec 05, 2021
PingPong - Simple Ping Pong Game Made In Python

PingPong Basic Ping Pong Game Made In Python

ʀᴇxɪɴᴀᴢᴏʀ 1 Jan 01, 2022
🍦 Cheat for cs:go written in Python.

Cs::Fuck 🍦 Cheat for cs:go written in Python. You can show a video here: https://vimeo.com/642730650 Feature. TriggerBot Glow Esp NoFlash Setup. 0. p

Ѵιcнч 10 Sep 23, 2022
This is a python bot to automate BombCrypto game

This is a python bot to automate BombCrypto game. Logs in to the game, reconnects when needed, closes error warnings, sends heroes to work or home automatically, has Telegram integration and lets you

AFKAPP 39 Sep 28, 2022
Useful guides, tutorials, and FAQs related to LEGO Universe and Darkflame Universe.

Awesome Lego Universe A curated list of awesome things related to LEGO Universe. LEGO Universe was a kid-friendly massively-multiplayer online role pl

Eric Myllyoja 33 Dec 12, 2022
Tic-Tac-Toe Game in python3 Tkinter

Tic Tac Toe Tic-Tac-Toe Game in python3 Tkinter About: Tic Tac Toe or Noughts and Crosses as called in British is a pencil and paper game for two play

Sai Swarup Yakkala 5 Nov 06, 2022
Wordle for the terminal, writen in python

Wordle Wordle in the terminal, written in python Simply run bash run.sh in your terminal to run. This creates a virtual environment, installs the depe

Matthew Lidell 1 Feb 09, 2022
Wordle is a word game reminiscent of mastermind

Wordle is a word game reminiscent of mastermind. The player tries to guess a five letter word within six attempts. After each attempt, hints are given. Green tiles show that the letter is in the righ

Sidharth Anand 1 Feb 09, 2022
AI based assitant for minecarft

Minecraft_AI_assistant AI-based assistant for Minecraft There are 4 steps to build 1-I'm using collecting_data.png as a structure to take shots with c

Murat Ali Avcu 13 Oct 16, 2022
Game Boy emulator written in Python

If you have any questions, or just want to chat, join us on Discord. It is highly recommended to read the report to get a light introduction to Game B

Mads Ynddal 3.7k Dec 30, 2022
This is a python interactive story game that I made to show off what I've learnt in python coding for a month

Purpose The files in this repository are for that of a story game created with python version 3.8.5 The purpose of this project was to get familiar wi

0 Dec 30, 2021
Super Mario Kart November 1991 Prototype Repair by MrL314

Super Mario Kart November 1991 Prototype Repair by MrL314

MrL314 51 Dec 26, 2022
2DMC is an abrrieviation for 2 Dimensional Minecraft.

2DMC 2DMC is an abrrieviation for 2 Dimensional Minecraft. This idea is originally created and implemented by Griffpatch on Scratch. This is a persona

DaNub 5 Nov 06, 2022
Pygame Raycaster made by me.

Pygame Raycaster made by me.

Sable 0 Jan 10, 2022
Jiminy, fast and portable Python/C++ simulator of poly-articulated systems with OpenAI Gym interface for reinforcement learning.

Jiminy is a fast and portable cross-platform open-source simulator for poly-articulated systems. It was built with two ideas in mind: provide a fast y

Alexis DUBURCQ 122 Dec 29, 2022
Fully functional BlackJack game with a graphical user interface.

BlackJack Welcome to BlackJack! This game is fully functional, with a casino sound package integrated using Pygame, dynamic game logic developed using

Shwetang Desai 2 Jan 10, 2022
A Replit Game Know As ROCK PAPER SCISSOR AND ALSO KNOW AS STONE PAPER SCISSOR

🔥 ᴿᴼᶜᴷ ᴾᴬᴾᴱᴿ ᔆᶜᴵᔆᔆᴼᴿ 🔥 ⚙️ Rᴜɴ Oɴ Rᴇᴘʟɪᴛ 🛠️ Lᴀɴɢᴜᴀɢᴇs Aɴᴅ Tᴏᴏʟs If you are taking code from this repository without a fork, then atleast give credit

ANKIT KUMAR 1 Dec 25, 2021