#1701
|
|||
|
|||
![]() Quote:
Code:
/* Move extracted files Trigger : Archive extraction finished */ archive.extractedFilePaths.forEach(function(filePath) { filePath.moveTo(archive.folder); filePath.parent.delete(); }) |
#1702
|
|||
|
|||
![]() Quote:
Code:
/* Add cover art Trigger : Package finished */ var links = package.downloadLinks.filter(function(link) { return link.host == "soundcloud.com" && getPath(link.downloadPath).extension == "mp3"; }) if (links.length) { var ffmpeg = callAPI("config", "get", "org.jdownloader.controlling.ffmpeg.FFmpegSetup", null, "binarypath"); links.forEach(function(link) { var cover = getPath(link.downloadPath.replace(/_\d{9}/, "_original_").replace(/mp3$/, "jpg")); if (cover.exists()) { var input = link.downloadPath; var output = input + ".mp3"; callAsync(function(exitCode) { if (exitCode == 0) { getPath(input).delete(); getPath(output).renameTo(input); } }, ffmpeg, "-hide_banner", "-i", input, "-i", cover, "-map", "0:0", "-map", "1:0", "-c", "copy", output); } }) } |
#1703
|
|||
|
|||
![]()
Hi,
I'm trying to replace spaces in filenames with an underscore within the LinkGrabber to enable mirror detection. However, my current script doesn't work: Code:
myCrawledLink.setName(myCrawledLink.name.replace(/\s/g, "_")) |
#1704
|
|||
|
|||
![]()
When do yo want to replace them? Before or after they are added to linkgrabber? You have to use a trigger/link type accordingly.
|
#1705
|
|||
|
|||
![]()
Before they get added to the download tab. Then they will have identical names, enabling mirror detection to work just based on filme names.:)
|
#1706
|
|||
|
|||
![]() Quote:
Quote:
Code:
/* Replace space with underscore in filenames Trigger : Packagizer Hook */ try { if (state == "BEFORE") { link.setName(link.name.replace(/\s/g, "_")); } } catch (e) {}; |
#1707
|
|||
|
|||
![]() Quote:
![]() |
#1708
|
||||
|
||||
![]()
@mgpai: You have a solution for every problem
![]() ![]()
__________________
JD-Dev & Server-Admin |
#1709
|
|||
|
|||
![]()
Hello everyone
I'm looking for a script for my problem. Maybe someone can help me. I have a lots of packages with xGB and xfiles. The script is supposed to extract only one file with all parts and stop the download in order to start again afterwards. for example: file_01.part1 file_01.part2 file_01.part3 <download done <stop download <start extract <extract done <start download file_02.part1 file_02.part2 ... ... Is that possible? I will be very happy if someone helps me. Sorry for my english |
#1710
|
||||
|
||||
![]()
@qwerti: why extract one by one? JDownloader will download the files and extract as possible
__________________
JD-Dev & Server-Admin |
#1711
|
|||
|
|||
![]() Quote:
Very large packets quickly get stuck because the SSD is full and cannot be extracted. I can't think of a better solution. Edit: I've experimented with download limits. However, it does not always work properly and not at full speed. Last edited by qwerti; 11.05.2021 at 15:18. |
#1712
|
|||
|
|||
![]()
@qwerti: Try this. It is a pretty complex workaround, but should fairly achieve your objective.
It will ensure that only one package is active (download order/sequence of packages may differ) at any give time (by skipping others). Will start the next package only after the current package is finished and any running extractions have stopped. Code:
/* Limit running packages Trigger : A Download Started */ var first = getRunningDownloadPackages()[0]; getAllFilePackages().forEach(function(package) { if (!package.finished && package.UUID != first.UUID) { package.downloadLinks.forEach(function(link) { link.skipped = true; }) } }) Code:
/* Start pending downloads after extraction is finished Trigger : Download Controller Stopped */ while (callAPI("extraction", "getQueue").length) { sleep(1000); } getAllFilePackages().some(function(package) { return !package.finished; }) && startDownloads(); If you have alternative solutions in mind or need any modifications to the current scripts, you can find me in JD Chat. Code:
kiwiirc.com/nextclient/irc.freenode.net/#jdownloader |
#1713
|
||||
|
||||
![]()
@mgpai: an alternative idea, interval checks for ongoing extraction and in case of yes, it stops the downloads and then starts downloads again. or *pause* new downloads
![]() for example trigger is startdownload -> check for ongoing extraction, loop and wait till extraction is finished. I think this might even be better/easier solution ![]()
__________________
JD-Dev & Server-Admin |
#1714
|
|||
|
|||
![]() Quote:
|
#1715
|
||||
|
||||
![]()
@mgpai: just an idea
![]()
__________________
JD-Dev & Server-Admin |
#1716
|
|||
|
|||
![]()
It can always be something which has not occurred to me. So keep them coming.
![]() |
#1717
|
|||
|
|||
![]()
Hello mgpai,
I am very grateful for the quick help ![]() It works great in the following cases. Package one --> 11,37 GB Package tow --> 7,86 GB Package x --> x GB Is it possible to modify it like this? Package one --> 342,23 GB Package one.1 (11 rar-parts) --> 10,31 GBI don't know how to explain it better. I'm sorry |
#1718
|
||||
|
||||
![]()
@qwerti: In case you are talking about sub-packages, those are not supported.
__________________
JD-Dev & Server-Admin |
#1719
|
|||
|
|||
![]() Quote:
Das der JDownloader keine sub-packages unterstützt weiß ich. Ich hab halt sehr oft das Problem das ich in einem package mehrere Dateien habe und die Pakete dadurch locker über mehrere hundert GB groß sind. Mein Speicherplatz auf der SSD ist aber nur knapp 60 GB groß ich kann also bei sehr großen Paketen nicht erst das ganze Paket laden, um es dann zu entpacken. Tut mir leid, wenn ich etwas falsch verstehe und für das deutsch :/ |
#1720
|
|||
|
|||
![]()
Replace "Limit running packages" script with this one. Please note, the script uses a different trigger. Also remember to disable "Synchronous execution of script" checkbox in the top panel of the script editor.
Code:
/* Limit running links/archives Trigger : Download Controller Started Important: Disable Synchronous execution of script checkbox in the top panel */ while (!getRunningDownloadLinks().length) { sleep(1000); } var first = getName(getRunningDownloadLinks()[0]); getAllDownloadLinks().forEach(function(link) { if (!link.finished && getName(link) != first) { link.skipped = true; } }) function getName(link) { try { return link.archive.name; } catch (e) { return link.name; } } |
![]() |
Thread Tools | |
Display Modes | |
|
|