mirror of
https://github.com/amtoaer/bili-sync.git
synced 2026-05-08 01:02:49 +08:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
650498d4a1 | ||
|
|
96ff84391d | ||
|
|
44e8a2c97d |
18
README.md
18
README.md
@@ -1,4 +1,6 @@
|
||||
# bili-sync
|
||||

|
||||
|
||||
## 简介
|
||||
|
||||
为 NAS 用户编写的 BILIBILI 收藏夹同步工具,可方便导入 EMBY 等媒体库工具浏览。
|
||||
|
||||
@@ -82,6 +84,20 @@ services:
|
||||
}
|
||||
```
|
||||
|
||||
## 支持的额外命令
|
||||
|
||||
为满足需要,该应用包含几个单独的命令,可在程序目录下使用 `python entry.py ${command name}` 运行。
|
||||
|
||||
1. `once`
|
||||
|
||||
处理收藏夹,和一般定时任务触发时执行的操作完全相同,但仅运行一次。
|
||||
2. `recheck`
|
||||
|
||||
将本地不存在的视频文件标记成未下载,下次定时任务触发时将一并下载。
|
||||
3. `upper_thumb`
|
||||
|
||||
手动触发全量下载 up 主头像,为使用老版本时下载的没有 up 头像的视频添加头像。
|
||||
|
||||
## 路线图
|
||||
|
||||
- [x] 凭证认证
|
||||
|
||||
20
processor.py
20
processor.py
@@ -81,16 +81,16 @@ async def manage_model(medias: list[dict], fav_list: FavoriteList) -> None:
|
||||
|
||||
async def process() -> None:
|
||||
global anchor
|
||||
if (
|
||||
today := datetime.date.today()
|
||||
) > anchor and await credential.check_refresh():
|
||||
try:
|
||||
await credential.refresh()
|
||||
anchor = today
|
||||
logger.info("Credential refreshed.")
|
||||
except Exception:
|
||||
logger.exception("Failed to refresh credential.")
|
||||
return
|
||||
if (today := datetime.date.today()) > anchor:
|
||||
anchor = today
|
||||
logger.info("Check credential.")
|
||||
if await credential.check_refresh():
|
||||
try:
|
||||
await credential.refresh()
|
||||
logger.info("Credential refreshed.")
|
||||
except Exception:
|
||||
logger.exception("Failed to refresh credential.")
|
||||
return
|
||||
for favorite_id in settings.favorite_ids:
|
||||
if favorite_id not in settings.path_mapper:
|
||||
logger.warning(
|
||||
|
||||
Reference in New Issue
Block a user