JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #2121  
Old 04.03.2022, 13:29
mini_ash mini_ash is offline
I will play nice!
 
Join Date: Mar 2022
Posts: 1
Default

new to this is they a way to set download folder location since it only downloads to the default folder

example looking for
youtube-url.txt = B:\\youtube-downloads
reddit-url.txt = E:\\reddit-downloads

i am using this version of the code

Quote:
Code:
/*
Add urls
Trigger : Interval
Recommended : 3600000 (1 hours) or more
*/

var file = "c:\\downloads\\urls.txt"; // valid path separators "" or "/"

try {
var links = readFile(getPath(file));

callAPI("linkgrabberv2", "addLinks", {
links: links
})

!isDownloadControllerRunning() && startDownloads();
} catch (e) {};
Reply With Quote
  #2122  
Old 04.03.2022, 16:43
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,084
Default

@mini_ash: you could move your links into a Crawljob file (use boardsearch) for the Folderwatch extension. There you can specify a download folder/package name for the links within the job.
else just specify additional "destinationFolder"
Quote:
callAPI("linkgrabberv2", "addLinks", {
links: links,
destinationFolder: "c:..."
})
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2123  
Old 04.03.2022, 16:55
pspzockerscene's Avatar
pspzockerscene pspzockerscene is online now
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 69,634
Default

More information about .crawljob files (and our Folder Watch addon): Click
__________________
JD Supporter, Plugin Dev. & Community Manager
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?
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
  #2124  
Old 10.03.2022, 15:56
assoemitro assoemitro is offline
Vacuum Cleaner
 
Join Date: Dec 2019
Posts: 15
Default

Hi, I heard this is a magical place in which we can request almost anything.

In this case, let me know if this is feasible.

I have been reviewing the speediness of the process of my computer and I found that the download speed is optimised when there is no ongoing extraction of the previous completed package.

For sample, when there is no extraction, I can have download up until 90-100Mb/s but when there is extraction, I can only have 5-8Mb/s average

1) Download in progress per package (meaning when 1 package is underway, no other package can be downloaded)

2) When the package downloaded is completed, then extraction will start (at this point no new package will start download)

3) Extraction completed and then next package will start download
Reply With Quote
  #2125  
Old 11.03.2022, 07:10
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,495
Default

Quote:
Originally Posted by assoemitro View Post
... let me know if this is feasible.
Code:
/*
    Stop dwonloads during extraction
    Trigger: Package finished
*/    

var isExtracting = function() {
    return callAPI("extraction", "getQueue").length > 0;
}

if (isDownloadControllerRunning() && isExtracting()) {
    stopDownloads();

    while (isExtracting()) {
        sleep(5000);
    }

    startDownloads();
}
Reply With Quote
  #2126  
Old 11.03.2022, 11:21
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,084
Default

@mgpai: have you received my email about history idea?
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2127  
Old 11.03.2022, 11:53
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,495
Default

Quote:
Originally Posted by Jiaz View Post
@mgpai: have you received my email about history idea?
@Jiaz: Yes I have. Thank you.

Sorry I haven't replied yet. Thought I'll check it out first and then share my thoughts. Haven't got around to it yet. Will do soon.
Reply With Quote
  #2128  
Old 11.03.2022, 12:03
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,084
Default

@mgpai: no need to hurry, just wanted to know if you've received an email
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2129  
Old 11.03.2022, 14:47
assoemitro assoemitro is offline
Vacuum Cleaner
 
Join Date: Dec 2019
Posts: 15
Default

Quote:
Originally Posted by mgpai View Post
Code:
/*
    Stop dwonloads during extraction
    Trigger: Package finished
*/    

var isExtracting = function() {
    return callAPI("extraction", "getQueue").length > 0;
}

if (isDownloadControllerRunning() && isExtracting()) {
    stopDownloads();

    while (isExtracting()) {
        sleep(5000);
    }

    startDownloads();
}

Thanks for your prompt action. It works but there is another point in my request that if it is possible to download 1 package at a time, so if there are 3 packages that each contains 2 files but my max simultaneous download are 5, it will only download 2 files from 1st package at this time.

The reasoning of this is that when extraction is underway, the others files will not stop downloading right away and sometimes the process takes several minutes to completely stop. Also CRC checking also become extremely slow.

++ Also I found a bug, It works for the 1st file, but the process does not repeat again for the 2nd. I think it needs additional script line to repeat the process.

Last edited by assoemitro; 11.03.2022 at 14:58. Reason: add more info + bug found
Reply With Quote
  #2130  
Old 13.03.2022, 05:26
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,495
Default

Quote:
Originally Posted by assoemitro View Post
... but there is another point in my request that if it is possible to download 1 package at a time
To download only select packages or links you will have to to start them using 'force download start' option in context menu instead of 'start' button in the toolbar.

While this can be automated using a script, if the package does not finish downloading for any reason, the script will try to start the the same package in a loop and the list will not progress. It is better to use the default option and try to limit the active downloads using global/host connection limit.

Quote:
Originally Posted by assoemitro View Post
The reasoning of this is that when extraction is underway, the others files will not stop downloading right away and sometimes the process takes several minutes to completely stop. Also CRC checking also become extremely slow.
Try the new scripts posted below.

Quote:
Originally Posted by assoemitro View Post
++ Also I found a bug, It works for the 1st file, but the process does not repeat again for the 2nd. I think it needs additional script line to repeat the process.
I don't use JD on a regular basis, and hence can perform only short/basic tests. I could not reproduce the issue. It is quite possible my test conditions are different than yours, so cannot say for sure what it causing it.

In any case, while the following 2 scripts will not limit the downloads to a single package, it will most likely achieve your objective, since it will stop active downloads when ANY extraction activity is detected. Let me know if you run into any issues.

Code:
/*
    Stop downloads during extraction
    Trigger: Any extaction event
*/

isDownloadControllerRunning() && stopDownloads();
Code:
/*
    Start downloads after extraction
    Trigger: Archive extraction finished
*/

!callAPI("extraction", "getQueue").length && startDownloads();
Reply With Quote
  #2131  
Old 23.03.2022, 07:13
dandyclubs dandyclubs is offline
DSL User
 
Join Date: Apr 2013
Posts: 36
Default [request] filename wrong

#1


linkgrabber

k2s.cc site get filename

=_utf-8_B_S29yaW5hIEtvdmEgLSBUcnV0aCBvciBEYXJlIFB0MiDQkeKUgOKMoCBUaGUgY2FyIHJpZGUgaG9tZS5tcDQ=_=

=_utf-8_B_ start

i know this need
base64 to utf-8


i try

Code:
var linkName
if (link.getName() !== null) {
    //var extension = (linkName.match(/\.([^.]*?)(?=\?|#|$)/) || [])[1];    
    linkName = link.getName().replace(/(\s)?\/(\s)?/g, '/');
    link.setName(linkName)

    if (linkName.match("%")) {
        link.setName(decURI(linkName))
    }

    if (linkName.match(/=_utf-8_B_(.+)/)) {
        linkName = linkName.match(/=_utf-8_B_(.+)/).pop().replace('=_=', '')
        linkName = b64_to_utf8(linkName)
        link.setName(linkName)
    }
}
//link.setName(linkName + "." + extension);



function UnescapeUTF8(str) {
    return str.replace(/%(E(0%[AB]|[1-CEF]%[89AB]|D%[89])[0-9A-F]|C[2-9A-F]|D[0-9A-F])%[89AB][0-9A-F]|%[0-7][0-9A-F]/ig, function(s) {
        var c = parseInt(s.substring(1), 16);
        return String.fromCharCode(c < 128 ? c : c < 224 ? (c & 31) << 6 | parseInt(s.substring(4), 16) & 63 : ((c & 15) << 6 | parseInt(s.substring(4), 16) & 63) << 6 | parseInt(s.substring(7), 16) & 63)
    })
};

function decURI(str) {

    var charCode = "";
    if (str.match("%")) {
        try {
            charCode = GetEscapeCodeType(str);
            console.log(charCode)
            if (charCode == "UTF8") {
                str = UnescapeUTF8(str);
            } else if (charCode == "EUCJP") {
                //str = UnescapeEUCJP(str);
            } else if (charCode == "SJIS") {
                //str = UnescapeSJIS(str);
            } else if (charCode == "Unicode") {
                //str = unescape(str);
            }

            return str;

        } catch (e) {
            //throw(e);            
        }
    } else {
        return str;
    }

    //throw new Error();
}

function b64_to_utf8(str) {
    return decodeURIComponent(escape(window.atob(str)));
}

function GetEscapeCodeType(str) {
    if (/%u[0-9A-F]{4}/i.test(str)) return "Unicode";
    if (/%([0-9A-DF][0-9A-F]%[8A]0%|E0%80|[0-7][0-9A-F]|C[01])%[8A]0|%00|%[7F]F/i.test(str)) return "UTF16LE";
    if (/%E[0-9A-F]%[8A]0%[8A]0|%[CD][0-9A-F]%[8A]0/i.test(str)) return "UTF8";
    if (/%F[DE]/i.test(str)) return /%8[0-9A-D]|%9[0-9A-F]|%A0/i.test(str) ? "UTF16LE" : "EUCJP";
    if (/%1B/i.test(str)) return /%[A-D][0-9A-F]/i.test(str) ? "JIS8" : "JIS7";
    var S = str.substring(0, 6143).replace(/%[0-9A-F]{2}|[^ ]| /ig, function(s) {
            return s.length < 3 ? "40" : s.substring(1)
        }),
        c, C, i = 0,
        T;
    while (0 <= (c = parseInt(S.substring(i, i += 2), 16)) && i < 4092)
        if (128 <= c) {
            if ((C = parseInt(S.substring(i, i + 2), 16)) < 128) i += 2;
            else if (194 <= c && c < 240 && C < 192) {
                if (c < 224) {
                    T = "UTF8";
                    i += 2;
                    continue
                }
                if (2 == parseInt(S.charAt(i + 2), 16) >> 2) {
                    T = "UTF8";
                    i += 4;
                    continue
                }
            }
            if (142 == c && 161 <= C && C < 224) {
                if (!T) T = "EUCJP";
                if ("EUCJP" == T) continue
            }
            if (c < 161) return "SJIS";
            if (c < 224 && !T)
                if ((164 == c && C < 244 || 165 == c && C < 247) && 161 <= C) i += 2;
                else T = 224 <= C ? "EUCJP" : "SJIS";
            else T = "EUCJP"
        }
    return T ? T : "EUCJP"
};
trigger : a new link has been added

is correct??


#2

some file start download change encoding filename

linkgrabber filename 사랑합니다.rar

download start change %EC%82%AC%EB%9E%91%ED%95%A9%EB%8B%88%EB%8B%A4.rar



#3

some archive extra filename is %EC%82%AC%EB%9E%91%ED%95%A9%EB%8B%88%EB%8B%A4

(korean japanese chinese)

how to decoding?

Last edited by dandyclubs; 23.03.2022 at 08:30.
Reply With Quote
  #2132  
Old 23.03.2022, 11:33
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,084
Default

@dandyclubs: can you please provide example links to support@jdownloader.org
this can easily be fixed in the plugins themselves. No need for custom workaround
#1 can easily be fixed in the plugin and #2 and #3 is a sign that the hoster does not correct signal encoding and plugin does not apply auto correct/guess
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2133  
Old 23.03.2022, 14:52
dandyclubs dandyclubs is offline
DSL User
 
Join Date: Apr 2013
Posts: 36
Default #3 sevenzipjbinding extration

sevenzipjbinding

some zip file extration finished

filename wrong encoding

mac => korean window system...

so use

bandizip Code-page change

Last edited by dandyclubs; 23.03.2022 at 14:59.
Reply With Quote
  #2134  
Old 23.03.2022, 17:43
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,084
Default

@dandyclubs: I've replied to filename, yes, zip and unicode can cause issues because of local code page and zip may not be properly utf-8 filenames
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2135  
Old 23.03.2022, 17:44
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,084
Default

Quote:
Originally Posted by dandyclubs View Post
bandizip Code-page change
Tool that fixed names in zips?
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2136  
Old 25.03.2022, 12:38
thehulk14 thehulk14 is offline
Junior Loader
 
Join Date: May 2019
Posts: 13
Exclamation Add an script/option to bind IP address per selected downloads in the list

Hello everyone,

Is it possible to create script to add an option/button in context menu to bind IP address per selected downloads?

When using 2 networks, I want to set some selected folders in the "Downloads tab" to specific IP address ( ex. 190.186.1.1 )
So these selected folders will always use the specified IP address above ( without being limited to the host/site name )

This script/option for me is essential, for easy changing/binding between IP address, but nfortuantly I don't know how to do it :(

Any help will be appreciated
Reply With Quote
  #2137  
Old 25.03.2022, 12:54
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,084
Default

@thehulk14:
that is currently not possible/supported.
are the downloads from different hosts? if yes, then you can already achieve this via black/white-listing in Settings->Connections.
Only if the downloads are from same host, it's not possible yet.
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2138  
Old 25.03.2022, 21:10
thehulk14 thehulk14 is offline
Junior Loader
 
Join Date: May 2019
Posts: 13
Default

Quote:
Originally Posted by Jiaz View Post
@thehulk14:
that is currently not possible/supported.
are the downloads from different hosts? if yes, then you can already achieve this via black/white-listing in Settings->Connections.
Only if the downloads are from same host, it's not possible yet.
Thanks for your reply.
Unfortunately it's the same host, I hope it will be supported in the upcoming updates.
Reply With Quote
  #2139  
Old 28.03.2022, 12:29
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,084
Default

@thehulk14: when it's from same host, does it matter to be a specific IP or do you want to use 2 IPs in order to download two files at the same time? it's already possible to spread downloads from same host over multiple different connections
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2140  
Old 09.04.2022, 06:21
thehulk14 thehulk14 is offline
Junior Loader
 
Join Date: May 2019
Posts: 13
Default

Quote:
Originally Posted by Jiaz View Post
@thehulk14: when it's from same host, does it matter to be a specific IP or do you want to use 2 IPs in order to download two files at the same time? it's already possible to spread downloads from same host over multiple different connections
Sorry for very late reply, I wasn't around and just found your reply.
It actually does matter, since when using 2 IPs with 2 simultaneous connections ( example 1st IP 190.186.1.1, 2nd 190.186.1.2 )
and one of the file is finished (190.186.1.1), the next download will use the 2nd IP (190.186.1.2) instead of (190.186.1.1)
Which will waste the downloading time..

Edit: updated the example IPs.

Last edited by thehulk14; 09.04.2022 at 06:24. Reason: updated the example IPs.
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 12:35.
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 - 2023, Jelsoft Enterprises Ltd.