JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #3081  
Old 22.11.2024, 15:49
Trap Trap is offline
Junior Loader
 
Join Date: Aug 2024
Posts: 11
Default

Quote:
Originally Posted by mgpai View Post
Thanks



Yes.

Okay, seems that my previous attempts with scripts broke something, loaded a backup and it works flawlessly.

Thank you!
Reply With Quote
  #3082  
Old 22.11.2024, 16:41
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,628
Default

Quote:
Originally Posted by Trap View Post
Okay, seems that my previous attempts with scripts broke something, loaded a backup and it works flawlessly.

Thank you!
You're welcome.
Reply With Quote
  #3083  
Old 26.11.2024, 00:41
wkearney99 wkearney99 is offline
DSL Light User
 
Join Date: May 2024
Posts: 33
Default

Is there a reason there's not a separate subforum just for Event Scripter discussions?

https://board.jdownloader.org/showth...366#post541366
Reply With Quote
  #3084  
Old 26.11.2024, 02:31
wkearney99 wkearney99 is offline
DSL Light User
 
Join Date: May 2024
Posts: 33
Default

I've come across a number of sites that now include #hashtag text in the filenames. I don't want those, as they tend to make the pathname excessively long.

I raised the question on this thread.

I wrote this script to strip them out. It's called via a Packagizer Hook:

Code:
if (linkcheckDone) {

    var myPackagizerLink = link;
    var fileName = myPackagizerLink.getName();
    var re, ext, newName;

    if (fileName !== null && fileName.includes("#")) {

        ext = fileName.slice((fileName.lastIndexOf(".") - 1 >>> 0) + 2);
        if (ext !== "") {
            ext = "." + ext.toLowerCase();
        }

        fileName = fileName.substr(0, (fileName.length - ext.length));

        rgx = new RegExp("#[a-zA-Z0-9_]+", "gi");
        newName = fileName.replace(rgx, "");

        rgx = new RegExp("\\s\\s+", "gi");
        newName = newName.replace(rgx, " ");

        newName = newName.trim();

        myPackagizerLink.setName(newName + ext);
    }
}
I'd welcome suggestions on improving it, or accomplishing the goal in another manner.
Reply With Quote
  #3085  
Old 26.11.2024, 11:34
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 73,484
Default

New separate subforum for EventScripter scripts:
https://board.jdownloader.org/forumdisplay.php?f=52
__________________
JD Supporter, Plugin Dev. & Community Manager

Erste Schritte & Tutorials || JDownloader 2 Setup Download
Spoiler:

A users' JD crashes and the first thing to ask is:
Quote:
Originally Posted by Jiaz View Post
Do you have Nero installed?
Reply With Quote
  #3086  
Old 28.11.2024, 16:08
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 73,484
Default

Moved EventScripter thread in our new EventScripter subforum and pinned it there.
__________________
JD Supporter, Plugin Dev. & Community Manager

Erste Schritte & Tutorials || JDownloader 2 Setup Download
Spoiler:

A users' JD crashes and the first thing to ask is:
Quote:
Originally Posted by Jiaz View Post
Do you have Nero installed?
Reply With Quote
Old 08.12.2024, 17:49
StefanM
Message deleted by pspzockerscene. Reason: User requested deletion of this post
Old 08.12.2024, 17:51
StefanM
Message deleted by pspzockerscene. Reason: User requested deletion of this post
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 07:26.
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 - 2024, Jelsoft Enterprises Ltd.