JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #1  
Old 10.05.2021, 05:44
Wheezer Wheezer is offline
JD Addict
 
Join Date: Mar 2009
Location: WheezerLand
Posts: 158
Default [Packagizer] - Create package name from [Downloaded from] ???

I have an issue and I hope there is a way to solve it.
I need to create a PACKAGE of links based upon the DOWNLOAD FROM (CONTAINER) value.
I did not see a way to do it in the packagizer section.

For example, a set of links would have the download address container value "http:\\something.com\album\files". The final package for them would be set to "http_something.com_album_files" and have all the links. The final package name is fine, that can be adjusted post download.

I can do this manually by getting the URL from one link, then selecting a bunch and using the [OTHER] then [MOVE TO NEW PACKAGE] successfully. However it is a real pain to do many such moves and I am looking to get them set when the link collector runs.

ALSO ... since I have already have a large number of link that need this process, is there any way to run packagizer (or something similar) on links already in the linkgrabber list?

Many thanks for any help or directions.

Cheers!
... W ...
Reply With Quote
  #2  
Old 10.05.2021, 09:21
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,529
Default

Example:
Code:
Sourceurls(s)  -> contains -> (://something\.com/album/[^/]+$) (enable regex button)
then set -> Package Name -> <jd:source:1>
Reply With Quote
  #3  
Old 10.05.2021, 10:20
Wheezer Wheezer is offline
JD Addict
 
Join Date: Mar 2009
Location: WheezerLand
Posts: 158
Default

Thanks .... BUT ....

The code listed for source selection did not work, however I CAN select them by using a URL test for just the "something.com". That selected appropriately.

However I added the Package Name item and it is not being set to the source URL container name. I used "jd:source:1" and "<jd:source:1>" and in both cases the package is just named as "_jd_source_1_".

How can I extract or use the source value? It has to be there somewhere?

Thanks for getting me in the right direction.

Cheers!
... W ...

Last edited by Wheezer; 10.05.2021 at 10:31.
Reply With Quote
  #4  
Old 10.05.2021, 10:27
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,529
Default

Quote:
Originally Posted by Wheezer View Post
... the package is just named as "_jd_source_1_"
Quote:
Originally Posted by mgpai View Post
(enable regex button)
Make sure the regex button at the end of the sourceurl(s) field is enabled. If it is still not working, provide examples of actual/working urls.
Reply With Quote
  #5  
Old 10.05.2021, 10:39
Wheezer Wheezer is offline
JD Addict
 
Join Date: Mar 2009
Location: WheezerLand
Posts: 158
Default

Thanks .....

Sample URLS of items for package creation:
**External links are only visible to Support Staff****External links are only visible to Support Staff**
**External links are only visible to Support Staff****External links are only visible to Support Staff**

Selection criteria that DID work
Sourceurl(s) CONTAINS members.luscious.net (regex button checked)

Selection criteria that DID NOT work:
Sourceurl(s) CONTAINS ://members.luscious.net/albums/[^/]+$ (regex button checked)

Package Name jd.source.1 results in a package named _jd_source_1_
Package Name <jd:source:1> results in a package named _jd_source_1_

Very vexing ... thanks for the assist.
... W ...
Reply With Quote
  #6  
Old 10.05.2021, 10:50
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,529
Default

Quote:
Originally Posted by Wheezer View Post
Sample URLS of items for package creation ...
Code:
Sourceurls(s)  -> contains -> (https?://members.luscious.net/albums/[^/]+)/$ (enable regex button)
then set -> Package Name -> <jd:source:1>
Reply With Quote
  #7  
Old 10.05.2021, 11:01
Wheezer Wheezer is offline
JD Addict
 
Join Date: Mar 2009
Location: WheezerLand
Posts: 158
Default

EXCELLENT .... it works !!!

Running a test now and the selected items are being created with the correct package names. Much easier than post collection grouping and renaming.

Can I run this packagizer against links already in the linkgrabber list to split them into correctly named packages ??

Many thanks !!!
... W ....
Reply With Quote
  #8  
Old 10.05.2021, 11:05
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,232
Default

@Wheezer: It's not possible to run packagizer again but I'm sure mgpai can help you with a script for eventscripter so you can apply this modification on links that are already in list

@mgpai: Thanks for your great help!
__________________
JD-Dev & Server-Admin
Reply With Quote
  #9  
Old 10.05.2021, 11:14
Wheezer Wheezer is offline
JD Addict
 
Join Date: Mar 2009
Location: WheezerLand
Posts: 158
Default

This has been great for tonight ..... the help has been superb, this has been a major hassle before this. Going forward it will be much easier.

The script will be a big help if I can get that working, there are 536144 links I have to process in the linkgrabber list. It will be a LONG effort if done manually.

Cheers!
... W ...
Reply With Quote
  #10  
Old 10.05.2021, 11:22
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,232
Default

@Wheezer: I'm sure mgpai will come around the corner with a great solution for you
__________________
JD-Dev & Server-Admin
Reply With Quote
  #11  
Old 10.05.2021, 14:33
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,529
Default

@Wheezer: What is your download folder setting? Default/static/variable?
Reply With Quote
  #12  
Old 10.05.2021, 20:05
Wheezer Wheezer is offline
JD Addict
 
Join Date: Mar 2009
Location: WheezerLand
Posts: 158
Default

My default directory (from the settings page) is "F:\[_DL_]\[_members.luscious.net_]\<jd:packagename>".

For the packageizer panel I do not set a directory there, rather letting is use the default.

So far the settings for the pacakage panel are working well, no faults in link package creation I've tested.

Thanks!
... W ...
Reply With Quote
  #13  
Old 10.05.2021, 20:26
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,232
Default

@mgpai: should be possible to iterate through links in linkgrabber and just change the destination folder
__________________
JD-Dev & Server-Admin
Reply With Quote
  #14  
Old 10.05.2021, 22:12
Wheezer Wheezer is offline
JD Addict
 
Join Date: Mar 2009
Location: WheezerLand
Posts: 158
Default

I was thinking the same thing.
I have already sorted the target links into packages based on the source URL. They are spllit into alpha sets (for example: A, B,C, etc.) to keep the package sizes manageable.

Now (MANUALLY) the steps are:
1) Sort link link package by "Downloaded From"
2) Get Source URL from one link, copy value
3) Select links with the same source URL
4) Move to new package, paste name from saved source URL
5) Repeat

With a program or script, it might be:
1) Select link
2) Get SOURCE URL from link
3) Test if the SOURCE URL matches the target pattern
4) If MATCH true then:
4.1) Test if a package exists that is named as SOURCE URL
4.2) If package named as SOURCE URL exists is false then:
4.2.1) Create package named as SOURCE URL
4.3) MOVE link to package named as SOURCE URL
5) Repeat until done

I'm not sure of the syntax of the script language, but that seems to be the basic processing logic. Variable assignments, test logic and loop control methods would all be dependent on the statements available in the program or script language.

Not sure if JD automatically creates a package name when moving to a new package via script, that's why the package exist test and package create part is there.

Thanks!
... W ...

Last edited by Wheezer; 10.05.2021 at 22:15.
Reply With Quote
  #15  
Old 11.05.2021, 03:26
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,529
Default

Quote:
Originally Posted by Jiaz View Post
@mgpai: should be possible to iterate through links in linkgrabber and just change the destination folder
I asked the question for a different reason. If the current download path contains placeholders, the getDownloadFolder method does not return the variable string. It either returns null or static path. For e.g. <jd:packagename> will be replaced with the current package name, and the download path ceases to be 'dynamic'.

If the user has placeholders in the download path, I have to build a string which contains that placeholder and set it as download path instead of using the value returned by getDownloadFolder, since it does not return a string with placeholders.
Reply With Quote
  #16  
Old 11.05.2021, 04:35
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,529
Default

Keep a backup of your link list before testing/using this script.

Code:
/*
    Set package name from container url
    Trigger : Linkgrabber Context Menu Button Pressed
    Customize context menu > Add a new "Eventscriopter Trigger" button > Rename it to "Package from container url"
*/

if (name == "Package from container url") {
    var urls = {};

    lgSelection.links.forEach(function(link) {
        var url = link.containerURL;

        if (url) {
            urls[url] = urls[url] || [];
            urls[url].push(link.UUID);
        }
    })

    for (url in urls) {
        callAPI("linkgrabberv2", "movetoNewPackage", urls[url], [], url, null);
    }
}
Reply With Quote
  #17  
Old 11.05.2021, 04:37
Wheezer Wheezer is offline
JD Addict
 
Join Date: Mar 2009
Location: WheezerLand
Posts: 158
Default

FWIW ... in my case the download directory is just the base location (static path), each item gets a package and folder specific location (such as these files, movies, TV, etc.).

The key is the package name, since the download directory location can be altered later in bulk and use the package name to create the final target folder.

At least that's how I do it.
Seems like you are writing a generic solution that will apply to multiple situations.

Thanks!
... W ...
Reply With Quote
  #18  
Old 11.05.2021, 06:02
Wheezer Wheezer is offline
JD Addict
 
Join Date: Mar 2009
Location: WheezerLand
Posts: 158
Default

OK ... quick question while JD backs up everything.

1) Does this work on ALL link packages, or just those selected?
2) Adding the button should be straightforward, I'll look into the method to do that.
3) Add the script as is, or strip the comments ? I thought I saw a reference that multiple comments lines caused problems. But that may have referred to an older build.

Thanks for this ... I can't wait to test.

Cheers!
... W ...
Reply With Quote
  #19  
Old 11.05.2021, 06:11
Wheezer Wheezer is offline
JD Addict
 
Join Date: Mar 2009
Location: WheezerLand
Posts: 158
Default

SIGH ... can't get started.

I added the event scripter and activated it.
When press the EDIT button (to create a new script) it quickly flashes what looks like a LOADING box, then no editor :(.

It dialog box seems pop up immediately then end. I had to press EDIT multiple times to see the very brief flash.

Any suggestions ???

Cheers!
... W ...
Reply With Quote
  #20  
Old 11.05.2021, 06:14
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,529
Default

Quote:
Does this work on ALL link packages, or just those selected?
Only selected links and/or packages (all links in the selected package).

Quote:
Add the script as is, or strip the comments ? I thought I saw a reference that multiple comments lines caused problems.
No harm if they remain in the script.
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 10:47.
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.