Skip to content

Commit

Permalink
fix(app): modify details and documents
Browse files Browse the repository at this point in the history
- 修复 可能的程序关闭后线程未退出问题
- 修复 可能的登录状态持久化问题
- 完善 README 文档
- 完善 GitHub Actions 步骤
- 微调 前端样式
- 移除 Rate Limit 和 Cache 拓展
  • Loading branch information
txperl committed Dec 31, 2022
1 parent 1ba96cb commit d6b1819
Show file tree
Hide file tree
Showing 11 changed files with 43 additions and 223 deletions.
29 changes: 14 additions & 15 deletions .github/workflows/pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,22 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
# os: [windows-2019, windows-2019, macos-10.15, ubuntu-18.04]
include:
- os: windows-2019
- os: windows-2022
version: win_x64
pythonArch: 'x64'
- os: windows-2019
- os: windows-2022
version: win_x86
pythonArch: 'x86'
- os: macos-10.15
- os: macos-11
version: mac
pythonArch: 'x64'
- os: ubuntu-18.04
- os: ubuntu-20.04
version: ubuntu_x64
pythonArch: 'x64'

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Classify files, prepare to be packaged
run: |
Expand All @@ -59,10 +58,10 @@ jobs:
cp ./LICENSE ./.pkg/public/
cp ./README.md ./.pkg/public/
- name: Setup Python 3.7
uses: actions/setup-python@v2.2.2
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.7
python-version: 3.8
architecture: ${{ matrix.pythonArch }}

- name: Install Requirements
Expand All @@ -76,21 +75,21 @@ jobs:
python ./py-pkger.py auto
- name: Compress to ZIP (win)
if: ${{ matrix.os == 'windows-2019' }}
if: ${{ matrix.version == 'win_x64' || matrix.version == 'win_x86' }}
run: |
cd ./.pkg/dist/
mv ./main.exe ./PixivBiu.exe
Compress-Archive * ../../${{ matrix.version }}.zip
- name: Compress to ZIP (mac)
if: ${{ matrix.os == 'macos-10.15' || matrix.os == 'ubuntu-18.04' }}
- name: Compress to ZIP (unix-like)
if: ${{ matrix.version == 'mac' || matrix.version == 'ubuntu_x64' }}
run: |
cd ./.pkg/dist/
mv ./main ./PixivBiu
zip -r ../../${{ matrix.version }}.zip *
- name: Upload to Artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: pixivbiuArt
path: ./${{ matrix.version }}.zip
Expand All @@ -99,10 +98,10 @@ jobs:
needs: [build-on-platform]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Download from Artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: pixivbiuArt

Expand Down
10 changes: 2 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,16 @@ PixivBiu 是一款不错的 Pixiv **辅助**工具。
* Pixiv 搜索,可免会员按收藏数、人气、日期排序
* 下载原始图片,包括插画、漫画、动图
* 多种下载模式,单、多线程模式以及 aria2 支持
* 筛选图片的宽高、宽高比、类型、时间、标签等
* 获取用户的作品、收藏夹、关注列表、推荐等
* 获取排行榜,包括今日、本周、本月、指定日期等
* 收藏作品、关注等
* 筛选图片的宽高、类型、标签等

## 使用

### 源码

* 安装依赖,执行 `pip install -r requirements.txt`
+ [Flask](https://github.com/pallets/flask)[requests](https://github.com/psf/requests)[PyYAML](https://github.com/yaml/pyyaml)[Pillow](https://github.com/python-pillow/Pillow)[PixivPy](https://github.com/upbit/pixivpy)[PySocks](https://github.com/Anorov/PySocks)
* 修改 `./config.yml` 相关配置选项,具体可参考[默认配置文件](./app/config/biu_default.yml)
* 修改 `./config.yml` 相关配置项,具体可参考[默认配置文件](./app/config/biu_default.yml)
* 执行 `python main.py`
* 访问运行地址,默认为 `http://127.0.0.1:4001/`

Expand All @@ -37,10 +35,6 @@ PixivBiu 是一款不错的 Pixiv **辅助**工具。

- [Docker_Buildx_PixivBiu](https://github.com/zzcabc/Docker_Buildx_PixivBiu) by [zzcabc](https://github.com/zzcabc)

## 文档

目前已有**使用、API**类文档,如有需要请访问[这里](https://biu.tls.moe/)

## 贡献维护

如果你想参与此项目的开发,欢迎查看[开发文档](https://biu.tls.moe/#/develop/quickin)
Expand Down
10 changes: 2 additions & 8 deletions README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ PixivBiu is a nice Pixiv **assistant** tool.
* Pixiv searching, sort by favorites, popularity and date without membership
* Download original images, including illustrations, comics and motion pictures
* Multiple download modes, single and multi-threaded mode and aria2 support
* Filter image width, height, scale, type, time and tags
* Get user's works, favorites, followers, recommendations
* Get rankings, including today, week, month, and specific date
* Favorite works and followers
* Get user's works, favorites, followers, recommendations and etc.
* Filter image width, height, type, tags and etc.

## Usage

Expand All @@ -37,10 +35,6 @@ They can be downloaded in [GitHub Releases](https://github.com/txperl/PixivBiu/r

- [Docker_Buildx_PixivBiu](https://github.com/zzcabc/Docker_Buildx_PixivBiu) by [zzcabc](https://github.com/zzcabc)

## Document

Currently, there are only **usage and API** documents, please visit [here](https://biu.tls.moe/) if you need it.

## Contribution

If you want to participate in the development of this project, you are welcome to check [development document](https://biu.tls.moe/#/develop/quickin).
Expand Down
8 changes: 1 addition & 7 deletions README_JA.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ PixivBiuはPixivのための**補助的な**ツールです。
* お気に入り数(会員の除外可)順や人気順でのPixiv検索
* イラスト/漫画/うごイラを含む画像のオリジナル画質でのダウンロード
* シングル/マルチスレッドや [aria2](https://github.com/aria2/aria2) などでのダウンロード
* 画像の幅、高さ、アスペクト比、タイプ、時間、ラベルなどをフィルタリングします
* 指定したユーザの投稿作品/ブックマーク/フォロワー/関連するおすすめなどの取得
* 当日/週間/月間/特定の日付別などでのランキングの取得
* ブックマークやフォロー中のユーザなどの取得
* 画像の幅、高さ、タイプ、ラベルなどをフィルタリングします

## 使い方

Expand All @@ -37,10 +35,6 @@ Windows 版と macOS 版が利用可能ですが、もし必要であれば自

- [Docker_Buildx_PixivBiu](https://github.com/zzcabc/Docker_Buildx_PixivBiu) by [zzcabc](https://github.com/zzcabc)

## ドキュメント

現在,**使い方とAPI**のドキュメントのみがあります,必要に応じて[こちら](https://biu.tls.moe/)をご参照ください。

## 貢献

もしこのプロジェクトの開発に参加したいのであれば、お気軽に[開発ドキュメント(中文)](https://biu.tls.moe/#/develop/quickin)をご参照ください。
Expand Down
20 changes: 0 additions & 20 deletions app/config/switch.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,12 @@
# 开启或停用模块
# true 为开启,false 为停用
OnOff:
ins:
cache.py: false
pre:
rate_limit.py: false
# rate limit 预处理,开启后请修改下方相关配置
verify_referrer.py: false
# 简单防盗链预处理,开启后请修改下方相关配置

# 预处理安全相关
Security:
# rate limit 相关设置
rateLimit:
maxRequests: 30
# 一个 timeSecond 内同一 IP 允许的最大请求数

timeSeconds: 60
# 时间周期,单位为秒

allowOrigin:
# 以下 IP 可无视上述规则
- 127.0.0.1

banOrigin:
# 以下 IP 会被拒绝请求
- null

# 防盗链相关设置
onlyReferrer:
type: ban
Expand Down
10 changes: 6 additions & 4 deletions app/lib/core/biu.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import atexit
import os
import platform
import sys
Expand All @@ -14,7 +15,7 @@
@interRoot.bind("biu", "LIB_CORE")
class CoreBiu(interRoot):
def __init__(self):
self.ver = 206001
self.ver = 206010
self.place = "local"
self.sysPlc = platform.system()
self.api_route = "direct"
Expand All @@ -32,10 +33,8 @@ def __init__(self):
self.STATUS = {"rate_search": {}, "rate_download": {}}
self.auto()

def __del__(self):
self.pool_srh.shutdown(False)

def auto(self):
atexit.register(self.__before_exit)
self.__load_config() # 加载配置项
self.__pre_check() # 运行前检测
self.proxy = self.__get_system_proxy() # 加载代理地址
Expand All @@ -48,6 +47,9 @@ def auto(self):
self.__show_ready_info() # 展示初始化完成信息
return self

def __before_exit(self):
self.pool_srh.shutdown(False)

def __load_config(self):
"""
加载 pixivbiu 的全局配置项。
Expand Down
98 changes: 0 additions & 98 deletions app/lib/ins/cache.py

This file was deleted.

36 changes: 0 additions & 36 deletions app/pre/rate_limit.py

This file was deleted.

2 changes: 1 addition & 1 deletion usr/static/multiverse/assets/css/n.css
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@
.poptrox-popup .caption {
position: fixed;
background-image: none;
text-shadow: 0 0 15px #000;
}

.poptrox-popup:before {
Expand All @@ -215,7 +216,6 @@

.poptrox-popup .nav-previous,
.poptrox-popup .nav-next {
position: fixed;
display: block !important;
filter: drop-shadow(0 0 3px rgb(0, 0, 0));
}
Expand Down
Loading

0 comments on commit d6b1819

Please sign in to comment.