JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #1  
Old 29.11.2023, 15:02
I3ordo I3ordo is offline
Mega Loader
 
Join Date: Mar 2022
Posts: 65
Default [EventScripter] Resetting a downloaded file with a cmd-line?

JD has trouble detecting the corruptness of the downloaded files.

I mean, i noticed JD is checking integrity and the files pass the JD's crc test but when the files are converted to another archive format by some bat file, i occasionally get corrupt files off those archive files.

The interesting part is, having JD download it again(reset download), does result(100% of the time) with an error free archive despite the source being the same... So either my hdd is failing on a specific folder (???) because of downloads from other hosters are almost never ending up with corrupt archives.

I looked at the packagizer and not saw an option to check file integrity(as it already does it by itself)...

i could set it to autoextract the files but that would not solve it for my setup so...

i wonder if i could send a cmd line like "jd.exe reset "somefile12345.zip" or better yet, make it a fuzzy command like "somefile12345.*"
Reply With Quote
  #2  
Old 29.11.2023, 15:14
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 71,121
Default

Quote:
Originally Posted by I3ordo View Post
JD has trouble detecting the corruptness of the downloaded files.

I mean, i noticed JD is checking integrity and the files pass the JD's crc test but when the files are converted to another archive format by some bat file, i occasionally get corrupt files off those archive files.
Well how do you expect JDownloader to detect this case?
The file is basically getting corrupted by an external script after it has been downloaded successfully and validated correctly...

Quote:
Originally Posted by I3ordo View Post
The interesting part is, having JD download it again(reset download), does result(100% of the time) with an error free archive despite the source being the same... So either my hdd is failing on a specific folder (???) because of downloads from other hosters are almost never ending up with corrupt archives.
Sounds like some other factor is contributing to the file being corrupted.
If I were you I'd try to find the underlying cause instead of creating such a workaround though that's just my opinion.

Quote:
Originally Posted by I3ordo View Post
i wonder if i could send a cmd line like "jd.exe reset "somefile12345.zip" or better yet, make it a fuzzy command like "somefile12345.*"
Yes you can do this for example via our myjdownloader API.
Docs:
https://my.jdownloader.org/developers/
Alternatively you could setup JD to delete successfully downloaded items from your downloadlist and use the old Flashgot API to re-add the file you want to re-download.
Flashgot API docs:
https://support.jdownloader.org/Know...hgot-interface
__________________
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
  #3  
Old 30.11.2023, 01:55
raztoki's Avatar
raztoki raztoki is offline
English Supporter
 
Join Date: Apr 2010
Location: Australia
Posts: 17,615
Default

Just to remove some assumptions here as your original explanation isn't totally clear,
JD has downloaded and crc (like sha1) ok, extracts data using the internal archive exactor to a location of your desire or default (that may or may not be doing crc check also and passing), and then you run some bat which is provided by the archive itself? which results in a corrupt conversion? So maybe writing to a bad harddrive sector or ssd failure (most have detections measure these days, and prevent writing to those locations). If thats the case it sounds like not a JD issue as the corruption happens out of JD control. As in what ever the bat process seems to be introducing variability. You could prove this by disabling delete archive after extraction and, manually extract again either inside JD or outside and run the bat conversion file yourself and see if the outcome is successful. Redownloading the same file shouldn't be required
__________________
raztoki @ jDownloader reporter/developer
http://svn.jdownloader.org/users/170

Don't fight the system, use it to your advantage. :]
Reply With Quote
  #4  
Old 30.11.2023, 08:03
I3ordo I3ordo is offline
Mega Loader
 
Join Date: Mar 2022
Posts: 65
Default

"Well how do you expect JDownloader to detect this case?, The file is basically getting corrupted by an external script after it has been downloaded successfully and validated correctly..."

there is only single operation on the downloaded file and that is converting it to a rar file by winrar cmd argument, and that is the part where i can detect a corrupted file among the archive content.

I dont exactly how JD checks for downloaded file's integrity, maybe the info it gets from the provider is as faulty as the downloaded file... see i am using a premium file re-director like debrid-something and which gets the file from rapid-something ... and something sometimes(very rarely) go wrong.

Ideally i would be able to use such command if JD had it.
HTML Code:
filenames = ["baltsar-chair", "another-file-name"]

# Use the JDownloader API to reset the downloads based on filenames
for filename in filenames:
    # Use the appropriate method to reset or re-download files
    # For example, if there's a resetDownloadLinks method
    jdownloader_api.resetDownloadLinks(filename)
but api seem to need 3 distinct info which i have no idea to get from
HTML Code:
# Replace these with your actual JDownloader API details
api_url = "http://your-jdownloader-api-url:port/call/plugin/reset"
interface_name = "your_interface_name"  # Replace with the actual interface name
display_name = "your_display_name"  # Replace with the actual display name
key = "baltsar-chair"  # Replace with the key or filename you want to reset

# Build the API call URL with parameters
url = f"{api_url}?interfaceName={interface_name}&displayName={display_name}&key={key}"

# Make the API call
response = requests.get(url)

# Check the response
if response.status_code == 200:
    print("Reset successful.")
hoping to get away with supplying just the filename and hope JD magically reset that file's download...
Reply With Quote
  #5  
Old 01.12.2023, 05:26
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,553
Default

Quote:
Originally Posted by I3ordo View Post
hoping to get away with supplying just the filename and hope JD magically reset that file's download...
abracadabra:
Code:
/*
    reset download link from command line
    trigger : new crawler job
    example : jdownloader2 "RESET myfilename.rar"
*/

try {
    var myString = job.text.split("RESET ")[1];

    getAllDownloadLinks().some(function(link) {
        if (link.finished && link.name == myString) {
            alert("Found: " + myString);
            //link.reset();
            return true;
        }
    })
} catch (e) {
    //alert(e.message);
}
Reply With Quote
  #6  
Old 04.12.2023, 01:37
I3ordo I3ordo is offline
Mega Loader
 
Join Date: Mar 2022
Posts: 65
Default

Quote:
Originally Posted by mgpai View Post
abracadabra:
Code:
/*
    reset download link from command line
    trigger : new crawler job
    example : jdownloader2 "RESET myfilename.rar"
*/

try {
    var myString = job.text.split("RESET ")[1];

    getAllDownloadLinks().some(function(link) {
        if (link.finished && link.name == myString) {
            alert("Found: " + myString);
            //link.reset();
            return true;
        }
    })
} catch (e) {
    //alert(e.message);
}
this looks very possible! thank you already! worth a try!
Reply With Quote
  #7  
Old 27.12.2023, 17:16
I3ordo I3ordo is offline
Mega Loader
 
Join Date: Mar 2022
Posts: 65
Default

Quote:
Originally Posted by mgpai View Post
abracadabra:
Code:
/*
    reset download link from command line
    trigger : new crawler job
    example : jdownloader2 "RESET myfilename.rar"
*/

try {
    var myString = job.text.split("RESET ")[1];

    getAllDownloadLinks().some(function(link) {
        if (link.finished && link.name == myString) {
            alert("Found: " + myString);
            //link.reset();
            return true;
        }
    })
} catch (e) {
    //alert(e.message);
}
I have not trid this yet, had a crazy deadline and i dont know what to do with this.. do i save this as a crawljob or is this an event script? how would one go about if had a folder of corrupt downloads and want to reset them in JD?
it saysa command like so i make bat script? and i need to replace myString?
Reply With Quote
  #8  
Old 30.11.2023, 09:22
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 71,121
Default

Quote:
Originally Posted by I3ordo View Post
I dont exactly how JD checks for downloaded file's integrity
JD checks it based on whatever strongest hash is available.
That depends on the provider which delivers the file - some provide a CRC hash, some don't.
I could provide a list of supported hash types but as long as I don't know where you're downloading from this will not be helpful.
Example of a website which provides file hashes: drive.google.com
Example of a website which does not provide file hashes: workupload.com

Quote:
Originally Posted by I3ordo View Post
maybe the info it gets from the provider is as faulty as the downloaded file
Sure that can happen but then the file would be irreversibly broken serverside and it wouldn't work on the 2nd attempt.

Quote:
Originally Posted by I3ordo View Post
see i am using a premium file re-director like debrid-something and which gets the file from rapid-something ... and something sometimes(very rarely) go wrong.
So you're downloading via multihoster?
Which multihoster are you using and which links (= from which filehoster) were you downloading through that multihoster?
Indeed multihosters are prone to failure and some of them are allowed to deliver files with a different hash than the original/expected file.

Quote:
Originally Posted by I3ordo View Post
but api seem to need 3 distinct info which i have no idea to get from
For myjd / myjd API support please post in the myjd thread:
https://board.jdownloader.org/showth...=49956&page=63

If I were you I'd rather try to find the cause of the problem other than work around it.
In the end, if the problem is caused by a multihoster maybe you can just report the problem to them and they'll fix it.
__________________
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
  #9  
Old 30.11.2023, 15:53
I3ordo I3ordo is offline
Mega Loader
 
Join Date: Mar 2022
Posts: 65
Default

Quote:
Originally Posted by pspzockerscene View Post
So you're downloading via multihoster?
Which multihoster are you using and which links (= from which filehoster) were you downloading through that multihoster?
Indeed multihosters are prone to failure and some of them are allowed to deliver files with a different hash than the original/expected file.
it did not make sense to post actual links as even those links would come out fine. the failure rate of the files are 3% and the issue goes away on the second time 100% so far..

Quote:
Originally Posted by pspzockerscene View Post
For myjd / myjd API support please post in the myjd thread:
**External links are only visible to Support Staff**...
Does this mean, it is not possible to reset a download by just supplying the filename? i need all three for it to function? if so, i would rather go with the manual way of finding each and reset...
Quote:
Originally Posted by pspzockerscene View Post
If I were you I'd rather try to find the cause of the problem other than work around it.
In the end, if the problem is caused by a multihoster maybe you can just report the problem to them and they'll fix it.
Well i do report some problems like "notdebrid" errors but since it is a ~3% occurance... they would not bother , i mean i would not

ps: how would a cmdline look like for a file named orange.jpg, one example would get me going (if i need all 3 values to form a single reset "file" command, nevermind)

Last edited by I3ordo; 30.11.2023 at 16:30.
Reply With Quote
  #10  
Old 30.11.2023, 16:14
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 71,121
Default

Quote:
Originally Posted by I3ordo View Post
Does this mean, it is not possible to reset a download by just supplying the filename?
Most likely it is not since an item with that same name could theoretically exist in your downloadlist 100 times in 100 different packages

Quote:
Originally Posted by I3ordo View Post
i need all three for it to function?
All 3 of what?
You most likely need to know some kind of unique id of the item you want to change/delete.
I haven't ever worked with our myjdownloader API so please read the documentation and/or ask other users in the myjd thread.

Quote:
Originally Posted by I3ordo View Post
Well i do report some problems like "notdebrid" errors
The API error "notDebrid" of multihoster debrid-link.fr is an error which is to be expected. No need to report that to their support.
See their API docs:
debrid-link.fr/api_doc/v2/introduction
--> Search for "notDebrid" to find a description of this error.
Of course you are free to report whatever you like to their support - that's just my 2 cents.
__________________
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 30.11.2023, 18:54
I3ordo I3ordo is offline
Mega Loader
 
Join Date: Mar 2022
Posts: 65
Default

Quote:
Originally Posted by pspzockerscene View Post
Most likely it is not since an item with that same name could theoretically exist in your downloadlist 100 times in 100 different packages
well maybe i was ready to take the risk of re-downloading some exta files you know...
Reply With Quote
  #12  
Old 01.12.2023, 13:38
raztoki's Avatar
raztoki raztoki is offline
English Supporter
 
Join Date: Apr 2010
Location: Australia
Posts: 17,615
Default

mutlihosters switching sources urls on you is most likely the cause, we had to add a lot of code over the years to help with this as most do not advertise that they are doing it. But it can easily break checksumming tasks and extraction tasks if its not the content that you're expecting. on a good note, not likely to be a harddrive/ssd failure, not is jd at fault =]
__________________
raztoki @ jDownloader reporter/developer
http://svn.jdownloader.org/users/170

Don't fight the system, use it to your advantage. :]
Reply With Quote
  #13  
Old 01.12.2023, 13:41
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 71,121
Default

It was mostly with multihosters + rapidgator if I remember correctly.

It is prone to happen as some multihosters will do caching which allows them to save traffic but at the same time they will sometimes mix different mirrors where only some bytes are different which can result in working and complete files which get marked with "CRC check failed" by JD.
__________________
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
  #14  
Old 28.12.2023, 14:28
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 71,121
Default

That is an EventScript.

EventScripter forum thread:
https://board.jdownloader.org/showthread.php?t=70525
EventScripter help article:
https://support.jdownloader.org/Know...event-scripter
__________________
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
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 22:39.
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.