JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #681  
Old 08.04.2019, 21:06
sherif011 sherif011 is offline
Super Loader
 
Join Date: Jul 2018
Posts: 29
Default

Hi,
Jdownloader sometimes gets interrupted and downloads automatically stop
Is there a script to start downloading if it gets stopped?
Reply With Quote
  #682  
Old 09.04.2019, 03:13
heydoh heydoh is offline
Bandwidth Beast
 
Join Date: Dec 2016
Posts: 134
Default

Hello @mgpai scriptmaster, I was referred to you in this thread - https://board.jdownloader.org/showth...367#post439367

I'm hoping you can help with this one.

Basically I'm looking to auto-rename .rars from this site as well as the single .mp4 inside the rar after unpacked (there is always just one .mp4 file in the rars).

Also, sometimes if it's small enough the download will just be a .mp4 and no rar.

I'm looking to auto-rename in both cases when entered into linkgrabber (and for first one the extracted .mp4 as well).

pastebin.com/DuBjEQYD


.mp4 inside is named exactly as the rar package
HTML Code:
www.0xxx.ws_ATKGirlfriends.19.04.08.Kenzie.Reeves.XXX.2160p.MP4-KTR.mp4
First I would like when these enter the linkgrabber for "www.0xxx.ws_" to be stripped from the front and ".MP4-KTR" to be stripped from the back. Then after these are removed I will sometimes add something to the front of the file name myself for example:
HTML Code:
HELLO123-ATKGirlfriends.19.04.08.Kenzie.Reeves.XXX.2160p.part1.rar
I would like the extract to put the single .mp4 in the same directory (not subdirectory) of the .rars and be renamed to EXACTLY how the .rar is named.

So would be renamed to:
HTML Code:
HELLO123-ATKGirlfriends.19.04.08.Kenzie.Reeves.XXX.2160p.mp4
----

If the download is small and just a .mp4 (not rard) , then I would just need linkgrabbed to remove "www.0xxx.ws_" from the front of the name and ".MP4-KTR" from the end (might be able to do this without a script but I can't figure out how to do the end part.

-----

Sorry for the long wall of text and please let me know if you have any questions. Thanks in advance!

Last edited by Jiaz; 09.04.2019 at 09:59. Reason: Please don't make links visible! Either PM them or send by mail
Reply With Quote
  #683  
Old 09.04.2019, 10:37
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,591
Default

Quote:
Originally Posted by sherif011 View Post
Is there a script to start downloading if it gets stopped?
While possible, may not be practical. It will result in a infinite start/stop loop. The script also cannot distinguish between automatic and manual stop. You will hence not be able to stop the downloads manually when the script is active.

The downloads would have usually been stopped for good reason. It is better to find/fix the underlying issue which is causing the downloads to abort/stop. If you provide a log for when this happens, Jiaz might be able to look into it.

If you still wish to use a script, just let me know.
Reply With Quote
  #684  
Old 09.04.2019, 10:47
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,031
Default

@sherif011: please create a log, see https://support.jdownloader.org/Know...d-session-logs and open new thread and post the logID there
there must be a reason why downloads simply stop
__________________
JD-Dev & Server-Admin
Reply With Quote
  #685  
Old 09.04.2019, 10:54
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,591
Default

Quote:
Originally Posted by heydoh View Post
I'm looking to auto-rename .rars ... as well as the single .mp4 inside the rar after unpacked
Using packagzer it is possible to:
  • Rename files (... then set Filename)
  • Move extracted files (... then do Move to)
  • Rename extracted files (... then do Rename)
You can contact me in JD Chat if you need help with creating the rules.
Reply With Quote
  #686  
Old 09.04.2019, 18:15
heydoh heydoh is offline
Bandwidth Beast
 
Join Date: Dec 2016
Posts: 134
Default

Quote:
Originally Posted by mgpai View Post
Using packagzer it is possible to:
  • Rename files (... then set Filename)
  • Move extracted files (... then do Move to)
  • Rename extracted files (... then do Rename)
You can contact me in JD Chat if you need help with creating the rules.
OK will send you a ping. Tried messing around in packagizer and wasn't able to figure this out. Thanks
Reply With Quote
  #687  
Old 09.04.2019, 21:00
sherif011 sherif011 is offline
Super Loader
 
Join Date: Jul 2018
Posts: 29
Default

Thanks @mgpai and @Jiaz
I had slow downloads and found another script running that restarts downloading when it becomes slow, so I had interrupted downloading.
Thanks for your help.
Reply With Quote
  #688  
Old 10.04.2019, 09:44
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,031
Default

@sherif011: Thanks for the feedback!
__________________
JD-Dev & Server-Admin
Reply With Quote
  #689  
Old 13.04.2019, 09:57
qayaq qayaq is offline
Super Loader
 
Join Date: Mar 2019
Posts: 29
Default

Quote:
Originally Posted by mgpai View Post
Code:
// Disable (instagram) links if file exists on disk
// Trigger: Remote API Event Fired

if (event.id == "ADD_PACKAGE") {
    var data = JSON.parse(event.data);
    var package = getDownloadPackageByUUID(data.uuid);
    package.getDownloadLinks().forEach(function(link) {
        if (link.getHost() != "instagram.com") return;
        if (!getPath(link.getDownloadPath()).exists()) return;
        link.setEnabled(false);
    })
}
Unfortunately JD freezes at 100% CPU forever with this script, if there are many packages (about 3000) /downloads... Do you have any ideas, what's wrong?
Reply With Quote
  #690  
Old 13.04.2019, 11:32
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,591
Default

Quote:
Originally Posted by qayaq View Post
Unfortunately JD freezes at 100% CPU forever with this script, if there are many packages (about 3000) /downloads...
Can happen with that many links with that particular trigger. I do not have as many links in my list to test any script with alternative triggers /settings.

You can use this script to create a custom toolbar button which can be clicked to detect/disable dupes.

Code:
// Disable (instagram) links if file exists on disk
// Trigger: Toolbar Buttton Pressed
// Customaize Main Toolbar > Add a new "Eventscripter Trigger" button > Rename it to "Disable Dupes" (without quotes/case-sensitive)

if (name == "Disable Dupes") {
    getAllDownloadLinks().forEach(function(link) {
        if (!link.enabled) return;
        if (link.host != "instagram.com") return;
        if (!getPath(link.downloadPath).exists()) return;
        link.setEnabled(false);
    });
}

Code:
// Disable (instagram) links if file exists on disk
// Trigger: Toolbar Buttton Pressed
// Customaize Main Toolbar > Add New "Eventscripter Trigger" button > Rename it to "Disable Dupes" (without quotes/case-sensitive)

if (name == "Disable Dupes") {
    getAllFilePackages().forEach(function(package) {
        if (package.isFinished()) return;
        package.getDownloadLinks().forEach(function(link) {
            if (link.isFinished()) return;
            if (!link.enabled) return;
            if (link.host != "instagram.com") return;
            if (!getPath(link.downloadPath).exists()) return;
            link.setEnabled(false);
        });
    });
}

Last edited by mgpai; 15.04.2019 at 12:03. Reason: Script re-written
Reply With Quote
  #691  
Old 15.04.2019, 10:54
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,031
Default

@mgpai: thanks for nice solution. you could also check for status. for example finished status and skip those
or instead of getAllDownloads (which will create huge array), better use getAllPackages and then iterate through all of them via package.getDownloadLinks. much less memory usage then
__________________
JD-Dev & Server-Admin
Reply With Quote
  #692  
Old 15.04.2019, 11:27
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,591
Default

Quote:
Originally Posted by Jiaz View Post
... instead of getAllDownloads ... use getAllPackages
Script re-written
Reply With Quote
  #693  
Old 15.04.2019, 11:46
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,031
Default

maybe also easy bypass ti check package.enabled to skip complete disabled packages
__________________
JD-Dev & Server-Admin
Reply With Quote
  #694  
Old 15.04.2019, 12:04
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,591
Default

Quote:
Originally Posted by Jiaz View Post
maybe also easy bypass ti check package.enabled to skip complete disabled packages
I have added package finished check. Couldn't find package enabled method.
Reply With Quote
  #695  
Old 15.04.2019, 12:11
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,031
Default

You're right, that method is not availabel in filepackage because it's meant to be checked on download links
__________________
JD-Dev & Server-Admin
Reply With Quote
  #696  
Old 16.04.2019, 12:17
leanhdung leanhdung is offline
Registered / Inactive
 
Join Date: Aug 2017
Location: Vietnam
Posts: 48
Default

Quote:
Originally Posted by mgpai View Post
Code:
// Move finished non-archive files, to user defined folder
// Trigger required: "A Download Stopped"

var destFolder = "c:/myFolder/movedFiles"; // <- Set destination folder.

if (link.isFinished() && !link.getArchive()) {
    getPath(link.getDownloadPath()).moveTo(destFolder);
}
Dear @mgpai

My download link is
Code:
url#name=abc#pack=Pack 1
After each download is complete, I would like to move each file to the destination C:/Pack 1 where Pack 1 is extracted from the download link by the prefix
Code:
#pack=
.

Could you please modify your original script to satisfy my purpose?

Thank you so much!
Reply With Quote
  #697  
Old 16.04.2019, 12:44
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,591
Default

Quote:
Originally Posted by leanhdung View Post
... After each download is complete, I would like to move each file ...
Any reason you need to move the file? It should be possible to parse/set the download folder from your url (via packagizer/script) and download the file directly into it, instead of moving it later.
Reply With Quote
  #698  
Old 16.04.2019, 12:48
leanhdung leanhdung is offline
Registered / Inactive
 
Join Date: Aug 2017
Location: Vietnam
Posts: 48
Default

Quote:
Originally Posted by mgpai View Post
Any reason you need to move the file? It should be possible to parse/set the download folder from your url (via packagizer/script) and download the file directly into it, instead of moving it later.
I have synced the folder Pack to my Google Drive

I want to sync only the downloaded files.

Actually, I want to move the downloaded file to the folder named after the Package for which that file belongs.

I tried this one but to no avail.

Code:
if (link.isFinished() && !link.getArchive()) {
    var myFilePackage = package;
    getPath(link.getDownloadPath()).moveTo("C:/" & myFilePackage);
}

Last edited by leanhdung; 16.04.2019 at 12:53.
Reply With Quote
  #699  
Old 16.04.2019, 12:54
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,591
Default

Quote:
Originally Posted by leanhdung View Post
... I tried this one but to no avail ...
Try replacing:
Code:
getPath(link.getDownloadPath()).moveTo("C:/" & myFilePackage);
with:
Code:
getPath(link.getDownloadPath()).moveTo("C:/" + myFilePackage);

If it still does not work, find me in JD Chat. Also note, this will only move non-archive files.
Reply With Quote
  #700  
Old 16.04.2019, 12:59
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,591
Default

@leanhdung, you will also need to get the package name.

Replace:
Code:
var myFilePackage = package;
With:
Code:
var myFilePackage = link.getPackage().getName();
Reply With Quote
  #701  
Old 16.04.2019, 13:09
leanhdung leanhdung is offline
Registered / Inactive
 
Join Date: Aug 2017
Location: Vietnam
Posts: 48
Default

Quote:
Originally Posted by mgpai View Post
@leanhdung, you will also need to get the package name.

Replace:
Code:
var myFilePackage = package;
With:
Code:
var myFilePackage = link.getPackage().getName();
I have tried your code

Code:
if (link.isFinished()) {
    var myFilePackage = link.getPackage().getName();
    getPath(link.getDownloadPath()).moveTo("D:/" + myFilePackage);
}
with the link

Code:
**External links are only visible to Support Staff**
Although there is no error message, the folder D:\Pack 1 is still empty
Reply With Quote
  #702  
Old 16.04.2019, 14:32
leanhdung leanhdung is offline
Registered / Inactive
 
Join Date: Aug 2017
Location: Vietnam
Posts: 48
Default

Thank you so much for your dedicated help @mgpai
Reply With Quote
  #703  
Old 17.04.2019, 04:11
leanhdung leanhdung is offline
Registered / Inactive
 
Join Date: Aug 2017
Location: Vietnam
Posts: 48
Default

Hi @mgpai

My Package 1 contains 20.000 links and it takes JDownloader very long to search for next possible download in list.

In my case, after the download is complete, it takes Jdownloader up to 1 minute to search for the next download.

I would like to ask if there is any way to speed up the process.

Thank you so much
Reply With Quote
  #704  
Old 17.04.2019, 10:14
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,031
Default

@leanhdung: this has nothing to do with Eventscripter (Offtopic) and I will answer in your other thread
__________________
JD-Dev & Server-Admin
Reply With Quote
  #705  
Old 20.04.2019, 09:22
heydoh heydoh is offline
Bandwidth Beast
 
Join Date: Dec 2016
Posts: 134
Default

Quote:
Originally Posted by mgpai View Post
Using packagzer it is possible to:
  • Rename files (... then set Filename)
  • Move extracted files (... then do Move to)
  • Rename extracted files (... then do Rename)
You can contact me in JD Chat if you need help with creating the rules.
Hi @mgpai. Can you let me know when you will be available to discuss this? And when you say jdchat do you mean JD IRC?
Reply With Quote
  #706  
Old 20.04.2019, 10:20
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,591
Default

Quote:
Originally Posted by heydoh View Post
Can you let me know when you will be available to discuss this? And when you say jdchat do you mean JD IRC?
Yes, IRC channel on freenode. You can install/enable and use the built-in JD Chat extension or use webchat:

Code:
webchat.freenode.net/?channels=jdownloader

I'll be available there for the next 8 hours or so, from the time of this post.
Reply With Quote
  #707  
Old 21.04.2019, 02:39
heydoh heydoh is offline
Bandwidth Beast
 
Join Date: Dec 2016
Posts: 134
Default

Thanks for your help today mgpai!
Reply With Quote
  #708  
Old 11.05.2019, 22:00
heyfernand heyfernand is offline
Registered / Inactive
 
Join Date: Aug 2017
Posts: 22
Default

I have 5 playlists from youtube I wish J2downloader kept downloading everyday because each day there's new videos being added to them. one of them is this one =
Code:
youtube.com/playlist?list=LLFbstz7sG9dQz4wM-KLJvSQ
I talked to Jiaz and he told me to ask help from the master @mgpai and so here I am. I even bring and offering =
Code:
pastebin.com/S5PwPGWB
I have no experience with codding and that's why I need help or at least some guidelines to create this script, maybe copy one that already exists.

Thanks!

Last edited by heyfernand; 11.05.2019 at 22:04.
Reply With Quote
  #709  
Old 13.05.2019, 00:48
Tarantino
Guest
 
Posts: n/a
Default Script Nedded

Hi there,

I was today searching all over the internet for a script for this and nothing. Then since I use JD a lot I saw the events scripts function and maybe this could be the solution. I read all the 36 pages and nothing about this.

I want to download only X Mb from all files I've in my JD. Since it reaches the x MB let say 50MB it would move to the next files, till finish all the JD filelist.

Is it possible?

Thanks!
Reply With Quote
  #710  
Old 13.05.2019, 12:56
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,031
Default

@Tarantino: such a script doesn't exist to my knowledge. Try to ask mgpai for help. He would have to write a script that aborts/stops a download when certain amount of data got downloaded
__________________
JD-Dev & Server-Admin
Reply With Quote
  #711  
Old 13.05.2019, 14:14
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,591
Default

Quote:
Originally Posted by heyfernand View Post
I have 5 playlists from youtube I wish J2downloader kept downloading everyday because each day there's new videos being added to them ...
Code:
gist.github.com/mgpai/09252b6b72828c290fd141da81be14a1/download
Reply With Quote
  #712  
Old 13.05.2019, 14:18
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,591
Default

Quote:
Originally Posted by Jiaz View Post
@Tarantino: such a script doesn't exist to my knowledge. Try to ask mgpai for help. He would have to write a script that aborts/stops a download when certain amount of data got downloaded
@Jiaz: You have declined a similar request in past, stating such a script can also be abused, by downloading only partial content from OCH, in order to increase download count of a file. I cannot seem to find that thread though.
Reply With Quote
  #713  
Old 13.05.2019, 19:18
sherbee sherbee is offline
Registered / Inactive
 
Join Date: Mar 2019
Posts: 76
Default

Quote:
Originally Posted by mgpai View Post
Code:
// Move archive files after extraction
// Trigger: Archive Extraction Finished

var links = archive.getDownloadLinks() || [];

links.forEach(function(link) {
    var filePath = getPath(link.getDownloadPath());
    filePath.moveTo(filePath.getParent().toString().replace("JD Downloads", "!TRASH!"));
});
Idea how to handle rename if file name already exists? Is there trigger or event to use? And what renaming plan would be best? Becaus if name exists script does not move.
Reply With Quote
  #714  
Old 13.05.2019, 20:01
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,591
Default

Quote:
Originally Posted by sherbee View Post
Idea how to handle rename if file name already exists? Is there trigger or event to use? And what renaming plan would be best? Becaus if name exists script does not move.
One option would be to move the files to a timestamp based sub-folder.

Code:
// Move archive files after extraction
// Trigger: Archive Extraction Finished

var links = archive.getDownloadLinks() || [];
var timestamp = new Date().getTime();

links.forEach(function(link) {
    var filePath = getPath(link.getDownloadPath());
    filePath.moveTo(filePath.getParent().toString().replace("JD Downloads", "!TRASH!/" + timestamp));
});
Reply With Quote
  #715  
Old 14.05.2019, 02:11
Tarantino
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by mgpai View Post
@Jiaz: You have declined a similar request in past, stating such a script can also be abused, by downloading only partial content from OCH, in order to increase download count of a file. I cannot seem to find that thread though.
I don't know nothing about that matter. But I want to download all the content, but it can't be all the content once, it needs to be part by part, and then continue. Could you please help? @mgpai? Do he have your blessing @Jiaz?

Thank you.
Reply With Quote
  #716  
Old 14.05.2019, 03:28
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,591
Default

Quote:
Originally Posted by Tarantino View Post
I want to download all the content, but it can't be all the content once, it needs to be part by part, and then continue.
If you "want to download all the content", any particular reason you have to download it this way? If the hoster is imposing some kind of download/time limit, you can provide some example links and Jiaz might be able to check/fix it at plugin level.
Reply With Quote
  #717  
Old 14.05.2019, 07:05
sherbee sherbee is offline
Registered / Inactive
 
Join Date: Mar 2019
Posts: 76
Default

Quote:
Originally Posted by mgpai View Post
One option would be to move the files to a timestamp based sub-folder.

Code:
// Move archive files after extraction
// Trigger: Archive Extraction Finished

var links = archive.getDownloadLinks() || [];
var timestamp = new Date().getTime();

links.forEach(function(link) {
    var filePath = getPath(link.getDownloadPath());
    filePath.moveTo(filePath.getParent().toString().replace("JD Downloads", "!TRASH!/" + timestamp));
});
Thank you for idea. But I like complicated. So new folder not good.

I made very silly code but maybe its work? Can you help me? I put many comments so you can understand easy what I think.

Code:
const MOVETODIR = "C:\\sherbee\\check"; //Set dir for move destination

var links = archive.getDownloadLinks() || []; 

links.forEach(function(link) {
       var filePath = getPath(link.getDownloadPath());
       var fileName = myFilePath.getName(); //Get name of file
       var fileExtension = myFilePath.getExtension(); //Get extension of file
       var fileMoveCheck = MOVETODIR + '\\' + fileName + "." + fileExtension; //Build absolute path to move destination dir
    if (!fileMoveCheck.exists()) {	//Check if file exists in move destination dir
        filePath.moveTo(MOVETODIR); //If not exist then move
    } else { //If exist must make new name and try again
        var i = 0; //Counter for renaming
        do {
            i += 1;
            fileMoveCheck = MOVETODIR + '\\' + fileName + " (" + i + ")" + "." + fileExtension; // Make new name look like: C:\\sherbee\\check\\123 (1).zip like Windows.
        } while (fileMoveCheck.exists());
		if (filePath.renameTo(fileMoveCheck)) { //Come here when file not exists and rename file
		filePath.moveTo(MOVETODIR); //After rename move
    } else {
	//do nothing or abort maybe
	}
});
I say silly because I don't know if I make paths correctly and what else is wrong.

Last edited by sherbee; 14.05.2019 at 07:12.
Reply With Quote
  #718  
Old 14.05.2019, 10:13
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,031
Default

Quote:
Originally Posted by mgpai View Post
@Jiaz: You have declined a similar request in past, stating such a script can also be abused, by downloading only partial content from OCH, in order to increase download count of a file. I cannot seem to find that thread though.
Of course you are free to help with such a script. My comment was only that we(JDownloader) doesn't integrate such a feature. As a custom script for Eventscripter, I don't see a problem as we can't forbid/prevent such a script..here or anywhere else
__________________
JD-Dev & Server-Admin
Reply With Quote
  #719  
Old 14.05.2019, 10:15
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,031
Default

@sherbee: yes, the loop should work, rename file, check exists and break loop once file doesn't exist.
__________________
JD-Dev & Server-Admin
Reply With Quote
  #720  
Old 14.05.2019, 11:46
Tarantino
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by mgpai View Post
If you "want to download all the content", any particular reason you have to download it this way? If the hoster is imposing some kind of download/time limit, you can provide some example links and Jiaz might be able to check/fix it at plugin level.
I've currently a premium account on one host that I'll stop using, the prices and tos changed and therefor I'm downloading all my content, but my connection speed isn't enough for downloading all the content till my premium ends, and I don't have $ to extend the new premium to keep my files. So when my premium ends my files will be deleted, unless they're being used. So if I download part by part and repeat, I will be able to download all the content before they got deleted.

Best regards
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:34.
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.