JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #1  
Old 03.06.2016, 17:50
Randomdude Randomdude is offline
Modem User
 
Join Date: Jun 2016
Posts: 3
Default How to automatically crop filenames ?

jdownloader can't download some files for me and shows "Invalid download directory" in status of that files ... cause filenames are too long they really are :D Are there any easy "bulk" way to make them just shorter... just save first 20 or so symbols (letters and numbers) and cut off everything else ? I was trying to find "regular expression" for such task... but i just can't find one anywhere
Reply With Quote
  #2  
Old 03.06.2016, 18:23
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 66,134
Default

Create a packagizer rule
Enable *Match on any File or Link...* - First Checkbox
Enable Filename - contains - ((.{9}).*) - enable regex checkbox at right side
...then set
Enable Filename - <jd:orgfilename:2>.<jd:orgfiletype>

This will limit filenames to max length of 9 you can change number yourself to your needs
__________________
JD-Dev & Server-Admin
Reply With Quote
  #3  
Old 03.06.2016, 18:49
Randomdude Randomdude is offline
Modem User
 
Join Date: Jun 2016
Posts: 3
Default

Thanks But this will not work with already added files ? Only with new ones ?
Reply With Quote
  #4  
Old 03.06.2016, 21:42
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 66,134
Default

I'm sorry but it will only work on new added links. you can use copy/paste to readd them
select them in download list, and switch to linkgrabber and paste it there
__________________
JD-Dev & Server-Admin
Reply With Quote
  #5  
Old 04.06.2016, 09:07
Randomdude Randomdude is offline
Modem User
 
Join Date: Jun 2016
Posts: 3
Default

In the end it made it Thanks for the help. Works perfectly. if only there was option to just have error (like the one about renaming files with same name) "file name is too long, crop it to the shorter possible version" that would be easier Anyway i'm very happy now.
Reply With Quote
  #6  
Old 06.06.2016, 11:10
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 66,134
Default

I have this issue on my screen and in future JDownloader will auto crop filenames if needed
__________________
JD-Dev & Server-Admin
Reply With Quote
  #7  
Old 31.10.2016, 09:59
Kino Kino is offline
Fibre Channel User
 
Join Date: Nov 2010
Posts: 116
Default

Hi friends,
This rule is not working for
**External links are only visible to Support Staff****External links are only visible to Support Staff**

Actually any packagizer rule for filenaming is not working for this website.
How should we limit filename length for this site? (say limit to first 64 characters)

Thanks.
Reply With Quote
  #8  
Old 31.10.2016, 13:33
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 66,134
Default

Works fine for me.

Filename contains - '((.{9}).*)' without ' - enable regex
set FileName <jd:orgfilename:2>.<jd:orgfiletype>
__________________
JD-Dev & Server-Admin
Reply With Quote
  #9  
Old 31.10.2016, 13:36
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 66,134
Default

if you want only to match for those links
then you should include
sourceurl(s) contains - xbooru.com
__________________
JD-Dev & Server-Admin
Reply With Quote
  #10  
Old 31.10.2016, 14:11
madcowpig's Avatar
madcowpig madcowpig is offline
Storm
 
Join Date: Aug 2016
Posts: 210
Default

Quote:
Originally Posted by Jiaz View Post
I'm sorry but it will only work on new added links. you can use copy/paste to readd them
select them in download list, and switch to linkgrabber and paste it there
Also, to skip a step, you can use this script in Event Scripter,

Code:
// Send links to linkgrabber and remove from the download list
// Trigger: Downloadlist Contextmenu Button Pressed

if (name == "Send to LinkGrabber") {
    var links = dlSelection.getDownloadLinks();
    var urls = [];
    for (i = 0; i < links.length; i++) {
        var link = links[i];
        urls.push(link.getUrl());
        link.remove();
    }
    addLinks()
}

// Funtions
function addLinks() {
    callAPI("linkgrabberv2", "addLinks", {
        "links": urls.join(" ")
    })
}
Just go to Event Scripter, click Add, click edit, past the copy and paste the script, click Save (If you can't see the save button, adjust the window size.), change trigger to "Downloadlist Contextmenu Button Pressed", click edit again, click "Right Click Menu Download Table", then click the "+" Button, type in "EventScripter Trigger", click it, in the properties, change the name to "Send to LinkGrabber", click Save, then all you have to do is select the links you want to move to LinkGrabber and click this new button. Super easy.
__________________
I don't fight the system, but I do play fighting games on it. PS4 to be exact. On second thought, sometimes it won't work right and I have to hit it a couple of times before it's fixed. So technically, I do fight the system.

Last edited by madcowpig; 15.01.2017 at 13:02. Reason: Misspelled the word, "select".
Reply With Quote
  #11  
Old 31.10.2016, 14:34
Kino Kino is offline
Fibre Channel User
 
Join Date: Nov 2010
Posts: 116
Default

My problem is again link checking issue. It was disabled, and packagizer rules creates issues when it is disabled. I enabled it and then restarted JD. Now it is working fine.
Reply With Quote
  #12  
Old 31.10.2016, 14:37
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 66,134
Default

Thanks for the feedback!
__________________
JD-Dev & Server-Admin
Reply With Quote
  #13  
Old 31.10.2016, 14:47
Kino Kino is offline
Fibre Channel User
 
Join Date: Nov 2010
Posts: 116
Default

Opps, not working:
Could you please check this link:
**External links are only visible to Support Staff****External links are only visible to Support Staff**
Reply With Quote
  #14  
Old 31.10.2016, 15:04
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 66,134
Default

works perfectly fine for me
__________________
JD-Dev & Server-Admin
Reply With Quote
  #15  
Old 31.10.2016, 15:04
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 66,134
Default

What exactly does not work for you?
__________________
JD-Dev & Server-Admin
Reply With Quote
  #16  
Old 31.10.2016, 15:29
Kino Kino is offline
Fibre Channel User
 
Join Date: Nov 2010
Posts: 116
Default

JD grabs pictures with tag "digimon" where it should grab pictures with tag "digimon_adventure"


**External links are only visible to Support Staff****External links are only visible to Support Staff**
Above link acts like
**External links are only visible to Support Staff****External links are only visible to Support Staff**

which is wrong.

JD ignores "_adventure" part of the original link.
Reply With Quote
  #17  
Old 31.10.2016, 15:35
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 66,134
Default

fixed with next update. Thanks for explanation and example links!
__________________
JD-Dev & Server-Admin
Reply With Quote
  #18  
Old 01.11.2016, 13:26
Kino Kino is offline
Fibre Channel User
 
Join Date: Nov 2010
Posts: 116
Default

Hi again,
It seems there is another problem.
For this link I want to limit filename length to 64.
**External links are only visible to Support Staff****External links are only visible to Support Staff**

In my packagizer rule:
Limit to 9 works: ((.{9}).*)
But limit to 64 deletes all filename string: ((.{64}).*)

Any comment?
Reply With Quote
  #19  
Old 02.11.2016, 10:54
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 66,134
Default

What exactly do you mean by *deletes all filename string* ?
__________________
JD-Dev & Server-Admin
Reply With Quote
  #20  
Old 02.11.2016, 11:03
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 66,134
Default

I've also updated plugin, please wait for next plugin update
__________________
JD-Dev & Server-Admin
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 18:38.
Provided By AppWork GmbH | Privacy | Imprint
Parts of the Design are used from Kirsch designed by Andrew & Austin
Powered by vBulletin® Version 3.8.10 Beta 1
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.