Giter Site home page Giter Site logo

knightreport's Introduction

坎公骑冠剑——超级骑士报表

  • 想知道自己总共出了多少刀?
  • 想知道自己是哪天忘记了出刀?
  • 想看看是哪个群友天天在抢怪?
  • 会长想鲨人却不知道该鲨谁?是谁?是谁在摸鱼?

为了解决bigfun接口缺乏统计功能的问题,特推出开箱即用的会战报表系统!

只需要双击一下,就可以生成详细的会战报表,方便大家详细了解自己的总出刀数、对各个boss出刀数、缺刀日期等数据。

准备工作

  • 如果从Windows系统运行,需要准备好Chrome浏览器或者Edge浏览器(二选一即可)
  • 如果从MacOS系统运行,需要准备好Chrome浏览器(必要)
  • 如果需要从源码运行,除上述需求以外,还需要运行pip install -f requirments.txt安装依赖项
  • 如果需要从源码打包,除上述需求以外,同样需要运行pip install -f requirments.txt安装依赖项

如何运行

有三种方法可以使用到本程序功能:

直接运行

  • 如果使用的是Windows系统,从Releases中下载可执行文件KnightReport-win.exe,双击运行

  • 如果使用的是MacOS系统,从Releases中下载可执行文件KnightReport-mac.dmg,双击挂载后进入,双击KnightReport-mac运行

从源码运行

执行以下命令

mkdir tmp
cd tmp
python ../src/main.py

从源码打包

下载源码后,运行build.ps1进行打包,可执行文件将会在当前目录下的tmp/dist/KnightReport.exe

使用方法

  1. 程序会启动bigfun的登录界面,如果是未登录状态,点击bilibili账号登录开始正常登录流程
  2. 确认登陆完成后,可以关闭网页,等待程序结束
  3. 如果已经是登陆状态,可以直接关闭网页

对于MacOS系统,因为程序需要访问密码串,可能要求多次输入密码,也可以输入一次密码后选择信任本程序。

日志将会生成在当前目录下的KnightReport.log

错误信息将会生成在当前目录下的KnightReport.err

会战报表将会生成在当前目录下的report.csv

注意事项

需要注意的是,在Windows系统下,程序会优先尝试使用Chrome浏览器,如果启动失败,会再次尝试启动Edge浏览器。

在MacOS系统下,程序只会尝试启动Chrome浏览器。

如果无法启动浏览器,或启动浏览器后仍无法获得cookies(例如遇到BrowerCookiesError错误),请参考从文件输入cookies

数据描述

报表中有以下数据:

题头 描述
uid 玩家uid
玩家 玩家用户名
出刀 本次会战期间玩家总出刀次数
伤害 本次会战期间玩家总造成伤害
尾刀 本次会战期间玩家出刀中的尾刀次数
均伤(除尾刀) 本次会战期间玩家每刀平均伤害(除去尾刀以外)
XXX出刀 本次会战期间玩家对XXX(boss名)出刀次数
XXX伤害 本次会战期间玩家对XXX(boss名)造成伤害
YYYY-MM-DD漏刀 玩家在YYYY-MM-DD(日期)漏刀次数(-1为本日只出了2刀,-2为本日只出了一刀,-3为本日未出刀,无漏刀不显示)

使用到的接口

为方便二次开发,特提供可用的WEB API

定义在constants.py中:

# 用于人工介入的用户登录
# web API for user login
LoginURL = 'https://www.bigfun.cn/tools/gt/'

# 用于读取公会成员数据和会战日期区间
# web API for guild status
GuildStatusURL = "https://www.bigfun.cn/api/feweb?target=kan-gong-guild-log-filter%2Fa"

# 用于读取每日会战数据(需要日期参数)
# web API for combat status(need argument date)
DateStatusURL = "https://www.bigfun.cn/api/feweb?target=kan-gong-guild-report%2Fa&date={:s}"

平台测试

已经在以下平台上测试通过

program version
Windows 10(19042.1110)
Python 3.9.4
browser-cookies 0.12.1
pyinstaller 4.5.1

特别鸣谢

bigfun坎公百宝袋提供了全部API支持

browser-cookies提供了获得本地浏览器cookies的方案

knightreport's People

Contributors

cutecutecat avatar qiruihuang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

knightreport's Issues

希望能加入尾刀计算一栏

首先谢谢作者,这工具非常好用。建议新增尾刀次数,bigfun百宝袋会把尾刀标红,尾刀次数也是计算工会成员最终伤害的一个重要参数

[BUG]在启用代理的情况下并未正常生成报表

软件版本:0.9

我使用的Chrome是canany版,并未正确识别到,成功打开edge浏览器,网页数据一切正常,但并未生成报表(静默等待5分钟)

日志:
KnightReport.log

2021-11-16 22:23:24,705 - main.py[line:23] - INFO: 坎公骑冠剑————超级骑士报表————v0.9
2021-11-16 22:23:24,705 - main.py[line:24] - INFO: by [ NGA | bigfun | TapTap ]@星星星痕
2021-11-16 22:23:24,705 - main.py[line:25] - INFO: 如有疑问或建议可以到https://github.com/cutecutecat/KnightReport提交issue
2021-11-16 22:23:24,705 - browser\intro.py[line:9] - INFO: 开始尝试,获得用户cookies
2021-11-16 22:23:26,889 - browser\method_auto.py[line:42] - WARNING: 尝试启动chrome浏览器失败
2021-11-16 22:23:26,890 - browser\method_auto.py[line:39] - INFO: 成功启动edge浏览器

KnightReport.err.log

Traceback (most recent call last):
  File "urllib3\connectionpool.py", line 696, in urlopen
  File "urllib3\connectionpool.py", line 964, in _prepare_proxy
  File "urllib3\connection.py", line 364, in connect
  File "urllib3\connection.py", line 501, in _connect_tls_proxy
  File "urllib3\util\ssl_.py", line 453, in ssl_wrap_socket
  File "urllib3\util\ssl_.py", line 495, in _ssl_wrap_socket_impl
  File "ssl.py", line 500, in wrap_socket
  File "ssl.py", line 1040, in _create
  File "ssl.py", line 1309, in do_handshake
ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:1129)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "requests\adapters.py", line 439, in send
  File "urllib3\connectionpool.py", line 755, in urlopen
  File "urllib3\util\retry.py", line 574, in increment
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='www.bigfun.cn', port=443): Max retries exceeded with url: /api/feweb?target=kan-gong-guild-log-filter%2Fa (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "main.py", line 28, in <module>
  File "browser\intro.py", line 21, in initBrowser
  File "browser\method_auto.py", line 62, in fetch_cookies
  File "requests\api.py", line 75, in get
  File "requests\api.py", line 61, in request
  File "requests\sessions.py", line 542, in request
  File "requests\sessions.py", line 655, in send
  File "requests\adapters.py", line 514, in send
requests.exceptions.SSLError: HTTPSConnectionPool(host='www.bigfun.cn', port=443): Max retries exceeded with url: /api/feweb?target=kan-gong-guild-log-filter%2Fa (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)')))

国内镜像支持

通过github action支持自动打包文件上传到gitee,提供下载链接给国内无法访问github的用户

对于数据源异常出刀数据的自动修正

已查明,有时数据源会显示某人某天出刀4,一般是因为他前一天出过跨日刀,本刀会占用前一天的出刀次数,但会显示在后一天的出刀结果中,因此会造成两天各打了2刀和4刀的情况

修正方案:如果某日出刀数量==4,检查前一天出刀数,若为3-x刀,将本日第一刀数据移动到前一天,计3-x+1和3

  • 部署修正方案
  • #11

生成原生xlsx格式报表

以前是考虑不能引入过多库造成体积增加,现在可执行文件已经很大了,就这样加进去也不会有多大影响啦~

  • 修改相关生成代码

  • 人工测试通过

报错了

Traceback (most recent call last):
File "main.py", line 22, in
File "ctrl.py", line 47, in exec
File "utils.py", line 74, in marshal
File "utils.py", line 74, in
File "utils.py", line 34, in to_list
File "utils.py", line 34, in
KeyError: 1

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.