#1
|
|||
|
|||
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. |
#2
|
||||
|
||||
@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 |
#3
|
||||
|
||||
@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 |
#4
|
||||
|
||||
@pspzockerscene: yes, maybe
@Trap: Please provide feedback
__________________
JD-Dev & Server-Admin |
#5
|
|||
|
|||
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. |
#6
|
||||
|
||||
Quote:
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:
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.
__________________
JD Supporter, Plugin Dev. & Community Manager
Erste Schritte & Tutorials || JDownloader 2 Setup Download |
#7
|
|||
|
|||
Quote:
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? Last edited by Trap; 19.08.2024 at 19:43. Reason: Added context |
#8
|
||||
|
||||
Quote:
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:
__________________
JD Supporter, Plugin Dev. & Community Manager
Erste Schritte & Tutorials || JDownloader 2 Setup Download Last edited by pspzockerscene; 20.08.2024 at 17:41. Reason: Fixed screenshots |
#9
|
|||
|
|||
Quote:
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 |
#10
|
||||
|
||||
Well, that wasn't my intention :D
Quote:
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 |
#11
|
|||
|
|||
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? |
#12
|
||||
|
||||
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 Last edited by pspzockerscene; 20.11.2024 at 18:56. Reason: Fixed typo |
#13
|
|||
|
|||
Quote:
// 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); } } |
#14
|
||||
|
||||
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 |
#15
|
|||
|
|||
will do, thank you!
|
#16
|
|||
|
|||
Does it work? Not sure if package.setDownloadLinks(links); is a valid method.
|
#17
|
||||
|
||||
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 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 |
#18
|
|||
|
|||
Quote:
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 + ""); } |
Thread Tools | |
Display Modes | |
|
|