#1221
|
|||
|
|||
![]()
At the Moment there are no available updates. If all is working i dont see New updates. Is there any way to check whether restart worked? In a log file or simply by writing a text file the home dir?
|
#1222
|
|||
|
|||
![]() Quote:
Code:
log("JD was restarted by a script to apply updates"); |
#1223
|
|||
|
|||
![]() Quote:
What is the nature of those commands? If it is something which can be run from a script, you can use one with a "A Download Started" trigger. |
#1224
|
|||
|
|||
![]()
Hello there!
PSP referred me here. I am looking for a script, which would open finished *AND* unfinished files in the download-list via Double-Click. (The "Open Link" in the Link-Double-Click-Actions in the advanced settings only opens finished files. ... a ticket has been created already here: http://svn.jdownloader.org/issues/87766) And I am also looking for a script, which would add single files from the link-list to the download-list via Double-Click. (A ticket for that has also been created here: http://svn.jdownloader.org/issues/87757) Can this even be accomplished through a script? Best Greetings! Last edited by Sokub; 13.03.2020 at 17:05. |
#1225
|
|||
|
|||
![]() Quote:
Please note, most players lock the file while it is being played, which means if the download is finished while it is still being played, JD will not be able to rename it by removing the 'part' extension from the file, and you will end up with two files. One with 'part' extension and the other with the actual/original file extension. Note: There are players which do not lock playing files, for e.g. PotPlayer. Quote:
|
#1226
|
|||
|
|||
![]()
Thank you mgpai, for your fast reply!
Quote:
Where would I create this file association? Within my system this is already working, i.e. in my file browser these .part files are opened. But not from within JD. Can this file association be set in JD too? BTW: VLC lets JD also rename the .part file it is currently playing. |
#1227
|
|||
|
|||
![]() Quote:
There are several methods (depending on your OS) to do this. One way for e.g. is to right-click on the 'part' file, choose an application to open it with and select 'save as default' or 'always use this program to open this type of file'. Code:
BTW: VLC lets JD also rename the .part file it is currently playing. Test to make sure it allows JD to rename the file. I just checked with VLC on my Windows PC. The file was locked and JD was unable to rename it. The 'part' file also remained on disk after the download was finished. While both have worked fine in my case, it would be better to do a google search for settings specific to your OS, both in respect of double-click and player behaviour. |
#1228
|
|||
|
|||
![]() Quote:
Quote:
|
#1229
|
||||
|
||||
![]() Quote:
1) Do you need to script to save both link with name or only the link? because this script bellow which you mentioned only save all links and No names Code:
// Save Linkgrabber to txt and open Notepad (to "save" the txt with name and destinations as needed) // Trigger: Toolbar Button Pressed if (name == "Save Linkgrabber to txt") { var SaveLinkFile = getPath(JD_HOME + "/tmp/SaveLinkFile.txt"); var textEditor = "notepad.exe"; var urls = getAllCrawledLinks().map(function(link) { return link.getUrl(); }) if (SaveLinkFile.exists()) SaveLinkFile.delete();//.deleteRecursive();??? if (urls.length) writeFile(SaveLinkFile, urls.join("\r\n"), true); //if (urls.length) writeFile(myFile, urls.join("\r\n") + "\r\n", true); // ?? what they mean urls.join("\r\n") + "\r\n" callSync(textEditor, SaveLinkFile); } 2) Now, to follow that, assuming you still use the script above, do you need: -a. all 'links, file names or just links' from linkgrabber? -b. or only the specific one you had in mind? -c. or the New ones you just added a second ago? 3) when you open SaveLinkFile.txt file in notepad, what do you do to it? Are you deleting links? Are you adding names? and you save it as 'dd-mmm-yyyy TEXT.txt'? Quote:
Quote:
Quote:
|
#1230
|
|||
|
|||
![]()
@zreenmkr = ???
sorry but now I don't understand, the script I posted now worked (it does what I need). when I posted it I was still in the "development" phase (say) I had put it because I had a doubt about the "process" that I followed in the script, namely: - select the link in the tab linkgrabber - delete the old example.txt file (SaveLinkFile.txt) - write the info i want in the new txt file -open the new txt file with notepad.exe the question was << to have a notepad open with the info pasted inside do I have to write a real file? can't it be done virtually with some command to avoid deleting files? >> and mgpai answered this question Quote:
if you are interested in the current result is this: Code:
// "select link, paste them in a tx and open it" // N.B = add button (event scrip trigger) in linkgrabber contextmenu //trigger : linkgrabber contextmenu button press if (name == "Save LinkGrabber selez + open txt") { var SaveLinkFile = getPath(JD_HOME + "/tmp/SaveLinkFile.txt"); var textEditor = "notepad.exe"; var links = lgSelection.getLinks(); var urls = []; for (i = 0; i < links.length; i++) { var link = links[i]; var fileName = link.getName(); var GrabberURL = link.getContentURL(); urls.push(fileName + " , " + GrabberURL); } if (SaveLinkFile.exists()) SaveLinkFile.delete(); // delete the old file "savelinkfile.txt" if (urls.length) writeFile(SaveLinkFile, urls.join("\r\n"), true); callSync(textEditor, SaveLinkFile); //now i edit the file and "save as " it . } --> TD mouse / linkgrabber contextmenu /run script --> I see notepad (SaveLinkFile.txt) , now I , edit - add - write - delete what i want and " save as" (changing path and name every time as needed ) . Quote:
In JD there is a command: <<clear filtered links>> ( setting\user interface\linkgrabber botton bar ..... the icon is a gray funnel) I matched it with a shost cut (ctrl + del) so when I have the JD window open I activate it by pressing the two keys (ctrl + del). I had hypothesized to insert this operation (or the pressure of the 2 keys) in a script in order to execute the command. now I'm starting trying to work on the autohotkey script which should simply say "hold down ctrl + delete key to JD ". but i dont know if it work the way i think .... |
#1231
|
|||
|
|||
![]() Quote:
This is something I would do. Code:
// "select link, paste them in a tx and open it" // N.B = add button (event scrip trigger) in linkgrabber contextmenu //trigger : linkgrabber contextmenu button press //-------------------------------------------------------- disablePermissionChecks(); //no prompting persmision dialog //enablePermissionChecks(); //required prompting permision //-------------------------------------------------------- //setDisableOnException(true); // enable/disable script on error exceptions //setNotifyOnException(Boolean); // enable/disable notification on exceptions //if (name == "Save LinkGrabber selez + open txt") { textEditor = "notepad.exe"; //global var dateTime = _dateTime(); var aPath = JD_HOME + '\\tmp'; //var aPath = 'C:\\archive\\_jd_linkgrabber'; var textFileName = 'SaveLinkFile' var fileExt = ".txt" var namesAndUrls = []; //select 1 or multiple files var selections = lgSelection.getLinks(); for (i = 0; i < selections.length; i++) { var selection = selections[i]; var fileName = selection.getName(); var url = selection.getContentURL(); //nameAndUrl.push(fileName + " , " + url); namesAndUrls.push('Name: ' + fileName + "\r\n" + 'Link: ' + url + "\r\n"); } var textFile = getPath(aPath + "\\" + dateTime + " - " + textFileName + fileExt); var selectedFiles = namesAndUrls.join('\r\n', true); var userInputText = _getUserInputText(selections); var finalText = dateTime + '\r\n' + '-------------------------' + '\r\n' + selectedFiles + '\r\n' + '\r\n' + '-------------------------' + '\r\n' + 'Note: ' + userInputText; //if (textFile.exists()) { // alert('File Already Exists: \r\n' + textFile); //} else { if (selections.length) { writeFile(textFile, finalText, true); callSync(textEditor, textFile); //now i edit the file and "save as " it . } //} } //---return userinput custom text--- function _getUserInputText(selected) { if (selected.length) { var userInputText = getPath(JD_HOME + "/tmp/_userinput.txt"); if (!userInputText.exists()) { userInputText.delete(); writeFile(userInputText, "Replace this text with new custom text, save file and exit", true); //writeFile(userInputText, "", true); } callSync(textEditor, userInputText); var customText = readFile(userInputText); if (customText.length) { return customText; } else { return '---No User Input Text Available---' } } } //---retrieve current date time--- function _dateTime() { var date = new Date(); var dateTime = new Date(date.getTime() - (date.getTimezoneOffset() * 60000)).toJSON(); //yyyy-mm-ssThh:mm:ss.msZ var finalDateTime = dateTime.substr(0, 23).replace("T", "_-_").replace(/:/g, "."); return finalDateTime } Last edited by zreenmkr; 14.03.2020 at 04:55. |
#1232
|
|||
|
|||
![]() Quote:
hxxps://workupload.com/file/dd5yQzu2 pwd: bjn01 Code:
// "select link, paste them in a tx and open it" // N.B = add button (event scrip trigger) in linkgrabber contextmenu // Trigger : linkgrabber contextmenu button press //-------------------------------------------------------------------------------------------------------------- //IMPORTANT: Create sub-folder '_bin' in JD_HOME then download and copy 'notepadCmd.exe' to dir //-------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------- disablePermissionChecks(); //no prompting persmision dialog //enablePermissionChecks(); //required prompting permision //-------------------------------------------------------- if (name == "Save LinkGrabber selez + open txt") { var dateTime = _dateTime(); var exePath = JD_HOME + '\\_bin'; var exeCmd = 'notepadCmd.exe' var textEditor = getPath(exePath + "\" + exeCmd); var namesAndUrls = []; if (!textEditor.exists()) { alert("EXE FILE NOT FOUND!\r\n" + "Create subfolder '_bin' and copy '" + exeCmd + "' to:\r\n\r\n" + exePath); } else { //select 1 or multiple files var selections = lgSelection.getLinks(); for (i = 0; i < selections.length; i++) { var selection = selections[i]; var fileName = selection.getName(); var url = selection.getContentURL(); //nameAndUrl.push(fileName + " , " + url); namesAndUrls.push('Name: ' + fileName + "\r\n" + 'Link: ' + url + "\r\n"); } var selectedFiles = namesAndUrls.join('\r\n', true); var finalText = dateTime + '\r\n' + '-------------------------' + '\r\n' + selectedFiles; if (selections.length) { callSync(textEditor, '-notepad', finalText); } } } //-------------------------------------------------------- //---retrieve current date time--- function _dateTime() { var date = new Date(); var dateTime = new Date(date.getTime() - (date.getTimezoneOffset() * 60000)).toJSON(); //yyyy-mm-ssThh:mm:ss.msZ var finalDateTime = dateTime.substr(0, 23).replace("T", "_-_").replace(/:/g, "."); return finalDateTime } Quote:
autoit send Ctrl+Del hxxps://workupload.com/file/y68E8GBS pwd: bjn01 Code:
function hotkeyCtrlDel() var exePath = JD_HOME + '\\_bin'; var exeCmd = 'jdHotkey.exe' var hotkey = getPath(exePath + "\\" + exeCmd); callSync(hotkey, '-hkey'); } Last edited by zreenmkr; 14.03.2020 at 06:16. Reason: autoit file updated |
#1233
|
|||
|
|||
![]()
Can use a script till the developers provide a solution, but will need to use context menu command instead of double-click, provided the OS will allow opening the file from it. Let me know if you'd want to try it.
|
#1234
|
|||
|
|||
![]() Quote:
Does the double-click work on your Windows-System for unfinished files? Have you tried it? And yes, I would like to try the script for the context menu, if double-click won't work for me (for now). ... Right now in the context menu, the option "Open file" is greyed out for unfinished files but works fine for finished ones. |
#1235
|
|||
|
|||
![]() Quote:
|
#1236
|
|||
|
|||
![]() Quote:
Code:
// Open partially download file for the selected download link // Trigger: Downloadlist Contextmenu Button Pressed // Customize download list context menu > Add a new "Eventscripter Trigger" button > Rename it to "Open PART file" (without quotes) > Change Icon (Optional) if (name == "Open PART file") { var link = dlSelection.getContextLink(); if (link) { var player = "/videolan/vlc/vlc"; // <- Set path to media player var partFile = getPath(link.getDownloadPath() + ".part"); if (partFile.exists()) callAsync(null, player, partFile); } } |
#1237
|
|||
|
|||
![]() Quote:
a) the executable that c and in the zip mate it in a specific folder (if yes which one?) or do I put it where I want? b) in the code I guess I should indicate the path of the executable, but what does '\\_bin' mean? p.s = in theory if I click twice on the executable it should "say" to jd "the user (me) has pressed the key combination ctrl + del", therefore jd should execute the command that I have associated with that combination, right? [I click twice, the exe is executed but Jd does nothing ![]() edit : I tried to narrow the keys with autohotkei and I came up with a similar thing Code:
WinWait, JDownloader 2, IfWinNotActive, JDownloader 2, , WinActivate, JDownloader 2, Send, {CTRLDOWN}{DEL}{CTRLUP}{ENTER} return it seems to work but (and I apologize again for the trivial question) how do I tell jd to run "JD-CtlrCancEnter.ahk" ? or I have to recall in some way the executable / compiled "JD-CtlrCancEnter.exe"? Last edited by BJN01; 14.03.2020 at 13:11. |
#1238
|
|||
|
|||
![]() Quote:
Quote:
Thank you very much for the code too! It works good so far. To make it perfect for me, I would like it to open both finished and unfinished files. Can you modify the script for this case? Would you be so kind? |
#1239
|
|||
|
|||
![]() Quote:
Code:
// Open finished or partially download file for the selected download link // Trigger: Downloadlist Contextmenu Button Pressed // Customize download list context menu > Add a new "Eventscripter Trigger" button > Rename it to "[Script] Open file" (without quotes) > Change Icon (Optional) if (name == "[Script] Open file") { var link = dlSelection.getContextLink(); if (link) { var player = "/videolan/vlc/vlc"; // <- Set path to media player var file = getPath(link.getDownloadPath()); if (file.exists()) { callAsync(null, player, file); } else { var partFile = getPath(file + ".part"); if (partFile.exists()) { callAsync(null, player, partFile); } } } } |
#1240
|
|||
|
|||
![]()
Thank you very much mgpai! .... It works perfectly!
:-) ... <3 |
![]() |
Thread Tools | |
Display Modes | |
|
|