#1161
|
|||
|
|||
![]()
Possible, but you will have to also set the desired comment in the script (there will be no popup dialog where you can enter the comment).
|
#1162
|
|||
|
|||
![]()
So I each time before I would insert a comment had to open the script in the "Event scripter" and insert the text there anywhere in the script between some delimeters? Would I have to open the script manually (in the usual way) or may be with a button, shortcut in a more convenient way?
|
#1163
|
|||
|
|||
![]() Quote:
Alternatively, I can provide a script which can read the comment from an existing link and then add it to the other links selected along with that link. If you are running JD Windoes a workaround via VBS script might also be possible, but I will have to look into it. |
#1164
|
|||
|
|||
![]() Quote:
thank you ![]() it works and inserting variables into the script is simple [= I can do it! yahoo] should i flag (enable) the synchronous script execution option? @zreenmkr Thanks for your help, soon i will test your scripts better but there is one thing i would like to know: what are the "variables" ??? both if I do "test" they give me this error message :<"name" is not defined> Last edited by BJN01; 06.03.2020 at 18:12. |
#1165
|
|||
|
|||
![]() Quote:
Quote:
Quote:
|
#1166
|
|||
|
|||
![]()
hello , starting from the mgpai script I managed to make another one that changes the names of the file in the linkgrabber tab , and I activate it with <Toolbar Button Pressed>. (oddly it works.
![]() now I have 3 buttons with related scripts, for convenience I added an "alert" in 2 of these scripts . Thanks to this I realized that regardless of which push button all 3 are executed. ![]() it's normal ? is there a way to avoid it? [I tried to select / deselect the synchronous script execution option but nothing has changed] |
#1167
|
|||
|
|||
![]() Quote:
![]() |
#1168
|
|||
|
|||
![]() Quote:
Quote:
Am assuming you've created 'EventScripter Trigger' button. You need to give that each button a unique name and it is case sensitive. 1st Button Code:
if (name == "My Button1 Name") { //if button you rename from 'EventScripter Trigger' to '"My Button1 Name'. When this button is pressed then only this 1st codes in this body will be executed } Code:
if (name == "My Button2 Name") { //if button you rename from 'EventScripter Trigger' to '"My Button2 Name'. When this button is pressed then only this 2nd codes in this body will be executed } Last edited by zreenmkr; 07.03.2020 at 05:59. |
#1169
|
|||
|
|||
![]() Quote:
|
#1170
|
|||
|
|||
![]()
I'm new to this, can't code and still try figure this out.
Is it possible if you download a video (MP4, MPEG, MKV) from a website (not youtube), to automatically extract the audio part of the video container and then delete the video? Also, is it possible to write a 2nd version of that script that includes also automatic re-encoding with lower bitrate (64kbps?) to drastically shrink the filesize of the audio file? Last edited by Loadrix; 07.03.2020 at 06:28. |
#1171
|
|||
|
|||
![]() Quote:
Code:
callAPI("linkgrabberv2", "addLinks", { "links": readFile(feeds), "autostart": true, "destinationFolder": "\\myFolder\\<jd:packagename>" }); Optionally, use "LinkgrabberSettings.autoconfirmdelay" (Advanced Settings) to adjust the 'autostart delay'. |
#1172
|
|||
|
|||
![]() Quote:
Quote:
|
#1173
|
|||
|
|||
![]() Quote:
![]() |
#1174
|
|||
|
|||
![]() Quote:
Code:
// Extract Audio from Video then Convert to <custom> mp3 bitrate. // Trigger required: "A Download Stopped". // Requires ffmpeg/ffprobe. Uses JD ffmpeg/ffprobe settings if available. // Overwrites destination file (mp3) if it already exists. disablePermissionChecks(); //no prompting dialog //enablePermissionChecks(); //required prompting permision //setDisableOnException(myBoolean); // enable/disable script on exceptions //setNotifyOnException(myBoolean); // enable/disable notification on exceptions if (link.isFinished()) { var fileName = link.name.replace(/(.+)(\..+$)/, "$1"); var fileType = link.name.replace(/(.+)(\..+$)/, "$2"); var sourceFile = link.getDownloadPath(); var videoFile = /\.(mp4|mkv|mov|avi|mpg|mpeg)$/.test(sourceFile); if (videoFile) { var downloadFolder = package.getDownloadFolder(); var videoSourceFile = sourceFile; var audioDestFile = downloadFolder + "/" + fileName + ".mp3"; var ffmpeg = callAPI("config", "get", "org.jdownloader.controlling.ffmpeg.FFmpegSetup", null, "binarypath"); //var ffprobe = callAPI("config", "get", "org.jdownloader.controlling.ffmpeg.FFmpegSetup", null, "binarypathprobe"); //--------------------------------------------------------------- //---extract & convert video to audio //---ffmpeg ref cmd: hxxps://gist.github.com/protrolium/e0dbd4bb0f1a396fcb55 //---ffmpeg -i video.mp4 -f mp3 -ab 192000 -vn music.mp3 //--------------------------------------------------------------- var bitrate = 64000; //option 1 - CallSync callSync(ffmpeg, "-i", videoSourceFile, '-f', 'mp3', '-ab', bitrate, '-vn', audioDestFile); //Option 2 - callAsync //callAsync(function() {}, ffmpeg, '-i', videoSourceFile, '-f', 'mp3', '-ab', bitrate, '-vn', audioDestFile); var deleteSourceFile = false; // Set this to true to delete source file after conversion. if (deleteSourceFile && getPath(audioDestFile).exists()) deleteFile(videoSourceFile, false); } } |
#1175
|
|||
|
|||
![]() Quote:
Code:
// Read comment from file and add it to selected links // Trigger : Downloadlist Contextmenu Button Pressed // Customize download list context menu > Add new 'Eventscripter Trigger' button > Rename it to "Add comment" (without quotes) if (name == "Add comment") { var links = dlSelection.getLinks(); if (links.length) { var textEditor = "notepad.exe"; var commentFile = getPath(JD_HOME + "/tmp/commentFile.txt"); if (!commentFile.exists()) writeFile(commentFile, "Replace this text with new comment, save file and exit", true); callSync(textEditor, commentFile); var comment = readFile(commentFile); if (comment.length) { links.forEach(function(link) { link.setComment(comment); }) } } } |
#1176
|
|||
|
|||
![]() Quote:
Last edited by zreenmkr; 07.03.2020 at 10:21. |
#1177
|
|||
|
|||
![]() Quote:
Thank you very much! What do I have to do here (what does the txt file open?), mark one link or more or nonce at first? ![]() Sorry, did a very stupid mistake, got it working, missed to activate the script by checking the box. Sorry again. So the txt file has to be saved and closed after. When it closes the text is added, that is how to use it. Last edited by Dockel; 07.03.2020 at 10:13. |
#1178
|
|||
|
|||
![]() Quote:
|
#1179
|
|||
|
|||
![]() Last edited by zreenmkr; 07.03.2020 at 10:19. |
#1180
|
|||
|
|||
![]() Quote:
|
![]() |
Thread Tools | |
Display Modes | |
|
|