JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #2201  
Old 04.06.2022, 12:55
StefanM's Avatar
StefanM StefanM is offline
JD Legend
 
Join Date: Oct 2020
Posts: 722
Default Script for exporting result of 'Copy information' to an csv-file?

When you export data using 'copy information' in the context menu, you can define, what you want to copy to clipboard.

E.g: {type};{name};{filesize};{path};{url}
Note: Using TAB instead of ; as separator can be helpful, when you are dealing with file or folder names containing ;

Then you can copy the clipboard contents e.g. to Excel.


Jiaz recommended that I should ask here, if a script for that already has been written or could be written.
And - as mentioned above - the separator should be TAB, because ',' and also ';' can be part of file or folder names, which would mess up the Excel sheet.
Reply With Quote
  #2202  
Old 04.06.2022, 14:53
Mydgard Mydgard is offline
Fibre Channel User
 
Join Date: Jan 2011
Location: Germany
Posts: 115
Default

As i am bad like hell in programming ...

Dunno if someone posted here ... but does anyone as an eventscripter script to disable CRC Check for any unpacked files? So CRC only for zipped/rared Files where a CRC Error would prevent unpacking?

Thx
Reply With Quote
  #2203  
Old 04.06.2022, 14:54
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,046
Default

@StefanM: In case you want to experiment by yourself, see
https://board.jdownloader.org/showpo...&postcount=102
https://board.jdownloader.org/showpo...&postcount=794
https://board.jdownloader.org/showpo...6&postcount=19
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2204  
Old 04.06.2022, 14:56
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,046
Default

@Mydgard: why you want to disable CRC for non archives? why disable it all?
I'm sorry but currently it's not possible to disable it on *per file basis*.
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2205  
Old 04.06.2022, 15:20
Mydgard Mydgard is offline
Fibre Channel User
 
Join Date: Jan 2011
Location: Germany
Posts: 115
Default

Quote:
Originally Posted by Jiaz View Post
@Mydgard: why you want to disable CRC for non archives? why disable it all?
I'm sorry but currently it's not possible to disable it on *per file basis*.
Psp said it should be possible with event scripter ...

And i want to do that because my Download HDD is @100% while CRC Checking all those Rapidgator links ...
Reply With Quote
  #2206  
Old 04.06.2022, 15:27
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,600
Default

Quote:
Originally Posted by Mydgard View Post
... script to disable CRC Check for any unpacked files ...
Code:
/*
    Remove hashinfo from non-archive files
    Trigger: Packagzier Hook
*/

!link.crawledLink.archive && link.setProperty("HASHINFO", null);


Code:
/*
    Disable hashcheck
    Trigger: Packagzier Hook
*/

state == "BEFORE" && linkcheckDone && !link.crawledLink.archive && link.setProperty("ALLOW_HASHCHECK", false);

Last edited by mgpai; 04.06.2022 at 16:04. Reason: Script replaced.
Reply With Quote
  #2207  
Old 04.06.2022, 15:29
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,046
Default

@Mydgard: Thanks for the feedback. He is right, I had to check source. There is a property that can be set "ALLOW_HASHCHECK" to false, so no hashcheck is done on the file.
Better wait for mgpai to help with a script that set this property, eg a script that set the property after linkcheck.
But it's okay that a HDD is working/high IO Load during check because the whole file has to be read for checking. a HDD may work and is not designed to have as less reads as possible
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2208  
Old 04.06.2022, 15:30
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,046
Default

@mgpai: don't change HASHINFO property as it might get updated/set again during normal plugin work. Better set the named property , see my previous post
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2209  
Old 04.06.2022, 16:12
Mydgard Mydgard is offline
Fibre Channel User
 
Join Date: Jan 2011
Location: Germany
Posts: 115
Default

@mgpai / Jiaz:

Thx, tried this:

/*
Remove hadinfo from non-archive files
Trigger: Packagzier Hook
*/
state == "BEFORE" && linkcheckDone && !link.crawledLink.archive && link.setProperty("ALLOW_HASHCHECK", false);

Trigger is "Hook für Paketverwalter".

Started a RG Link ... after download a CRC Check occurs ...

So either the script isnt working, i did a mistake or the new script works only for newly added RG links? That would be bad as i have a huge amount of RG links in JD2.

Thx
Reply With Quote
  #2210  
Old 04.06.2022, 16:17
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,046
Default

@Mydgard: The rule is only applied on *Packagizer*, so during adding of new links. In case you want to modify existing links in list, you will need a different script that loops through all links and modifies this property for all non archive links. Please wait for mgpai for further help with this
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2211  
Old 04.06.2022, 16:28
Mydgard Mydgard is offline
Fibre Channel User
 
Join Date: Jan 2011
Location: Germany
Posts: 115
Default

Ah okay thx Helpful for new links as well yes but mainly needed for existing links ...
Reply With Quote
  #2212  
Old 04.06.2022, 16:29
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,046
Default

@Mydgard: I'm sure mgpai will be able to write a wonderful script for you
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2213  
Old 04.06.2022, 16:41
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,600
Default

Quote:
Originally Posted by Jiaz View Post
...you will need a different script that loops through all links and modifies this property for all non archive links ...
No trigger required (since it's to be run only once). Add the script and click 'Test Run' in the script editor menu to execute it.

Code:
/*
    Disable hashcheck for non-archive files
    Trigger : None
*/

getAllDownloadLinks().forEach(function(link) {
    !link.finished && link.hashInfo && !link.archive && link.setProperty("ALLOW_HASHCHECK" , false);
})

getAllCrawledLinks().forEach(function(link) {
    link.hashInfo && !link.archive && link.setProperty("ALLOW_HASHCHECK" , false);
})
Reply With Quote
  #2214  
Old 04.06.2022, 16:48
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,046
Default

@mgpai: maybe we add new trigger type (manual) with a button *run* besides? your opinion on this?
or all *manual* scripts are available automatically in rightclick context menu. new type "context menu entry", so it automatically adds to context menu?
__________________
JD-Dev & Server-Admin

Last edited by Jiaz; 04.06.2022 at 16:50.
Reply With Quote
  #2215  
Old 04.06.2022, 17:27
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,600
Default

Quote:
Originally Posted by StefanM View Post
Note: Using TAB instead of ; as separator can be helpful, when you are dealing with file or folder names containing ;
You can use "TAB" or any other character as separator in 'copy information' menu command.

Quote:
Originally Posted by StefanM View Post
Jiaz recommended that I should ask here, if a script for that already has been written or could be written.
This thread has several scripts which can be used to format/export data. @Jiaz has listed some of them. You can also use scripts to perform dupe checks from within JD instead of exporting and comparing them manually.
Reply With Quote
  #2216  
Old 04.06.2022, 17:30
Mydgard Mydgard is offline
Fibre Channel User
 
Join Date: Jan 2011
Location: Germany
Posts: 115
Default

@mgpai: will i get a end message or something similar? have 10877 links in jd2 actual ...

Not sure how long it will take to run?
Reply With Quote
  #2217  
Old 04.06.2022, 17:34
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,600
Default

Quote:
Originally Posted by Jiaz View Post
@mgpai: maybe we add new trigger type (manual) with a button *run* besides? your opinion on this?
or all *manual* scripts are available automatically in rightclick context menu. new type "context menu entry", so it automatically adds to context menu?
A button outside of the editor may not be needed as they are run (mostly) only once, at the time of adding them.
Reply With Quote
  #2218  
Old 04.06.2022, 17:39
StefanM's Avatar
StefanM StefanM is offline
JD Legend
 
Join Date: Oct 2020
Posts: 722
Default

Quote:
Originally Posted by mgpai View Post
You can use "TAB" or any other character as separator in 'copy information' menu command.
Yes, I have been using TABs all the time, as I know that.
I just wanted to point out to other readers here, that - if they do it that way - they should prefer using TABs.

And of course, any script should use TABs as well.

This is what I wanted to say.
Reply With Quote
  #2219  
Old 04.06.2022, 17:44
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,600
Default

Quote:
Originally Posted by Mydgard View Post
@mgpai: will i get a end message or something similar? have 10877 links in jd2 actual ...

Not sure how long it will take to run?
The script does not display any message, but changes will be applied almost immediately. Just try downloading a non-archive file which has a checksum.

You can use this to get the count of links which for which hashcheck has been disabled

Code:
/*
    Show hascheck disabled count
    Trigger : None
*/

var count = 0;


getAllDownloadLinks().forEach(function(link) {
    link.getProperty("ALLOW_HASHCHECK") == false && count++;
})

getAllCrawledLinks().forEach(function(link) {
    link.getProperty("ALLOW_HASHCHECK") == false && count++;
})

alert("Hash check is disabled for " + count + " links");
Reply With Quote
  #2220  
Old 04.06.2022, 17:46
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,600
Default

Quote:
Originally Posted by StefanM View Post
Yes, I have been using TABs all the time, as I know that.
It's clear now.
Reply With Quote
  #2221  
Old 04.06.2022, 18:01
Mydgard Mydgard is offline
Fibre Channel User
 
Join Date: Jan 2011
Location: Germany
Posts: 115
Default

[QUOTE=mgpai;503641]
You can use this to get the count of links which for which hashcheck has been disabled

4657 Links ...

Testet a small file, no crc check occured ... so it it worked

Thanx again.

Last edited by Mydgard; 04.06.2022 at 18:08.
Reply With Quote
  #2222  
Old 04.06.2022, 18:01
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,600
Default

Quote:
Originally Posted by Mydgard View Post
@mgpai: will i get a end message or something similar? have 10877 links in jd2 actual ...

Not sure how long it will take to run?
I have tested only on list with few links, so not sure how long it will take for 10k+ links. How many of those are unfinished links? If in doubt, I can modify the script to display a message at the end. You will have to restart JD (to abort the current script if it is running) and add the new script and run it again.
Reply With Quote
  #2223  
Old 04.06.2022, 18:03
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,600
Default

Quote:
Originally Posted by Mydgard View Post
4657 Links ...
Guess all good then.
Reply With Quote
  #2224  
Old 04.06.2022, 18:16
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,600
Default

Quote:
Originally Posted by StefanM View Post
... or could be written.
Code:
/*
    Export link info
    Trigger : Downloadlist contextmenu button pressed
    Customizze downloadlist context menu > Add a noew "Eventscripter Trigger" button > Rename it to "Export link info"
*/

if (name == "Export link info") {
    var file = JD_HOME + "/" + Date.now() + ".tsv";
    var data = [];

    dlSelection.links.forEach(function(link) {
        data.push([getPath(link.downloadPath).extension, link.name, link.bytesLoaded, link.downloadPath, link.url].join("\t"));
    })

    if (data.length) {
        writeFile(file, data.join("\r\n"), true);
    }
}
Reply With Quote
  #2225  
Old 04.06.2022, 18:34
Mydgard Mydgard is offline
Fibre Channel User
 
Join Date: Jan 2011
Location: Germany
Posts: 115
Default

@mgpai: All unfinished ... why should i hold finished links in jd2? Before you may ask: yes all those links are around 22,91 TB of space i don't have actual ... some of them are somewhat older Approx 17,5 TB are RG links ...

Last edited by Mydgard; 04.06.2022 at 18:36.
Reply With Quote
  #2226  
Old 04.06.2022, 18:38
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,600
Default

Quote:
Originally Posted by Mydgard View Post
@mgpai: All unfinished ... why should i hold finished links in jd2?
Asked because many users leave finished links in the list to know if a file has been downloaded before and avoid downloading it again. There are users who have millions (not exaggerating) of finished links in the download list.
Reply With Quote
  #2227  
Old 04.06.2022, 21:41
Mydgard Mydgard is offline
Fibre Channel User
 
Join Date: Jan 2011
Location: Germany
Posts: 115
Default

Okay? One Page ago you told someone he could use a dupe check within existing links, tried to google that, but ... even as dupe check in link grabber is active i have dupes in my list ... several times i downloaded a file and somewhere in the list it shows "mirror is loading" exact same name same file size ... dunno why jd2 didn't showed the new link in red to tell me it is still in list ...

Any chance to give me fix script to find those dupes?
Reply With Quote
  #2228  
Old 05.06.2022, 09:55
slcf2003 slcf2003 is offline
Registered / Inactive
 
Join Date: Nov 2021
Posts: 2
Default

Hi mgpai,

I'm running my JD on a remote vps as a download station, and I ssh to the vps and upload the downloaded file to a transfer site called oshi.at using the command
Code:
curl -T /path/to/file **External links are only visible to Support Staff**
Could you make a script for me to achieve the above task, so that I don't have to do the ssh every time? I would like the script to be triggered when the download task is done, and also when the file's extention is rar or zip. I don't know if I'm able to use the curl or call a bash script in the JD's event scripter.

Thank you.
Reply With Quote
  #2229  
Old 05.06.2022, 15:58
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,046
Default

@slcf2003: you should also explain what to do then for example what to do with response, most likely it will contain a download URL then?
Quote:
Originally Posted by slcf2003 View Post
I don't know if I'm able to use the curl or call a bash script in the JD's event scripter.
Yes you can, see/search this thread, there are many examples how to execute external tool/script.
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2230  
Old 05.06.2022, 16:02
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,046
Default

Quote:
Originally Posted by Mydgard View Post
dunno why jd2 didn't showed the new link in red to tell me it is still in list ...
*Already in list* only works on full URL or internal linkID. When URL changes, then this duplicate detection won't work.

Quote:
Originally Posted by Mydgard View Post
check in link grabber is active i have dupes in my list ... several times i downloaded a file and somewhere in the list it shows "mirror is loading" exact same name same file size ...
Mirror is not Duplicate. Mirror just means JDownloader detects a file *as same* based on your setup mirror conditions (eg filename and filesize). Duplicate is the exact same link

Quote:
Originally Posted by Mydgard View Post
Any chance to give me fix script to find those dupes?
I'm sure mgpai can help with this, but you will have to decide the condition. because filename alone is unsafe. also you have to decide if you only want to check against safe or unsafe filename/filesize. Safe = JDownloader will use the filename/filesize for downloading (eg information provided by an api) while unsafe means that filename or size can still change.

Maybe you should try to do a teamviewer session with mgpai(or us) and explain him what you want to achieve, so he/us can take a look at the *situation* and provide better help!
__________________
JD-Dev & Server-Admin

Last edited by Jiaz; 05.06.2022 at 16:15.
Reply With Quote
  #2231  
Old 06.06.2022, 22:34
Tomrich Tomrich is offline
Wind Gust
 
Join Date: Aug 2020
Posts: 43
Default

Quote:
Originally Posted by Jiaz View Post
@Tomrich: I would recommend to check/fix the installation, see **External links are only visible to Support Staff**...
then install the eventscripter via webinterface , hit the button, and then restart JDownloader
i tried this but after restart or reboot i can't connect via myjdownloader. can i do the login again? the only way i know is this https://support.jdownloader.org/Know...bedded-devices but thats for installing jdownloader.
Reply With Quote
  #2232  
Old 06.06.2022, 22:37
flowlapache flowlapache is offline
Registered / Inactive
 
Join Date: Oct 2016
Posts: 31
Default parse a url from a board needing login

Hi ! I try to make a script to let JD to search some direct links from a board where it's needed to be logged in to view those direct links; but I can't fin dexample...Could you help me please? thanks
Reply With Quote
  #2233  
Old 07.06.2022, 07:36
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,600
Default

Quote:
Originally Posted by flowlapache View Post
Hi ! I try to make a script to let JD to search some direct links from a board where it's needed to be logged in to view those direct links; but I can't fin dexample...Could you help me please? thanks
Script
Reply With Quote
  #2234  
Old 07.06.2022, 19:29
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,046
Default

@Tomrich: close JDownloader/kill running process and the same command line can be used
Quote:
java -jar JDownloader.jar -norestart
in case your MyJDownloader logins are missing/wrong, JDownloader will ask for them again
else contact us via support@jdownloader.org and we can take a look at it together
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2235  
Old 09.06.2022, 09:47
xefeg xefeg is offline
JD Alpha
 
Join Date: Oct 2019
Posts: 24
Default

Script Request - Split larger than x_size and move them to folder

1. Download Files (extensions are usually, .rar .zip .exe .dmg .apk)
2. Download Finished (Extraction of .rar or .zip is not required)
3. If filesize is smaller than 999 MB move to folder A
4. Else, Split Files into parts to a certain size, usually 999 MB parts (Size999.part1.rar, Size999.part2.rar)
5. Move split files to folder A

Last edited by xefeg; 09.06.2022 at 10:18.
Reply With Quote
  #2236  
Old 09.06.2022, 10:14
xefeg xefeg is offline
JD Alpha
 
Join Date: Oct 2019
Posts: 24
Default

Script - Move downloaded files from specific folder to folder A

Using Packagizer, I sort my files based on the host it downloaded. Here is what I need.

1. Download from Google.com
2. Folder for Google.com is Folder A using Packagizer
3. Move files from Folder A to Folder B

Solution is here by mgpai
https://board.jdownloader.org/showpo...6&postcount=35

Last edited by xefeg; 09.06.2022 at 13:52. Reason: Request filled and link to the script
Reply With Quote
  #2237  
Old 09.06.2022, 12:29
StefanM's Avatar
StefanM StefanM is offline
JD Legend
 
Join Date: Oct 2020
Posts: 722
Default Script to add (random) delays between requests and/or downloads

@mgpai or anyone who can help

NEW REQUEST
Adding (random) delays between requests and/or downloads


Many webpages detect too many requests/downloads in a short period of time and then block the user IP for some time.
That's why with some Download Managers the user can define delays between requests/downloads.

If possible, a script for this would really be appreciated.

A possible URS would look like this

A) Timer definition (optional!)
The user can either define a fixed delay in seconds. Optional (not that important): User can define a random delay between X and Y seconds.
Note: To make things not too complicated, a script with a fixed delay, e.g. 2 seconds, would be fine with me.


B) (Random) delay while grabbing links
Link grabbing must be reduced to only one request at a time. After a request has been sent by JD, the 'programmed' timer will start.

Once the timer has run out, the next request will be sent.


C) (Random) delay while downloading
Max. simultaneous downloads should work as usual. Let's assume the limit was set to 3:

JD should start with the first download. At the same time the 'programmed' timer will start.

Once the timer has run out, the second download will be started. Again the 'programmed' timer will start. Once the timer has run out, the third download will be started. Once again, the 'programmed' timer will start.

If one of those three downloads has been finished, a new download will not be started before the timer has run out.



PS: I filed this as a feature request first, but it was declined. At the same time pspzockerscene recommended to ask for such a script here.
Reply With Quote
  #2238  
Old 09.06.2022, 12:44
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,046
Default

Quote:
Originally Posted by StefanM View Post
Many webpages detect too many requests/downloads in a short period of time and then block the user IP for some time.
That's why with some Download Managers the user can define delays between requests/downloads.
Please see my comment here https://board.jdownloader.org/showthread.php?t=90790
A.) you can use sleep command in scripts
B.) @mgpai: you could use packagizer hook here to add sleep/wait in linkcrawler
C.) @StefanM: you can add sleep/wait before/after a download start/finish but only on download/link level NOT on request level
@mgpai: synchronous script with dummy script
Quote:
sleep=10000;
while(sleep>0 && !link.isAborting())
sleep(1000)
sleep=sleep-1000;
I will add new DownloadLinkSandbox.isAborting() method for this
__________________
JD-Dev & Server-Admin

Last edited by pspzockerscene; 09.06.2022 at 17:28. Reason: Fixed typo
Reply With Quote
  #2239  
Old 09.06.2022, 13:06
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,046
Default

Quote:
Originally Posted by xefeg View Post
4. Else, Split Files into parts to a certain size, usually 999 MB parts (Size999.part1.rar, Size999.part2.rar)
5. Move split files to folder A
Why the need to split them? Please know that this will most likely break (manual) extraction of multipart archives when a single part is larger and split. for example: first file might be Size999.part1.part1.rar, Size999part1.part2.rar and second file Size999.part2.rar
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2240  
Old 09.06.2022, 13:11
xefeg xefeg is offline
JD Alpha
 
Join Date: Oct 2019
Posts: 24
Default

Quote:
Originally Posted by Jiaz View Post
Why the need to split them? Please know that this will most likely break (manual) extraction of multipart archives when a single part is larger and split. for example: first file might be Size999.part1.part1.rar, Size999part1.part2.rar and second file Size999.part2.rar
If a 2GB file is downloaded and has a folder. Will it be able to split the folder which contants the file into parts? lets say 900MB.part1.rar....?
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 11:36.
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.