View Single Post
Old 27.02.2021, 13:51
plip plip is offline
Wind Gust
Join Date: Jun 2016
Posts: 40

Hi. I hope someone could tell me what I'm doing wrong here.

I found this script which replaces characters in filenames when added to linkgrabber:

I'm altering it to suit my own needs. I can mostly do what I want with filenames without problems.

1. (Although I would like to know how to check if there's a letter/number right after 】or right before【, and add a space if a letter/number is there)

2. My big problem is this.

I want to do replacing of characters in the package/download folder too. Mostly the same replacements, but with a few differences.

I cannot figure out how to get the package/download folder name linkgrabber generates so that I can do replacements on that package/download folder name.

The file name is grabbed in the script like this:
    var myPackagizerLink = link;
    var fileName = myPackagizerLink.getName();
The file name can be modified after that no problem.

All my attempts to grab the package/folder apparently get a "null" error when actually trying to do a replacement. I don't know why.

I swear the following was working for a short while, but after restarting JD2 it just seems to store "null":
    var packageName = myPackagizerLink.getPackageName();
This doesn't work either:
    var packageName = myPackagizerLink.getDownloadFolder();

How do you capture the package/folder name so you can modify it, in the same manner as the filename is modified in that script I linked?

I know how to do the actual replacements and set the modified package name, if only I could reliably get the package/folder name in the first place.

Last edited by plip; 27.02.2021 at 13:59.
Reply With Quote