cp0204 / quark-auto-save Goto Github PK
View Code? Open in Web Editor NEW夸克网盘签到、自动转存、命名整理、发推送提醒和刷新媒体库一条龙
License: GNU Affero General Public License v3.0
夸克网盘签到、自动转存、命名整理、发推送提醒和刷新媒体库一条龙
License: GNU Affero General Public License v3.0
本项目的 README 已经非常清晰,初次搭建遇到问题,请先确认自己是否按文档说明正确配置!
开放 Issue 主要为了提供 bug 和建议的反馈渠道。 本项目纯粹用爱发电,无休止地使用咨询只会消耗开发者的热情。 个人使用问题,例如不会搭建、不会配置、正则表达式写法,请自行解决!或付费咨询。
提 Issue 请带上你的复现步骤、配置和log等,这有助于我快速定位问题。毕竟,如果你连提供必要信息都嫌麻烦,又怎么能指望别人积极地帮你解决问题呢?
希望推送消息中的分享链接失效、分享取消等转存失败的提示,加粗变红色(或者其他颜色)提示
{}
text
Docker
No response
看转存的日志是转存成功的,但是网盘里面没有文件
保存结果 {'status': 200, 'code': 0, 'message': 'ok', 'timestamp': 1709018260, 'data': {'task_id': '0888b7cdfdc04931bdbf9ae5ac4a9f70'}, 'metadata': {'tq_gap': 500}}
已经在环境变量里添加了QUARK_COOKIE,cookie应该填的是正确的,复制了整段cookie,我用alist挂载夸克网盘用的也是这个cookie,请教是什么原因造成的?我只需要签到,谢谢!
===============程序开始===============
⏰ 执行时间: 2024-04-29 20:34:25
⚙️ 正从 quark_config.json 文件中读取配置
===============签到任务===============
📢 👤 第1个账号登录失败,cookie无效❌
===============推送通知===============
【夸克自动追更】
👤 第1个账号登录失败,cookie无效❌
===============程序结束===============
😃 运行时长: 0.47s
Qinglong
Qinglong 2.16.5, Docker 版本 20.10.17
之前单独拉通知模块依赖,是因为原青龙通知模块不支持自定义通知渠道,本项目对模块进行了改造。
经过向上游PR合并, 青龙 v2.17.1 后可直接导入使用。
Traceback (most recent call last):
File "/app/./quark_auto_save.py", line 898, in
main()
File "/app/./quark_auto_save.py", line 876, in main
do_save(accounts[0], [tasklist[task_index]])
File "/app/./quark_auto_save.py", line 814, in do_save
is_rename = account.do_rename_task(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/./quark_auto_save.py", line 632, in do_rename_task
is_rename_count += self.do_rename_task(
^^^^^^^^^^^^^^^^^^^^
File "/app/./quark_auto_save.py", line 626, in do_rename_task
self.savepath_fid[savepath] = self.get_fids([savepath])[0]["fid"]
~~~~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range
Qinglong
v0.2.9.10
小白表示看不懂啊,或者可以付费代搭建吗!?
{}
text
Qinglong
No response
希望递归更新 子文件夹时,继续沿用正则替换表达式
此为转存成功
{
"taskname": "C春S寄Q人4K(2024)剧情 李现 周雨彤",
"shareurl": "https://pan.quark.cn/s/1a58abce0270",
"savepath": "/影剧综/剧集/更新中剧集/C春S寄Q人4K(2024)剧情 李现 周雨彤",
"pattern": "",
"replace": "",
"enddate": "2026-01-01",
"emby_id": "",
"ignore_extension": false,
"runweek": [
1,
2,
3,
4,
5,
6,
7
],
"update_subdir": "4K"
}
此为转存失败
{
"taskname": "C春S寄Q人4K(2024)剧情 李现 周雨彤",
"shareurl": "https://pan.quark.cn/s/1a58abce0270",
"savepath": "/影剧综/剧集/更新中剧集/C春S寄Q人4K(2024)剧情 李现 周雨彤",
"pattern": "(.*?)(_【DDGGKAA】)*\\.(.*)",
"replace": "\\1_【DDGGKAA】.\\3",
"enddate": "2026-01-01",
"emby_id": "",
"ignore_extension": false,
"runweek": [
1,
2,
3,
4,
5,
6,
7
],
"update_subdir": "4K"
}
Docker
No response
"taskname": "W微暗之火4K(2024)童瑶 张新成",
"shareurl": "https://pan.quark.cn/s/cfddd076f697#/list/share",
"savepath": "/影剧综/剧集/更新中剧集/W微暗之火4K(2024)童瑶 张新成",
"pattern": "(.*)\\.(mp4|mkv)$",
"replace": "\\1_【DDGGKAA】.\\2",
"enddate": "2026-01-01",
"emby_id": "",
"ignore_extension": false,
"runweek": [
1,
2,
3,
4,
5,
6,
7
],
"update_subdir": "4K"
"taskname": "W微暗之火4K(2024)童瑶 张新成",
"shareurl": "https://pan.quark.cn/s/cfddd076f697#/list/share",
"savepath": "/影剧综/剧集/更新中剧集/W微暗之火4K(2024)童瑶 张新成",
"pattern": "(.?)(_【DDGGKAA】)\.(.*)",
"replace": "\1_【DDGGKAA】.\3",
"enddate": "2026-01-01",
"emby_id": "",
"ignore_extension": false,
"runweek": [
1,
2,
3,
4,
5,
6,
7
],
"update_subdir": "4K"
Qinglong
No response
Traceback (most recent call last):
File "/app/./quark_auto_save.py", line 911, in
main()
File "/app/./quark_auto_save.py", line 891, in main
do_save(accounts[0], tasklist)
File "/app/./quark_auto_save.py", line 827, in do_save
is_rename = account.do_rename_task(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/./quark_auto_save.py", line 630, in do_rename_task
self.do_rename_task(task, f"{subdir_path}/{dir_file['file_name']}")
File "/app/./quark_auto_save.py", line 625, in do_rename_task
dir_file_list = self.ls_dir(self.savepath_fid[savepath])
~~~~~~~~~~~~~~~~~^^^^^^^^^^
KeyError: '/影剧综/电影/Y养蜂人 The Beekeeper (2024)[4KHQ60FP杜比视界][动作 惊悚]'
{}
text
Docker
No response
从报错信息中,我们可以看出这个Python脚本在执行过程中遇到了一个IndexError: list index out of range
错误。这意味着代码尝试访问一个不存在的列表元素。具体来说,问题出现在以下代码行:
self.savepath_fid[savepath] = self.get_fids([savepath])[0]["fid"]
问题出现在调用self.get_fids([savepath])
时,这个方法返回的列表为空,所以尝试访问列表的第一个元素[0]
时就会引发IndexError
。
要解决这个问题,我们需要:
self.get_fids([savepath])
返回了一个空列表。首先,确保self.get_fids([savepath])
应该返回什么。如果它应该返回包含“fid”的字典列表,我们需要检查:
savepath
是否正确。get_fids
方法是否正确执行。get_fids
方法是否有可能返回空列表。在代码中添加错误处理,可以防止程序因列表索引错误而崩溃。可以在尝试访问列表元素之前检查列表是否为空:
fids = self.get_fids([savepath])
if fids:
self.savepath_fid[savepath] = fids[0]["fid"]
else:
# 处理fids为空的情况
print(f"Error: Failed to get fid for savepath {savepath}")
# 根据需要采取进一步的处理措施,比如返回错误,重试等
下面是包含错误处理的代码段:
def dir_check_and_save(self, task, pwd_id, stoken, pdir_fid):
# Your existing code
# ...
fids = self.get_fids([savepath])
if fids:
self.savepath_fid[savepath] = fids[0]["fid"]
else:
# 处理fids为空的情况
print(f"Error: Failed to get fid for savepath {savepath}")
return None
# Continue with the rest of the method
# ...
这样可以确保在get_fids
方法返回空列表时,代码不会崩溃,并且可以根据具体情况进行处理。
get_fids
方法get_fids
方法的实现,确保它在所有情况下都能正常工作,或者在失败时提供有用的错误信息。这将有助于你理解为什么它会返回空列表并相应地采取措施。获取目录ID:失败, inner error, requestId 976q6x-22baf9a465c101
Traceback (most recent call last):
File "/app/./quark_auto_save.py", line 898, in
main()
File "/app/./quark_auto_save.py", line 876, in main
do_save(accounts[0], [tasklist[task_index]])
File "/app/./quark_auto_save.py", line 813, in do_save
is_new = account.do_save_task(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/./quark_auto_save.py", line 468, in do_save_task
updated_tree = self.dir_check_and_save(task, pwd_id, stoken, pdir_fid)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/./quark_auto_save.py", line 542, in dir_check_and_save
subdir_tree = self.dir_check_and_save(
^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/./quark_auto_save.py", line 542, in dir_check_and_save
subdir_tree = self.dir_check_and_save(
^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/./quark_auto_save.py", line 542, in dir_check_and_save
subdir_tree = self.dir_check_and_save(
^^^^^^^^^^^^^^^^^^^^^^^^
[Previous line repeated 4 more times]
File "/app/./quark_auto_save.py", line 498, in dir_check_and_save
self.savepath_fid[savepath] = self.get_fids([savepath])[0]["fid"]
~~~~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range
Docker
26.1.3
⚙️ 读取到 QUARK_COOKIE 环境变量,仅签到领空间。如需执行转存,请删除该环境变量后配置 quark_config.json 文件
===============签到任务===============
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/urllib3/connection.py", line 198, in _new_conn
sock = connection.create_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/urllib3/util/connection.py", line 60, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/socket.py", line 962, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
socket.gaierror: [Errno -3] Try again
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 793, in urlopen
response = self._make_request(
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 491, in _make_request
raise new_e
File "/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 467, in _make_request
self._validate_conn(conn)
File "/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 1099, in _validate_conn
conn.connect()
File "/usr/local/lib/python3.11/site-packages/urllib3/connection.py", line 616, in connect
self.sock = sock = self._new_conn()
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/urllib3/connection.py", line 205, in _new_conn
raise NameResolutionError(self.host, self, e) from e
urllib3.exceptions.NameResolutionError: <urllib3.connection.HTTPSConnection object at 0x7f3f1a020e50>: Failed to resolve 'pan.quark.cn' ([Errno -3] Try again)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/requests/adapters.py", line 486, in send
resp = conn.urlopen(
^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 847, in urlopen
retries = retries.increment(
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/urllib3/util/retry.py", line 515, in increment
raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='pan.quark.cn', port=443): Max retries exceeded with url: /account/info?fr=pc&platform=pc (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7f3f1a020e50>: Failed to resolve 'pan.quark.cn' ([Errno -3] Try again)"))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/ql/data/scripts/Cp0204_quark-auto-save/quark_auto_save.py", line 913, in
main()
File "/ql/data/scripts/Cp0204_quark-auto-save/quark_auto_save.py", line 883, in main
do_sign(account)
File "/ql/data/scripts/Cp0204_quark-auto-save/quark_auto_save.py", line 758, in do_sign
if not verify_account(account):
^^^^^^^^^^^^^^^^^^^^^^^
File "/ql/data/scripts/Cp0204_quark-auto-save/quark_auto_save.py", line 747, in verify_account
account_info = account.init()
^^^^^^^^^^^^^^
File "/ql/data/scripts/Cp0204_quark-auto-save/quark_auto_save.py", line 123, in init
account_info = self.get_account_info()
^^^^^^^^^^^^^^^^^^^^^^^
File "/ql/data/scripts/Cp0204_quark-auto-save/quark_auto_save.py", line 138, in get_account_info
response = requests.request(
^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/requests/api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/requests/sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/requests/adapters.py", line 519, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='pan.quark.cn', port=443): Max retries exceeded with url: /account/info?fr=pc&platform=pc (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7f3f1a020e50>: Failed to resolve 'pan.quark.cn' ([Errno -3] Try again)"))
{}
text
Qinglong
No response
转存文件token校验异常[1ed4d569c35c42648ed8aa4402b0bdd7 token校验异常]
https://drive-m.quark.cn/1/clouddrive/share/sharepage/save
请问这是哪里出错了啊
{}
text
Qinglong
No response
定时转存到后,不是应该直接下载到本地吗 再起一个alist和rclone是否有点舍近求远了
运行错误提示
Traceback (most recent call last):
File "/ql/data/scripts/Cp0204_quark-auto-save/quark_auto_save.py", line 16, in
import requests
ModuleNotFoundError: No module named 'requests'
Qinglong
No response
docker中
第一次任务正常执行,在第二次定时任务执行时miss掉了
Run time of job "run_python (trigger: cron[month='', day='', day_of_week='*', hour='0', minute='3'], next run at: 2024-06-02 00:03:00 CST)" was missed by 0:00:01.311697
stderr: [06-02 00:03:01][WARNING] Run time of job "run_python (trigger: cron[month='*', day='*', day_of_week='*', hour='0', minute='3'], next run at: 2024-06-02 00:03:00 CST)" was missed by 0:00:01.311697
Docker
20.10.22
界面可以参考下云盘订阅界面,更友好一些。
功能建议1:
$TV这个功能后不能修改replace,建议replace处用{$TV}来指代,这样可以自己修改文件名。比如$TV后文件名为04.mp4,replace:小兵传奇-{$TV},输出文件名为:小兵传奇-04.mp4。
功能建议2:
目前追更是看目标目录内有无对应文件,能否改为数据库记录:源分享目录内已经追到哪个文件,按文件时间点记录,该文件时间点前的不再处理。
同时,在任务添加或更改时允许选择从哪个文件开始追更。这样我要从100集开始追就不会把1-99也转存一遍。
BUG:建议不要对已经转存的文件进行改名处理,这样会有BUG。比如源文件名为01.MP4,正则为“.?(S\d{1,2}E)?P?(\d{1,4}).?.(mp4|mkv)”,replace为“XXXX-S01E\1\2.\3”,第一次正常,文件存为XXXX-S01E01.MP4,但再次运行时会把这个文件改为XXXX-S01ES01E01.MP4。
功能建议3:
转存路径选择那里,能否增加读取quark目录进行点选(手动也请保留)
TypeError: can only concatenate str (not "int") to str
stderr: [05-25 23:41:44][ERROR] Exception on /run_script_now [GET]
stderr: Traceback (most recent call last):
stderr: File "/usr/local/lib/python3.12/site-packages/flask/app.py", line 1473, in wsgi_app
stderr: response = self.full_dispatch_request()
stderr: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
stderr: File "/usr/local/lib/python3.12/site-packages/flask/app.py", line 882, in full_dispatch_request
stderr: rv = self.handle_user_exception(e)
stderr: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
stderr: File "/usr/local/lib/python3.12/site-packages/flask/app.py", line 880, in full_dispatch_request
stderr: rv = self.dispatch_request()
stderr: ^^^^^^^^^^^^^^^^^^^^^^^
stderr: File "/usr/local/lib/python3.12/site-packages/flask/app.py", line 865, in dispatch_request
stderr: return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]
stderr: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
stderr: File "/app/./app/run.py", line 171, in run_script_now
stderr: logging.info(f">>> 手动运行任务{task_index+1}")
stderr: ~~~~~~~~~~^~
stderr: TypeError: can only concatenate str (not "int") to str
Docker
v0.2.9.9
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.