当前位置: 首页 > Skill >

Manage quark-auto-save(QAS, 夸克自动转存, 夸克转存, 夸克订阅) tasks via CLI.

Manage quark-auto-save(QAS, 夸克自动转存, 夸克转存, 夸克订阅) tasks via CLI.

Manage quark-auto-save(QAS, 夸克自动转存, 夸克转存, 夸克订阅) tasks via CLI.

通过命令行管理夸克自动转存任务 (QAS,夸克自动转存,夸克转存,夸克订阅,管理任务,运行任务,修复失效链接,pan.quark.cn)

0.8.12 2026.11.27 280
获取Skill文件查看使用说明
作 者:陆宁 许可证: 更新时间:2026.11.27
本文目录展开

quark-auto-save

Manage quark-auto-save tasks via CLI.

QAS, 夸克自动转存, 夸克转存, 夸克订阅, 管理任务, 运行任务, 修复失效链接

When user send message like https://pan.quark.cn/s/***, get detail, add a QAS task.

⚠️ Prerequisites

Env:

  • QAS_BASE_URL - User provided, e.g., http://192.168.1.x:5005
  • QAS_TOKEN - User provided

Actual configuration values are recorded in TOOLS.md, Do not modify SKILL.md

First Configuration: Analyze User Habits

After the user sets the token, the following analysis must be performed and recorded in TOOLS.md:

  1. Get Current Configuration:

    python3 {baseDir}/scripts/qas_client.py get-config
    
  2. Analyze Saving Habits:

    • Extract savepath directory patterns from existing tasks (e.g., /video/tv/, /video/anime/, /video/movie/)
    • For pattern + replace: deduce the final renamed filename format by applying the regex to a sample source file (e.g., 01.mp4 → Black Mirror.S01E01.mp4). Record the result pattern, not the raw regex.
    • Note which magic_regex key the user prefers (e.g. $TV_MAGIC)
  3. Record to TOOLS.md: The following is just an example, not specific values, everything is analyzed based on user configuration.

    ### quark-auto-save habits
    #### TV Series
       - Directory: `/video/tv/{name}`
       - naming preferences: `$TV_MAGIC `(e.g., {TASKNAME}.{SXX}E{E}.{EXT})
    #### Anime
       - Directory: `/video/anime/{name}`
       - naming preferences: `Rick and Morty.S01E01.mp4`
    #### Movie
       - Directory: `/video/movie/{name} {year}`
       - naming preferences: `{TASKNAME}.mp4`
    -
    ...
    

Python Client

Use {baseDir}/scripts/qas_client.py for all operations:

python3 {baseDir}/scripts/qas_client.py get-config                                    # Get all config & tasks
python3 {baseDir}/scripts/qas_client.py search "query" [-d]                           # Search resources
python3 {baseDir}/scripts/qas_client.py get-share "<shareurl>" [-a]                   # Get share detail (-a for all files)
python3 {baseDir}/scripts/qas_client.py check-path "/path"                            # Check savepath
python3 {baseDir}/scripts/qas_client.py delete-file "/path/to/file"                   # Delete cloud file
python3 {baseDir}/scripts/qas_client.py rename-file "/path/to/file" "new_name"        # Rename cloud file
python3 {baseDir}/scripts/qas_client.py add-task '{"taskname": "Name", ...}'          # Add task
python3 {baseDir}/scripts/qas_client.py run-task [taskname|json]                      # Run task(s)
python3 {baseDir}/scripts/qas_client.py update-task "TaskName" '{"savepath": "/new"}' # Update task
python3 {baseDir}/scripts/qas_client.py delete-task "TaskName"                        # Delete task
python3 {baseDir}/scripts/qas_client.py update-config '{"key": "value"}'              # Update config

Task Schema

{
  "taskname": "MediaName",
  "shareurl": "https://pan.quark.cn/s/xxx#/list/share/fid",
  "savepath": "/video/tv/MediaName",
  "pattern": "$TV_MAGIC",
  "replace": "",
  "update_subdir": "",
  "ignore_extension": false,
  "runweek": [1,2,3,4,5,6,7]
}

Required Fields: taskname, shareurl, savepath

Optional Fields: pattern, replace, update_subdir, ignore_extension, runweek, addition

add-task auto-detects zip/rar/7z files and enables auto_unarchive plugin automatically. No manual addition config needed for this.

Configuration Rules

shareurl Format

  • https://pan.quark.cn/s/{abc123}
  • https://pan.quark.cn/s/{abc123}#/list/share/{fid}

Subdirectory Priority

  1. Video files (mp4, mkv, avi)
  2. Resolution: 4K > 1080P > 720P

Archive files (zip, rar, 7z) are also supported — auto-unarchive is enabled automatically by add-task run-task.

Get subdir info:

python3 {baseDir}/scripts/qas_client.py get-share "<shareurl>"

Add task example:

python3 {baseDir}/scripts/qas_client.py add-task '{"taskname": "Black Mirror", "shareurl": "https://pan.quark.cn/s/xxx", "savepath": "/video/tv/Black Mirror", "pattern": "$TV_MAGIC"}'

pattern & replace

WIKI:

  • RegexRename: https://github.com/Cp0204/quark-auto-save/wiki/正则处理教程
  • MagicRegex: https://github.com/Cp0204/quark-auto-save/wiki/魔法匹配和魔法变量
Pattern Replace Result
.* Save all files
.(mp4|mkv)$ Save video files only
^(d+).mp4 S02E1.mp4 01.mp4 → S02E01.mp4
$TV_MAGIC Use custom magic regex

replace Magic Variables

Variable Description
{TASKNAME} Task name
{II} Index number (01, 02...)
{EXT} File extension
{SXX} Season (S01, S02...)
{E} Episode number
{DATE} Date (YYYYMMDD)

Workflows

Add New Task

  1. Search: python3 {baseDir}/scripts/qas_client.py search "MediaName" -d
  2. Verify & Get Details: python3 {baseDir}/scripts/qas_client.py get-share "<shareurl>"
    • Check if shareurl is valid (not banned)
    • Check file list for video files and select the subdir
  3. Analyze pattern & replace: Ensure the final renamed filename matches the naming preferences in TOOLS.md.
    • Source already matches → "pattern": ".*", replace: "" (save as-is)
    • Needs renaming → design pattern to capture groups, replace with magic variables. E.g., source 01.mp4, TOOLS.md says Black Mirror.S01E01.mp4 → "pattern": "^(\d+)\.mp4$", "replace": "{TASKNAME}.S01E\1.{EXT}"
  4. Execute:
    • One-time (completed series, taskname contains X集全, 全X集, 完结, 全集, single movie) → run-task
    • Subscription (ongoing series that gets new episodes) → add-task
    # One-time (completed)
    python3 {baseDir}/scripts/qas_client.py run-task '{"taskname": "MediaName", "shareurl": "...", "savepath": "...", "pattern": "...", "replace": "..."}'
    # Subscription (ongoing)
    python3 {baseDir}/scripts/qas_client.py add-task '{"taskname": "MediaName", "shareurl": "...", "savepath": "...", "pattern": "...", "replace": "..."}'
    
    • savepath and (pattern+replace) MUST follow the user's existing habits recorded in TOOLS.md
    • After add-task: trigger run-task "TaskName" immediately to execute the first save.

Check Invalid Tasks

  1. Get tasks: python3 {baseDir}/scripts/qas_client.py get-config
  2. Identify invalid tasks: tasks with shareurl_ban key in tasklist
  3. Check existing files: python3 {baseDir}/scripts/qas_client.py check-path "<task_savepath>" — record the naming format and the latest episode number (e.g., E24) of already-saved files
  4. Find replacement: python3 {baseDir}/scripts/qas_client.py search "<taskname>" -d to get candidate shareurls
  5. Verify & select shareurl:
    • python3 {baseDir}/scripts/qas_client.py get-share "<candidate_shareurl>" -a — check file list
    • Step 1 — Pick by video format: prefer the shareurl whose file extension matches the existing files (e.g., existing .mkv → pick .mkv source, existing .mp4 → pick .mp4 source)
    • Step 2 — Prefer newer episodes: among candidates with matching format, pick the one whose episode range extends beyond the latest episode (e.g., existing up to E24 → pick shareurl containing E25+)
    • Step 3 — Ensure naming consistency: analyze the source filenames against the existing file naming format. Update pattern/replace so the final renamed result matches the existing naming. If source already matches, keep pattern/replace unchanged.
  6. Update task: python3 {baseDir}/scripts/qas_client.py update-task "TaskName" '{"shareurl": "<verified_url>", "shareurl_ban": "", "pattern": "...", "replace": "..."}' — include pattern/replace if they were adjusted
  7. Trigger run: python3 {baseDir}/scripts/qas_client.py run-task "TaskName" — execute immediately after fixing the link.

Delete Task

python3 {baseDir}/scripts/qas_client.py delete-task "TaskName"

Update Task

# Partial update (only specified fields are changed)
python3 {baseDir}/scripts/qas_client.py update-task "TaskName" '{"savepath": "/new/path"}'
python3 {baseDir}/scripts/qas_client.py update-task "TaskName" '{"pattern": "$TV_MAGIC", "runweek": [1,3,5]}'

Update Config

# Update global config (allowed keys: cookie, crontab, push_config, tasklist, magic_regex, plugins, source)
python3 {baseDir}/scripts/qas_client.py update-config '{"crontab": "0 9 * * *"}'

Run Tasks

python3 {baseDir}/scripts/qas_client.py run-task             # All tasks
python3 {baseDir}/scripts/qas_client.py run-task "TaskName"  # Specific task
python3 {baseDir}/scripts/qas_client.py run-task '{"taskname": "Test", ...}'  # Direct task

Output Format

All commands output text. First word indicates status:

  • OK — success, no data
  • OK {json} — success with data (JSON on same line)
  • ERROR: message — failure
  • run-task: OK on first line, followed by log lines

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,016
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,004
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,002
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,001
PHP集成RabbitMQ实现消息队列的完整步骤

使用 php-amqplib 库,通过建立连接、声明交换机与队列并绑定,即可在 PHP 中实现消息的发送与消费。

2026.05.24 1,001
Apache开启.htaccess及使用方法详解

本文介绍如何在本地Apache环境中启用.htaccess文件,主要涉及修改httpd.conf中的AllowOverride参数。同时详细解析.htaccess的多种实用功能,包括自定义错误页面、目录密码保护、IP访问限制、URL自动转向、默认首页设置以及防止图片盗链等配置方法,并分析了使用.htaccess对服务器性能和安全性的潜在影响。

2026.05.09 1,001
Skill 文件
  • SKILL.md
    • quark-auto-save
    • ⚠️ Prerequisites
    • First Configuration: Analyze User Habits
    • Python Client
    • Task Schema
    • Configuration Rules
      • shareurl Format
      • Subdirectory Priority
    • pattern & replace
      • replace Magic Variables
    • Workflows
      • Add New Task
      • Check Invalid Tasks
      • Delete Task
      • Update Task
      • Update Config
      • Run Tasks
    • Output Format
  • 项目或源文件

相关 Skill

更多
service-qa-coach service-qa-coach Review support quality for chat, email, phone, social DM, or marketplace service teams. Use when a team needs a QA scorecard, failure-mode analysis, coaching plan, calibration checklist, or service-improvement brief without live ticketing, CRM, or contact-center system access.
高中数学作业批改助手 高中数学作业批改助手 >图片识别 直接读取学生手写作答照片,识别公式、符号、步骤 🧮 自动推导 根据题目自动生成参考答案和评分细则,无需教师预设 📊 逐步给分 每个关键步骤独立评分,体现过程分 📝 结构化报告 输出含识别内容、参考答案、逐步评分、改进建议的完整报告 🗂 批量批改 支持一次性批改多道题,最终汇总得分表
Vibration Analysis Vibration Analysis 分析来自CMS趋势、RMS/峰值、频谱及SCADA报警的风机传动链(主轴、齿轮箱、发电机)振动数据。
Traditional Bone Tool Making Basics Traditional Bone Tool Making Basics Use when you need custom, durable, repairable tools like awls, needles, scrapers, harpoons, or fishing hooks made from local animal bones or antlers and comm...
音频混音工具 音频混音工具 名称:Sound Mixing Tool(标识 sound-mixing-tool) 短简介(≤60字):音乐/音效响度精确对齐 + 融合混音工作流:用 ffmpeg 两段式 loudnorm 把多组素材 LUFS 偏差压到 <0.10,再最小干预融合、导出可进引擎的独立分轨。 标签/关键词:音频混音 响度匹配 LUFS ffmpeg 游戏音频 音效设计 Wwise FMOD 分轨导出 后期处理 触发词:混音 · 响度匹配 · LUFS 对齐 · MIX 版本 · 音乐音效分轨 · 融合 · 不打架 · 不能盖住 适用场景 :游戏音频集成、影视短视频配乐、播客后期