#1
|
|||
|
|||
[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 ... |
#2
|
|||
|
|||
Example:
Code:
Sourceurls(s) -> contains -> (://something\.com/album/[^/]+$) (enable regex button) then set -> Package Name -> <jd:source:1> |
#3
|
|||
|
|||
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. |
#4
|
|||
|
|||
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.
|
#5
|
|||
|
|||
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 ... |
#6
|
|||
|
|||
Code:
Sourceurls(s) -> contains -> (https?://members.luscious.net/albums/[^/]+)/$ (enable regex button) then set -> Package Name -> <jd:source:1> |
#7
|
|||
|
|||
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 .... |
#8
|
||||
|
||||
@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 |
#9
|
|||
|
|||
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 ... |
#10
|
||||
|
||||
@Wheezer: I'm sure mgpai will come around the corner with a great solution for you
__________________
JD-Dev & Server-Admin |
#11
|
|||
|
|||
@Wheezer: What is your download folder setting? Default/static/variable?
|
#12
|
|||
|
|||
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 ... |
#13
|
||||
|
||||
@mgpai: should be possible to iterate through links in linkgrabber and just change the destination folder
__________________
JD-Dev & Server-Admin |
#14
|
|||
|
|||
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. |
#15
|
|||
|
|||
Quote:
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. |
#16
|
|||
|
|||
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); } } |
#17
|
|||
|
|||
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 ... |
#18
|
|||
|
|||
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 ... |
#19
|
|||
|
|||
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 ... |
#20
|
|||
|
|||
Quote:
Quote:
|
Thread Tools | |
Display Modes | |
|
|