如何配置JDownloader2正则规则,将单TXT链接归入同名下载包
Fix JDownloader2 Package Naming for TXT File Links
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 issummer_videos.txt, this capturessummer_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
- Open JDownloader2 and go to Settings > Advanced Settings.
- Search for LinkFilterRules (or navigate manually to
jd.controlling.linkcrawler.LinkCrawlerConfig > linkFilterRules). - Paste the modified JSON over your existing rule.
- 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
相关产品推荐
相关产品推荐

