JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #1  
Old 19.08.2024, 12:37
Trap Trap is offline
Junior Loader
 
Join Date: Aug 2024
Posts: 11
Default Download order confusion in JDownloader 2

I have been trying to figure out how to change the default download order in jdownloader to make it download packages and package contents in order, it still sorts and then downloads packages/package contents alphabetically.

As an example... if i try to download a package with 10 images that go in a certain order in the website and have random naming schemes (garbled letters like gfiewmmxoerionve7fze) get downloaded alphabetically instead.
Same goes for websites with lots of pacges, the program finds the contens but just downloads them alphabetically.

How would i go about changing this so it downloads in the same order as the website displays them (or in reverse order, from back to front)?

Last edited by Trap; 19.08.2024 at 12:44.
Reply With Quote
  #2  
Old 19.08.2024, 12:48
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,306
Default

@Trap: Why is download order important do you? I'm asking because there are no guarantees about downloading order. You just give hints with packages/links position and/or priorties but higher position/priority doesn't guarantee that the file will be downloaded in that order.
When all is and goes *normal* then JDownloader is downloading list from top to bottom.

Please explain what you have in mind and why and then we can better help you. Also please provide example links
__________________
JD-Dev & Server-Admin
Reply With Quote
  #3  
Old 19.08.2024, 13:07
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 73,512
Default

@Jiaz
I think all he did was to sort via single click and expect the download order to change.

@Trap
Single click sorting will "sort as a view".
If you want to do a "real sort" which will affect the download order, press and hold CTRL button, then click a column of your choice to do a "real sort".
__________________
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
  #4  
Old 19.08.2024, 13:14
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,306
Default

@pspzockerscene: yes, maybe
@Trap: Please provide feedback
__________________
JD-Dev & Server-Admin
Reply With Quote
  #5  
Old 19.08.2024, 15:33
Trap Trap is offline
Junior Loader
 
Join Date: Aug 2024
Posts: 11
Default

Quote:
Originally Posted by Jiaz View Post
@pspzockerscene: yes, maybe
@Trap: Please provide feedback
The download order is important as i don't want to go about manually rearranging/renaming or changing dates every time i want a few images to download.

here is an example link of something i'd want to download in order.
**External links are only visible to Support Staff****External links are only visible to Support Staff**

@pspzockerscene i saw the "real sort" suggestion a few times in the forum and have no idea what that is even supposed to do (how it works)? when i ctrl click a column it does nothing apart from selecting stuff. I can get it to download in a different order but only in the way of reversing the download order (still alphabetical but backwards), this is the only option it gives me in terms of "sorting". Well, it did let me add a "new" option of "sort packages by save to" but... that just does the same thing as alphabetically.

I must be doing something wrong here...

Last edited by Trap; 19.08.2024 at 16:02.
Reply With Quote
  #6  
Old 19.08.2024, 17:05
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 73,512
Default

Quote:
Originally Posted by Trap View Post
when i ctrl click a column it does nothing apart from selecting stuff
Maybe I wasn't clear enough.
You need to click into the column header (on the name of the column you want to sort).
Basically the same as when sorting files in your OS' file-explorer but press and holt CTRL while clicking the column header.

Quote:
Originally Posted by Trap View Post
I can get it to download in a different order but only in the way of reversing the download order
Which column-header did you click into to get that order?
You can sort by any column.
If there is a column that you are missing, rightclick into any column-header to see a list of further columns you can enable.

What I still did not understand:
What is your desired order?
Would you like to download the items in the order they are presented on the source website aka in this case, like the website "kemono.su" is displaying them?

Quote:
Originally Posted by Trap View Post
I must be doing something wrong here...
Please post a screen capture video that shows, how you are sorting things at this moment.
__________________
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
  #7  
Old 19.08.2024, 18:30
Trap Trap is offline
Junior Loader
 
Join Date: Aug 2024
Posts: 11
Default

Quote:
Originally Posted by pspzockerscene View Post
Maybe I wasn't clear enough.
You need to click into the column header (on the name of the column you want to sort).
Basically the same as when sorting files in your OS' file-explorer but press and holt CTRL while clicking the column header.


Which column-header did you click into to get that order?
You can sort by any column.
If there is a column that you are missing, rightclick into any column-header to see a list of further columns you can enable.

What I still did not understand:
What is your desired order?
Would you like to download the items in the order they are presented on the source website aka in this case, like the website "kemono.su" is displaying them?


Please post a screen capture video that shows, how you are sorting things at this moment.
Sorry for the confusion, yes i would like to download images/files in whatever order they appear on the website.

I haven't changed anything as i can't figure out where i would go to achieve this... I want the program to by default download in the correct order and not use whatever built in sorting there is.

What setting would i have to change and where do i find it?

Honestly i'm not even sure if i understand "column" in the correct context, i'll provide an image showing what i was trying before, and is there a video or any images i can maybe reference?

Basically a variation of trying options in linkgrabber and looking for additional sorting options, when i press the sort packages by save to it just flips the download order from back to front and i have no additional options given to sort.

Am i on the right track or just completely lost here?
Attached Images
File Type: png Screenshot 2024-08-19 181416.png (42.1 KB, 1 views)

Last edited by Trap; 19.08.2024 at 19:43. Reason: Added context
Reply With Quote
  #8  
Old 20.08.2024, 09:44
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 73,512
Default

Quote:
Originally Posted by Trap View Post
Sorry for the confusion, yes i would like to download images/files in whatever order they appear on the website.
That is not possible.
Due to the way the crawling works (threading & concurrency), there is no gurantees on which order crawled items of added links get added though depending on how many items you add (e.g. if items get crawled over multiple pages), the added order can be _roughly_ the one from the source-website.
In the special case of kemono.su there is a way to put an internal index inside the filenames which you could use for sorting. We can talk more about this in case my hints down below are not helpful to you.

Quote:
Originally Posted by Trap View Post
and is there a video or any images i can maybe reference?
Not from us, maybe you will find something on youtube.

Quote:
Originally Posted by Trap View Post
Am i on the right track or just completely lost here?
Looks like you are lost since we never told you to even open the context menu so here again:
I'm assuming that you are either in the download-list or linkgrabber.
1. Put your mouse on any column-header - if you would like to sort by name, this would mean go to the column "Name" and hover your mouse over the text "Name".
Screenshot:


2. Now if you want to sort all packages ba name, press and holt CTRL and click on the column.
To sort all items inside a package, rightclick on the package in the row of the package name -> You should see the text "Sort package(s) by <name of column>".
Screenshot:
__________________
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?

Last edited by pspzockerscene; 20.08.2024 at 17:41. Reason: Fixed screenshots
Reply With Quote
  #9  
Old 20.08.2024, 12:51
Trap Trap is offline
Junior Loader
 
Join Date: Aug 2024
Posts: 11
Default

Quote:
Originally Posted by pspzockerscene View Post
That is not possible.
Due to the way the crawling works (threading & concurrency), there is no gurantees on which order crawled items of added links get added though depending on how many items you add (e.g. if items get crawled over multiple pages), the added order can be _roughly_ the one from the source-website.
In the special case of kemono.su there is a way to put an internal index inside the filenames which you could use for sorting. We can talk more about this in case my hints down below are not helpful to you.


Not from us, maybe you will find something on youtube.


Looks like you are lost since we never told you to even open the context menu so here again:
I'm assuming that you are either in the download-list or linkgrabber.
1. Put your mouse on any column-header - if you would like to sort by name, this would mean go to the column "Name" and hover your mouse over the text "Name".
Screenshot:


2. Now if you want to sort all packages ba name, press and holt CTRL and click on the column.
To sort all items inside a package, rightclick on the package in the row of the package name -> You should see the text "Sort package(s) by <name of column>".
Screenshot:
Ah, well now i feel stupid
Didn't even think to look there even though you said column, could be the theme or me just not being used to the interface.

This does give me more options, but seems to do about the same thing as the context menu fiddling i tried before.

The internal file indexing does sound like what im looking for, could you run me through the process?

Last edited by Trap; 20.08.2024 at 12:55. Reason: Slight grammatical change
Reply With Quote
  #10  
Old 20.08.2024, 13:01
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 73,512
Default

Quote:
Originally Posted by Trap View Post
Ah, well now i feel stupid
Well, that wasn't my intention :D

Quote:
Originally Posted by Trap View Post
I would however be interested in the internal indexing, could you run me through the process?
Yap. For now I will give you some rough hints - feel free to pose further questions.

There is a powerful JD feature called Packagizer which can be used to automate some things and and also to assign custom filenames depending on certain conditions, see:
https://support.jdownloader.org/de/k...paketverwalter

Now there is also something called "Plugin specific properties" which is explained in the first article in the Packagizer support category, more specifically, here:
https://support.jdownloader.org/de/k...the-packagizer
The kemono plugin assigns some of those mentioned properties on most of all items it returns.
One of those properties is called "postContentIndex" which is an index (a number) that defines the position of each element that gets crawled from a kemono.su/coomer.su post.
The rought idea would be to put that index to the beginning of all kemono.so filenames so then you can just sort from A-Z which will automatically give you the "order of items like they are presented on the website".
Related/similar threads with examples:
https://board.jdownloader.org/showthread.php?t=93796
and:
https://board.jdownloader.org/showthread.php?t=86792
__________________
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
  #11  
Old 29.10.2024, 17:49
Trap Trap is offline
Junior Loader
 
Join Date: Aug 2024
Posts: 11
Default

Okay, it's been a while and i've done some experimenting with different softwares to get the result im looking for, I wanted to now use a simple <jd:prop:postContentIndex>_<jd:orgfilename> along with another crawler to test for other possible solutions, but there's a small issue with the postContentIndex and its naming scheme...

it starts at 0, and because of this it adds the 0 at then end... so in a post with lets say around 5 images, the 0 will be at the end and not the start as i need it to, everything else is in the correct order tho.
Is there a way i can make it start at 1 instead?
Reply With Quote
  #12  
Old 30.10.2024, 10:52
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 73,512
Default

Quote:
Originally Posted by Trap View Post
Is there a way i can make it start at 1 instead?
At this moment no. I'd have to either change the plugin behavior or add a 2nd property which I will not do to:
- preserve current behavior for other users
- save memory

Here are some possible solutions:
1. Use an EventScripter script to modify the filenames.
It can parse "postContentIndex" as a number and add +1.
EventScripter forum thread:
https://board.jdownloader.org/showthread.php?t=70525
EventScripter help article:
https://support.jdownloader.org/know...event-scripter


2. or: Simply use an external rename tool to do another rename round outside of JDownloader once the downloads are done.
Example for such a tool: TotalCommander
other possible pieces of similar software: reddit.com/r/software/comments/tqf3tu/bulk_rename_utility_replacement/
__________________
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?

Last edited by pspzockerscene; 20.11.2024 at 18:56. Reason: Fixed typo
Reply With Quote
  #13  
Old 20.11.2024, 18:52
Trap Trap is offline
Junior Loader
 
Join Date: Aug 2024
Posts: 11
Default

Quote:
Originally Posted by pspzockerscene View Post
At this moment no. I'd have to either change the plugin behavior or add a 2nd property which I will not do to:
- preserver current behavior for other users
- save memory

Here are some possible solutions:
1. Use an EventScripter script to modify the filenames.
It can parse "postContentIndex" as a number and add +1.
EventScripter forum thread:
**External links are only visible to Support Staff**...
EventScripter help article:
**External links are only visible to Support Staff**...


2. or: Simply use an external rename tool to do another rename round outside of JDownloader once the downloads are done.
Example for such a tool: TotalCommander
other possible pieces of similar software: reddit.com/r/software/comments/tqf3tu/bulk_rename_utility_replacement/
I might need some help here, so this is the closest that i've gotten to a working script (way more complicated than it needs to be ofc), this one does somewhat work but the place where the 0 was does not get changed, so the order will be like 2,3,4,5,6,7,1 for any collection of images, the behaviour im looking for is for them to also be in the correct order when they download so if i sort by date then i also get the correct order (i already changed settings so it would download in the order that they appear in the linkgrabber).

// EventScripter script to adjust postContentIndex to start at 1 for kemono.su
// Trigger: "A new link has been added"

if (link && link.getHost() === "kemono.su") {
try {
var index = link.getProperty("postContentIndex");
if (index !== null) {
var newIndex = parseInt(index) + 1;
link.setProperty("postContentIndex", newIndex);

// Update the filename to reflect the new index
var fileName = link.getName();
var newFileName = newIndex + "_" + fileName.substring(fileName.indexOf('_') + 1);
link.setName(newFileName);

// Force reordering in LinkGrabber
var package = link.getPackage();
if (package) {
var links = package.getDownloadLinks();
links.sort(function(a, b) {
return a.getProperty("postContentIndex") - b.getProperty("postContentIndex");
});
// Refresh the package to apply the new order
package.setDownloadLinks(links);
}
}
} catch (e) {
log("Error adjusting postContentIndex: " + e.message);
}
}
Reply With Quote
  #14  
Old 20.11.2024, 18:57
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 73,512
Default

Please pose your question in the EventScripter help thread:
https://board.jdownloader.org/showthread.php?t=70525

We do not provide any official support for custom scripting solutions.
__________________
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
  #15  
Old 20.11.2024, 19:51
Trap Trap is offline
Junior Loader
 
Join Date: Aug 2024
Posts: 11
Default

Quote:
Originally Posted by pspzockerscene View Post
Please pose your question in the EventScripter help thread:
**External links are only visible to Support Staff**...

We do not provide any official support for custom scripting solutions.
will do, thank you!
Reply With Quote
  #16  
Old 21.11.2024, 12:15
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,635
Default

Quote:
Originally Posted by Trap View Post
... this one does somewhat work...
Does it work? Not sure if package.setDownloadLinks(links); is a valid method.
Reply With Quote
  #17  
Old 22.11.2024, 11:26
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 73,512
Default

I know that the initial question was about the download order but in the end it's also about the file names.
Thinking out of the box can sometimes also be helpful so you could also just use an external script that renames the files after the download is completed.
ChatGPT is actually perfect to create such a thing in a lazy way.
Here is a batch script example for Windows users (untested!):
Code:
@echo off
setlocal enabledelayedexpansion

:: Change to the directory containing the files
:: Uncomment the next line and replace <directory-path> if necessary
:: cd /d "<directory-path>"

for %%f in (*_*) do (
    :: Extract the filename without the extension
    set "filename=%%~nf"
    :: Extract the extension
    set "extension=%%~xf"

    :: Check if the filename starts with a number
    for /f "tokens=1* delims=_" %%a in ("!filename!") do (
        if "%%a"=="%%a" 2>nul (
            :: Increment the number by 1
            set /a newnum=%%a + 1
            :: Form the new filename
            set "newname=!newnum!_%%b!extension!"
            :: Rename the file
            ren "%%f" "!newname!"
        )
    )
)

echo Files renamed successfully.
pause
Remove the "pause" at the end if you are sure that the script is working.

That script assumes that the number is at the beginning of the file names.
Be sure to only execute it once.
Alternatively it could be changed to only alter files in the directory if one starts with the number 0.
__________________
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
  #18  
Old 22.11.2024, 16:20
Trap Trap is offline
Junior Loader
 
Join Date: Aug 2024
Posts: 11
Default

Quote:
Originally Posted by mgpai View Post
Does it work? Not sure if package.setDownloadLinks(links); is a valid method.
it "worked" in the sense that the numbers were incremented but the places did not change, it would change the order of 1,2,3,4,5,0 to 2,3,4,5,6,1
i gave copilot a non functioning version of an attempt of a script and eventually it spat "that" out, knew it was bs and had way too much bloat but hey, it didn't spit out any errors this time.

Your script was far better and actually worked flawlessly, thanks again kind stranger

(i'll post your script here just in case someone else needs it and stubles upon this thread)

/*
modify postContentIndex property
trigger : packagizer hook
*/

if (state == "BEFORE" && linkcheckDone && link.host == "kemono.su") {
link.setProperty("postContentIndex", link.getProperty("postContentIndex") + 1 + "");
}
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 01:32.
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.