You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何配置JDownloader2正则规则,将单TXT链接归入同名下载包

I’ve run into this exact headache before—having every link from a TXT file split into separate packages is such a hassle. Let’s tweak your existing rule to group all links from a single TXT into one package named after the file itself.

Modified Rule JSON

Replace your current rule with this updated version:

[
  {
    "enabled": true,
    "maxDecryptDepth": 2,
    "name": "TXT File Package Grouping",
    "pattern": "file:/.*?/([^/]+)\\.txt$",
    "rule": "DEEPDECRYPT",
    "packageNamePattern": "$1",
    "formPattern": null,
    "deepPattern": null,
    "rewriteReplaceWith": null,
    "patternMatchFlags": 0,
    "deepPatternMatchFlags": 0,
    "packageNamePatternMatchFlags": 0
  }
]

Key Changes Explained

  • name: Added a descriptive label so you can easily spot this rule later (optional but useful for organization).
  • pattern: Adjusted to explicitly capture the TXT filename without the full path:
    • file:/.*?/: Matches the entire directory path up to the last folder separator.
    • ([^/]+): This is the critical capture group—it grabs everything after the final / and before .txt (e.g., if your file is summer_videos.txt, this captures summer_videos).
    • \\.txt$: Ensures we only target valid TXT files.
  • packageNamePattern: "$1": Tells JDownloader to use the content of that first capture group as the package name.

If you want the package name to include the .txt extension, adjust the pattern like this:

"pattern": "file:/.*?/([^/]+)$",
"packageNamePattern": "$1"

How to Apply the Fix

  1. Open JDownloader2 and go to Settings > Advanced Settings.
  2. Search for LinkFilterRules (or navigate manually to jd.controlling.linkcrawler.LinkCrawlerConfig > linkFilterRules).
  3. Paste the modified JSON over your existing rule.
  4. Save settings and restart JDownloader2 to activate the change.

Now when you drag a TXT file into JDownloader, all links inside will automatically land in a single package named after the TXT file—no more scattered individual packages!

内容的提问来源于stack exchange,提问作者pogos

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.27 07:30:13