JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #981  
Old 12.10.2019, 11:36
Amiganer Amiganer is offline
DSL Light User
 
Join Date: Mar 2019
Posts: 30
Default Preventing double Downloads

Hello.

I'm now trying to put the Scripts vom #950 and #954 together.
Is it possible to get the directory path from the JD2/cfg/* directory, were the other databese are hold or is it really necessary to put a absolute Path in there?

Bye, Christian
Reply With Quote
  #982  
Old 12.10.2019, 11:56
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 638
Default

Quote:
Originally Posted by Amiganer View Post
Is it possible to get the directory path from the JD2/cfg/* directory, were the other databese are hold or is it really necessary to put a absolute Path in there?
I am assuming you mean this path:
Code:
var list = "c:/downloads/finished.txt"; // <- Set path to history file

You can use any valid path. It can also contain variables. To set the 'cfg' folder as directory path, you can use:
Code:
var list = JD_HOME + "/cfg/finished.txt"; // <- Set path to history file
Reply With Quote
  #983  
Old 13.10.2019, 03:13
Demongornot Demongornot is offline
JD Beta
 
Join Date: Sep 2019
Location: Universe, Local group, Milky Way, Solar System, Earth, France
Posts: 50
Default

Quote:
Originally Posted by Jiaz View Post
@mgpai/Demongornot: I'll suggest to create a new thread for the discussion about the development/ideas/questions for the dupe/history support. I can then move the posts to the new thread.
sorry that I'm so quiet but I don't have much time at the moment :(
@Jiaz @mgpai
Here it is : https://board.jdownloader.org/showpo...88&postcount=1
And don't worry, no one forbid you to have a life
Reply With Quote
  #984  
Old 13.10.2019, 18:11
RPNet-user RPNet-user is offline
Linkgrabbing Monster
 
Join Date: Apr 2017
Posts: 83
Default

mgpai,

How do I set an event script to auto-resume partially downloaded files while JD2 is running?

Example: I have a list of 10 files in the download queue and it is simultaneously downloading one or two files, but at some point 2 or 3 of those files will have stopped at any given point with an error of "invalid download directory" so I have to manually right-click-resume and they will automatically complete successfully while JD2 is running, otherwise they will remain incomplete(partially downloaded). I think a 60-second wait is more than an ample wait-time.

So basically; set an auto-resume flag for partially downloaded non-resumable links with a 60-second wait time.

Minus the 60-sec wait, would this work?

var links = getAllDownloadLinks();

for (i = 0; i < links.length; i++) {
var link = links[i];
if (link.getBytesLoaded() == 0) link.setSkipped(true);
}

startDownloads();

Last edited by RPNet-user; 13.10.2019 at 18:16. Reason: added script sample
Reply With Quote
  #985  
Old 13.10.2019, 21:50
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 638
Default

Quote:
Originally Posted by RPNet-user View Post
... set an event script to auto-resume partially downloaded files while JD2 is running?
Code:
// Unskip and start downloading links with "Invalid download directory" message, if the destination folder is available.
// Trigger : A Download Controller Stopped

getAllFilePackages().forEach(function(package) {
    package.getDownloadLinks().forEach(function(link) {
        if (link.getSkippedReason() == "INVALID_DESTINATION") {
            if (getPath(package.getDownloadFolder()).exists()) {
                link.setSkipped(false);
                if (!isDownloadControllerRunning()) startDownloads();
            }
        }
    })
})

I would not recommend using 'interval' unless you have to, especially if you are having a lot of links. You may end up needlessly iterating through the list using up valuable system resources.

Also, the error might be symptomatic of hardware issues. It might be better to fix the underlying cause. If you provide more information, Jiaz might be able to look into it.
Reply With Quote
  #986  
Old 13.10.2019, 22:12
RPNet-user RPNet-user is offline
Linkgrabbing Monster
 
Join Date: Apr 2017
Posts: 83
Default

Thanks, I already have a thread open on this, however, it is neither hardware nor permission related as this is only occurring when downloading files from only one host: "uploaded", and via the uploaded premium account; uploaded links that are generated via the rpnet-multihoster account plugin does not cause the issue.
So I will enable this script only when downloading "uploaded" links and the uploaded account is enabled since I currently have it as a priority over my multihoster account under account usage rules.
Reply With Quote
  #987  
Old 13.10.2019, 22:26
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 638
Default

Quote:
Originally Posted by RPNet-user View Post
... I will enable this script only when ... the uploaded account is enabled
You can also try this. It will check/process the links only when "uploaded.to" account is enabled.

Code:
// Unskip and start downloading links with "Invalid download directory" message, if the destination folder is available.
// Trigger : Download Controller Stopped

var accountEnabled = callAPI("accounts", "queryAccounts", {
    "enabled": true
}).some(function(account) {
    return account.hostname == "uploaded.to" && account.enabled;
})

if (accountEnabled) {
    getAllFilePackages().forEach(function(package) {
        package.getDownloadLinks().forEach(function(link) {
            if (link.getSkippedReason() == "INVALID_DESTINATION") {
                if (getPath(package.getDownloadFolder()).exists()) {
                    link.setSkipped(false);
                    if (!isDownloadControllerRunning()) startDownloads();
                }
            }
        })
    })
}

Last edited by mgpai; 13.10.2019 at 23:00. Reason: Corrected the description in script
Reply With Quote
  #988  
Old 13.10.2019, 23:00
RPNet-user RPNet-user is offline
Linkgrabbing Monster
 
Join Date: Apr 2017
Posts: 83
Default

thank you mgpai, that one is even better since i would not have to enable/disable it every time i enable the uploaded account.
Reply With Quote
  #989  
Old 14.10.2019, 19:52
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 66,134
Default

@RPNet-User: please see your other thread. create a log for that error. There must be a reason for this and not *workaround* by unskipping
__________________
JD-Dev & Server-Admin
Reply With Quote
  #990  
Old 15.10.2019, 05:30
professorstrangelove professorstrangelove is offline
Modem User
 
Join Date: Oct 2019
Posts: 1
Default

mgpai,

Not sure if this is the right place to post this question... Jiaz told me you were very talented with eventscripter and jdownloader and said that you would be the one I should contact.

It would be very helpful if J-downloader could automatically check a you tube channel and download any new videos that have been posted. This would save a lot of time if a channel has hundreds of videos on it, so that we would not have to sort through the whole channel each time to find new updates.

How would I go about doing this? Are you able to build a script plug in which would enable this feature?

Thank you for your help
Reply With Quote
  #991  
Old 15.10.2019, 13:59
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 638
Default

Quote:
Originally Posted by professorstrangelove View Post
... automatically check a you tube channel and download any new videos that have been posted ...
You can get the latest 15 videos of a user/channel/playlist using XML feed. Here are a set of scripts and rules which can be added to JD to query the RSS feeds at regular intervals and automatically get the links.

Code:
gist.github.com/mgpai/09252b6b72828c290fd141da81be14a1/download
Reply With Quote
  #992  
Old 15.10.2019, 19:40
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 48,900
Default

Merged EventScripter threads.

-psp-
__________________

Ad-free installers || Werbefreie Installer
Windows Setup<--JD2 BETA-->Linux Setup x86 || Linux Setup x64 || Mac Setup
-----=>Support Chat<=-----
Spoiler:

A users' JD crashes and the first thing to ask is:
Quote:
Originally Posted by Jiaz View Post
Do you have Nero installed?
That's true James
Quote:
Originally Posted by James
Die Leute verstehen einfach nicht dass nur weil man mit einer Waffe auch auf Menschen schießen kann dass ein Schützenver​ein kein Ort für Amoklaufide​en ist
Reply With Quote
  #993  
Old 15.10.2019, 20:21
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 638
Default

Quote:
Originally Posted by dsfsdfasdfasf View Post
... Is it possible to blacklist a proxy via eventscripter when it causes a 403 geoblocking state?
I have created a script, but will have to wait until developers add new methods which return the details (IP,PORT etc.) of the blocked connection.



In the meanwhile you can prevent, or atleast reduce the chance of using the same GEO-Blocked connection for the hoster, by setting "GeneralSettings.freeproxybalancemode" to "RANDOM".

Last edited by raztoki; 16.10.2019 at 00:42. Reason: spelling and grammar
Reply With Quote
  #994  
Old 18.10.2019, 09:01
RPNet-user RPNet-user is offline
Linkgrabbing Monster
 
Join Date: Apr 2017
Posts: 83
Default Neither scripts are working

mgpai,
Neither one of these scripts are working, I'm still having to manually right-click and resume.
No issue of any missing directory as I was able to resume them immediately after the error and the download completes them without issues.

Last edited by RPNet-user; 18.10.2019 at 09:10. Reason: added information
Reply With Quote
  #995  
Old 18.10.2019, 09:38
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 638
Default

Quote:
Originally Posted by Jiaz View Post
@RPNet-User: please see your other thread. create a log for that error. There must be a reason for this and not *workaround* by unskipping
Quote:
Originally Posted by RPNet-user View Post
Neither one of these scripts are working, I'm still having to manually right-click and resume.
I was unable to reproduce the issue. I you prefer to unskip the links using a script, I can try to help you troubleshoot it if you find me in JD Chat, when you have such links in the list.

Code:
webchat.freenode.net//#jdownloader?nick=JD_00?
Reply With Quote
  #996  
Old 19.10.2019, 02:04
RPNet-user RPNet-user is offline
Linkgrabbing Monster
 
Join Date: Apr 2017
Posts: 83
Default

Quote:
Originally Posted by mgpai View Post
I was unable to reproduce the issue. I you prefer to unskip the links using a script, I can try to help you troubleshoot it if you find me in JD Chat, when you have such links in the list.

Code:
webchat.freenode.net//#jdownloader?nick=JD_00?
mgpai,
Ignore my previous post, the script does work, I just didn't know that it waits till the end of the downloads and then required a one time script permission prompt to run.
In my impatient mind, I was thinking that the script would unskip and resume immediately just after the invalid directory error. See screenshot, all those partial downloads were invalid directories before the script permission prompt at the end of the completed download queue. By the way, just before the error messages, I know it will happen every time because the download bandwidth drops down to "0" just before the invalid download directory message error occurs, which is only caused by "uploaded" premium account downloads.
Attached Images
File Type: png Invalid.Download.Directory.png (67.6 KB, 1 views)
Reply With Quote
  #997  
Old 20.10.2019, 09:45
Amiganer Amiganer is offline
DSL Light User
 
Join Date: Mar 2019
Posts: 30
Default

Quote:
Originally Posted by Demongornot View Post
@Jiaz @mgpai
Here it is : **External links are only visible to Support Staff**...
And don't worry, no one forbid you to have a life
Hello.
The first thing I see in the script: What is with mirror links?
As I can see, you use "link.isFinished", that event is only triggert for the link that is really downloaded. How do you handle mirror-links?

With what event is the Script triggert?
Maybe you can put some more comments in for explanation, please.

bye, Christian
Reply With Quote
  #998  
Old 21.10.2019, 04:36
Demongornot Demongornot is offline
JD Beta
 
Join Date: Sep 2019
Location: Universe, Local group, Milky Way, Solar System, Earth, France
Posts: 50
Default

Quote:
Originally Posted by pspzockerscene View Post
Merged EventScripter threads.

-psp-
@pspzockerscene Were you aware that the discussion was purposefully not posted in this thread as asked by Jiaz and this is a conscious decision or did you merged it ignoring Jiaz made this request ?

@Amiganer

I have basically done the script which write finished downloads now, I am already in the commenting phase (as it is a small and simple script I didn't needed to comment it while writing it) be prepared as I have close to no experience with commenting my code for sharing it, so I don't know if it will end up correctly or with too much or not enough informations.
I have no idea what to do with mirror links as I haven't found any way to get one to experiment with them.
Since the thread have been merged back again I won't update too much to not overload this general use thread with my script progress.
I have few other things going on so the script isn't progressing super fast but it is still in my priorities.
The part 1 (Writing finished downloads) use "A Download stopped" trigger.
If I got my hand on a pair of links that will be consider as mirror by JD, I'll test out the necessary code to handle them if required.
Edit :
Nevermind, I found a valid mirror, I'll experiment tomorrow with them.
Edit 2 :
For what I see there will be two things I'll add, first, when a download finish, an option to check for their mirrors (as they don't trigger "A Download stopped") in the same package.
And a third script which will work with right click on a download to add it to the history list, it won't be long to code as it will basically pretty much the same as the one for finished downloads, except it won't check for mirrors or if it is finished to lets the user add whatever URL he want.

Last edited by Demongornot; 21.10.2019 at 14:25.
Reply With Quote
  #999  
Old 22.10.2019, 19:32
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 66,134
Default

@Demongornot: pspzocker didn't know about the decision and just merged it back by accident
__________________
JD-Dev & Server-Admin
Reply With Quote
  #1000  
Old 24.10.2019, 00:28
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 48,900
Default

Quote:
Originally Posted by Demongornot View Post
@pspzockerscene Were you aware that the discussion was purposefully not posted in this thread as asked by Jiaz and this is a conscious decision or did you merged it ignoring Jiaz made this request ?
Sorry, my fault :(

-psp-
__________________

Ad-free installers || Werbefreie Installer
Windows Setup<--JD2 BETA-->Linux Setup x86 || Linux Setup x64 || Mac Setup
-----=>Support Chat<=-----
Spoiler:

A users' JD crashes and the first thing to ask is:
Quote:
Originally Posted by Jiaz View Post
Do you have Nero installed?
That's true James
Quote:
Originally Posted by James
Die Leute verstehen einfach nicht dass nur weil man mit einer Waffe auch auf Menschen schießen kann dass ein Schützenver​ein kein Ort für Amoklaufide​en ist
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 17:31.
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 - 2019, Jelsoft Enterprises Ltd.