#1341
|
||||
|
||||
![]()
@mgpai
Seems like this may have been a misunderstanding with user _comus_: https://board.jdownloader.org/showthread.php?t=21012 -psp-
__________________
JD Supporter, Plugin Dev. & Community Manager Erste Schritte & Tutorials || JDownloader 2 Setup Download ----------------------------------- On Vacation / Im Urlaub Start: 2023-12-09 End: TBA |
#1342
|
|||
|
|||
![]()
I have lost my history and I want to recover it or one since I installed the jdonloader, it is indifferent to me, I just need, everything that has passed through the downloads tab
|
#1343
|
|||
|
|||
![]()
Is there a way to get this information
Spoiler:
![]() getStatus() only show Finished. |
#1344
|
||||
|
||||
![]()
@_cosmus_: There is no such history. What exactly do you mean? Maybe I don't understand correct
@askin2u: At that moment that information is not available. What exactly do you want to achieve? Have in mind?
__________________
JD-Dev & Server-Admin |
#1345
|
|||
|
|||
![]() Quote:
For a more accurate quota management, you may need to use a 3rd party program. Code:
// Stop downloads when target reached // Trigger: Interval (Recommended 60000 or more) if (isDownloadControllerRunning()) { var target = 20; // <- Set limit (in GB) var actual = 0; var t1 = new Date().setHours(0, 0, 0, 0); getAllDownloadLinks().filter(function(link) { var t2 = new Date(link.getFinishedDate()); return t2 > t1 }).forEach(function(link) { actual += link.getBytesLoaded(); }) if (actual / 1e9 > target) stopDownloads(); } |
#1346
|
|||
|
|||
![]() Quote:
Can I set this limit for the current download session with no regards to previous downloads and not for specific time period? Last edited by sherif011; 01.05.2020 at 02:20. |
#1347
|
|||
|
|||
![]() Quote:
just a little mod ![]() Code:
// Open selected files or files in packagename if (name == "VLC Player") { //if (name == "VLC Player - Add To Playlist") { newVlcIntance = true; //1-open new intance of vlc player | 0-add to existing intance of vlc player playSelectedFilesNow = true; //1-overwrite existence vlc player and start playing selected files | 0-add selected files to playlist var player = "C:/Program Files (x86)/VideoLAN/VLC/vlc.exe"; // <- Set path to media player var regex = /\.(part|mp4|mov|mkv|mpg|avi|flv|m4a|m4b|m4c|m4d|mp3|acc)$/ig; //only open file with these extensions dlSelection.getLinks().sort().filter(function(link) { return link.getBytesLoaded(); }).forEach(function(link) { var file = link.getDownloadPath(); var fileExt = link.getName().match(regex); var isExist = getPath(file).exists(); if (fileExt && isExist) { file = link.isFinished() ? file : file + fileExt; //!!!this might no longer be required if (!playSelectedFilesNow ) { callAsync(null, player, "--one-instance", "--playlist-enqueue", file); //add selected files to existance of vlc playlist //callAsync(null, player, "--started-from-file", "--playlist-enqueue", file); //add selected files to existance of vlc playlist } else { callAsync(null, player, "--one-instance", "--no-playlist-enqueue", file); //add and start selected files //callAsync(null, player, "--started-from-file", "--no-playlist-enqueue", file); //add and start selected files playSelectedFilesNow = false; } sleep(10); //ensure each file is added to playlist in its intended order (increase if required) //**External links are only visible to Support Staff** //??? can't figure out how to start a new instance of vlc then add the remaining selected files to playlist' //callAsync(null, player, "--no-started-from-file", "-playlist-enqueue", file); //WARNING: start each intance of vlc player for each selected file //callAsync(null, player, "--no-one-instance", "-playlist-enqueue", file); //WARNING: start each intance of vlc player for each selected file } }) } |
#1348
|
|||
|
|||
![]()
I'm currently trying to write a script that simply executes the following:
vlc --playlist-enqueue --fullscreen --one-instance --qt-continue=2 <filepath> so far I have this on a trigger of Package finished: var player = "vlc"; var file = getPath(link.getDownloadPath()); callAsync(null, player, file); this works, but doesn't pass the command line switches. how can I pass the command line switches? |
#1349
|
||||
|
||||
![]()
@markifi
believe each switch has to be wrapped between "", just how java ProcessBuilderFactory requires inputs. the javascript call is just wrapped into a Java command. there are some working examples above.
__________________
raztoki @ jDownloader reporter/developer http://svn.jdownloader.org/users/170 Don't fight the system, use it to your advantage. :] |
#1350
|
|||
|
|||
![]()
Hi all. I'm very new to this and it was recommended to me that I ask the question in this thread. I've used JD2 to download a series of music (.acc and .ogg) files from Youtube playlists so that I can load them into Traktor. The problem is that they won't load because they lack ID3 tags.
I have no real idea what I'm doing here; but might anyone be able to help with a script that could create those tags? A massive thanks for any advice here! |
#1351
|
||||
|
||||
![]()
hi mgpai
I have a question regarding THIS thread. To sum it up, this is what the user wants: - The ability to make JD NOT recognize same files (same name & size) as mirror - Maybe e.g. modify the filename of possible mirrors (e.g. add random numbers to end), maybe change it back to original once user e.g. removes all items except one from that package Any ideas? Do you maybe already have a similar script for something like this? This user wants to download mirrors at the same time so he can manually check which has the best downloadspeed --> Then download this -psp-
__________________
JD Supporter, Plugin Dev. & Community Manager Erste Schritte & Tutorials || JDownloader 2 Setup Download ----------------------------------- On Vacation / Im Urlaub Start: 2023-12-09 End: TBA |
#1352
|
|||
|
|||
![]()
I use this ES script to make sure that everything from gog-games.com gets put into commonly formatted folders based on the game name.
Code:
// Set Package Name for gog-games.com downloads // Tigger Required: "Packagizer Hook" // Forum Topic: https://board.jdownloader.org/showthread.php?t=74182 var ln = link.getName(); //get the filename from the link //alert("ln", ln); // for debugging var newln = ln.replace(/^Plugin Defect\!/, ""); //remove 'Plugin Defect!' error //alert("newln", newln); // for debugging link.setName(newln); // update the filename // these lines strip prefixes off of the filename to be used in the package name var pkg = newln.replace(/^game-/, ""); //remove prefix pkg = pkg.replace(/^extras-/, ""); //remove prefix pkg = pkg.replace(/^patch-/, ""); //remove prefix pkg = pkg.replace(/^fix-/, ""); //remove prefix pkg = pkg.replace(/^other-/, ""); //remove prefix // these lines remove file extensions pkg = pkg.replace(/.rar$/, ""); //remove file extension pkg = pkg.replace(/.zip$/, ""); //remove file extension pkg = pkg.replace(/.7zip$/, ""); //remove file extension pkg = pkg.replace(/.7z$/, ""); //remove file extension // these lines do some additional cleanup pkg = pkg.replace(/\.part(\d+)/, "") //remove part# pkg = pkg.replace(/\./g, "_"); //replace . with _ //alert("pkg", pkg); //for debugging link.setPackageName(pkg); //set the package name to the cleaned up string |
#1353
|
|||
|
|||
![]()
Hello dear JDownloader Community,
I'm looking for a solution to run a simple script on Synology after each download is completed and unzipped (ON_ARCHIVE_EXTRACTED). Code:
synoindex -R video Synchronous execution would also be an advantage. Here I found something similar I don't know how such a script for my Synology (Linux) should look like. Does anyone know advice? |
#1354
|
|||
|
|||
![]() Quote:
Quote:
Code:
var regex = /(?:^|game|extra|patch|fix|other)-(.*?)\.(?:^|.{2,4}|part\d{1,2}\..{2,4})$/ig; var pkgName = fileName.replace(regex, '$1'); var pkgName = pkgName.replace(/\./g, "_"); link.setPackageName(pkgName); |
#1355
|
|||
|
|||
![]() Quote:
Code:
// Set Package Name for gog-games.com downloads // Tigger Required: "Packagizer Hook" // Forum Topic: https://board.jdownloader.org/showthread.php?t=74182 var hoster = link.getHost(); if (state == 'BEFORE') { // only file souce download from 'gog-games.com' if (hoster == 'gog-games.com') { //<--edit download sources as desired var newFileName = link.getName(); // only file names with these extensions var fileWithExt = /\.(rar|zip|7zip|7z)$/i; if (fileWithExt.test(newFileName)) { // AND only file names begin with var fileNameBegins = /(game|extra|patch|fix|other)-/i; if (fileNameBegins.test(newFileName)) { var regex = /(?:^|game|extra|patch|fix|other)-(.*?)\.(?:^|(?:part\d{1,2}\.)?.{2,4})$/i; var pkgName = newFileName.replace(regex, '$1'); var pkgName = pkgName.replace(/\./g, "_"); link.setPackageName(pkgName); } } } } Code:
// also available if (state == 'AFTER') { } |
#1356
|
|||
|
|||
![]() Quote:
two scripts needed: 1st one Switch - allow to Reset and Restart loaded bytes session Plus set download limit 2nd one Main - monitor loaded bytes session until limit reached Code:
//1st // NOTE: A SWITCH FOR: Stop downloads when target reached // Get initial loaded bytes state and export initial bytes to txt file // functional: To Start AND/OR Reset and Restart Initial Loaded Bytes Count // also allow user to set Download Limit in GB for new session // Trigger: 3 Options: Downloadlist Contextmenu Button Pressed | Toolbar Button Pressed | Main Menu Button Pressed // ***NOTE: this will always Reset last session and Start a New Session //-------------------------------------------------------- disablePermissionChecks(); //no prompting persmision dialog //enablePermissionChecks(); //required prompting permision //-------------------------------------------------------- //setDisableOnException(true); // enable/disable script on error exceptions //setNotifyOnException(true); // true enable/false disable error notification on exceptions //-------------------------------------------------------- //setAdvancedAlert(true); beginLoadedBytesState = getPath(JD_HOME + '/tmp/_init_loaded_bytes_state.txt'); bytesTarget = getPath(JD_HOME + '/tmp/_set_download_limit_per_session.txt'); if (name == 'Start Monitor Loaded Bytes') { if (isDownloadControllerRunning()) { var loadedBytesInit = 0; if (beginLoadedBytesState.exists()) { deleteFile(beginLoadedBytesState, false); loadedBytesInit = _getCurrentLoadedBytesState(); writeFile(beginLoadedBytesState, loadedBytesInit, false); var bytesLimit = _setDownloadBytesSessionLimit() var bytesLimit = bytesLimit.replace(/^\[(.*?)\]/, '$1'); var bytesLimit = parseInt(bytesLimit.replace(/\[^0-9.]/g, '')); alert('New Session with Limit of: ' + bytesLimit + ' GB'); } else { loadedBytesInit = _getCurrentLoadedBytesState(); writeFile(beginLoadedBytesState, loadedBytesInit, false); } } } //-------------------------------------------------------- function _getCurrentLoadedBytesState() { var loadedBytesCount = 0; getAllDownloadLinks().filter(function(link) { return link.getBytesLoaded(); }).forEach(function(link) { loadedBytesCount += link.getBytesLoaded(); }) return loadedBytesCount } //-------------------------------------------------------- function _setDownloadBytesSessionLimit() { var inputBox = 'notepad.exe'; if (!bytesTarget.exists()) { writeFile(bytesTarget, "[20] <-- Enter New download limit (unit in GB) inside Square Brackets or Leave as it. ***NOTE: Will Reset/Restart New Session!", true); } callSync(inputBox, bytesTarget); return readFile(bytesTarget); } Code:
//2nd // Stop downloads when target reached // Trigger: Interval (Recommended 60000 or more) //-------------------------------------------------------- disablePermissionChecks(); //no prompting persmision dialog //enablePermissionChecks(); //required prompting permision //-------------------------------------------------------- //setDisableOnException(true); // enable/disable script on error exceptions //setNotifyOnException(true); // true enable/false disable error notification on exceptions //-------------------------------------------------------- //setAdvancedAlert(true); beginLoadedBytesState = getPath(JD_HOME + '/tmp/_init_loaded_bytes_state.txt'); bytesTarget = getPath(JD_HOME + '/tmp/_set_download_limit_per_session.txt'); if (isDownloadControllerRunning()) { // get if (beginLoadedBytesState.exists()) { var target = _getTargetBytes(); var loadedBytesInit = readFile(beginLoadedBytesState); var loadedBytesCurr = _getCurrentLoadedBytesState(); // condition if ((loadedBytesCurr - parseInt(loadedBytesInit)) / 1e9 > target) { deleteFile(beginLoadedBytesState, false); stopDownloads(); } // debug - make sure to set interval to at least 10secs otherwise you are not going to like this alert //var loadedBytes = ((loadedBytesCurr - parseInt(loadedBytesInit)) / 1e9); //alert('init:\t' + loadedBytesInit + '\ncurr:\t' + loadedBytesCurr + '\n\r' + 'progress:\t' + loadedBytes + ' GB\ntarget:\t' + target + ' GB'); } else { //Need to run 1st script to set beginLoadedBytesState & bytesTarget //otherwise this script does not execute anything on first run or after target met } } //-------------------------------------------------------- function _getTargetBytes() { if (bytesTarget.exists()) { var target = readFile(bytesTarget); // <- get limit set by user (in GB) var target = target.replace(/^\[(.*?)\]/, '$1'); var target = parseInt(target.replace(/[^0-9.]/g, '')); } else { var target = 20; // <- Set limit (in GB) note: user input will overwrite } return target } //-------------------------------------------------------- function _getCurrentLoadedBytesState() { var loadedBytesCount = 0; getAllDownloadLinks().filter(function(link) { return link.getBytesLoaded(); }).forEach(function(link) { loadedBytesCount += link.getBytesLoaded(); }) return loadedBytesCount } Last edited by zreenmkr; 11.05.2020 at 05:48. Reason: avoid unlimited sessions |
#1357
|
|||
|
|||
![]()
It is possible to set session based limit instead of daily limit. But I could not quite understand what you meant by "with no regards to previous downloads".
|
#1358
|
|||
|
|||
![]() Quote:
Most likely, the player (or the version of the player) you are using does not have the necessary codecs to play the files. Check the manual or the support forums of that player to verify if it in facts supports these formats. Some players will require you to install additional codecs to play files which are not supported by default. Another option would be transcode the files to a format supported by your player, but I would strongly advice against it since transcoding files from one lossy format to another will result in loss of quality. |
#1359
|
|||
|
|||
![]()
Hello @psp: Sorry for late reply.
![]() Code:
// Add prefix to filename // Tirgger: A Download Started link.getPackage().getDownloadLinks().forEach(function(link, index) { if (link.status == "Mirror http links is loading") { var prefix = "[" + link.getDownloadHost() + "] "; link.setName(prefix + link.getName()); link.setSkipped(true); sleep(1000); link.setSkipped(false); } }) Quote:
Code:
// Remove prefix from filename // Trigger: A Download Stopped if (link.isFinished()) { var prefix = "[" + link.getDownloadHost() + "] "; var file = link.getDownloadPath().replace(prefix, ""); if (!getPath(file).exists()) { var n1 = link.getName(); var n2 = n1.replace(prefix, ""); if (n1 != n2) link.setName(n2); } } |
#1360
|
|||
|
|||
![]() Quote:
Code:
[{ "eventTrigger": "ON_ARCHIVE_EXTRACTED", "enabled": true, "name": "2020.05.12 ", "script": "disablePermissionChecks();\ncallSync(\"synoindex\", \"-R\", \"video\");", "eventTriggerSettings": { "isSynchronous": true }, "id": 1589276857812 }] |
![]() |
Thread Tools | |
Display Modes | |
|
|