#941
|
|||
|
|||
![]()
If you wish to review the duplicate links before deleting them, you can enable the "Sidebar" and use the built-in "Already in downloadlist" view filter rule to select them and use the context menu commands on that selection.
|
#942
|
|||
|
|||
![]() Quote:
Though the code in the first post won't fit well with the sticky index, and the sticky idex have more advantages as code in the first post don't allow for easily finding/seeing all scripts, better having the index linking directly to the latest post with the code. Well, at least you need to make it once, then after there is almost nothing do to, if it is simple and light (and it don't need to be complex as it just append a text/link or change (update) the link url, it will be really light in term of maintenance, maybe some occasional check/change if the main forum's code change, when was the last change big enough to make such code require an update anyway ? |
#943
|
||||
|
||||
![]() Quote:
![]()
__________________
JD-Dev & Server-Admin |
#944
|
|||
|
|||
![]()
Hello
Maybe let me think this way a little bit..... Is there is an Event, if die Download is complete, I hope so... Let the JD itself delete that link from the his normal Downloadlist (where it was downloaded from)... Than add the downloaded link (coming from the event above) to a special Packagename, call "Already Downloaded" in the normal Downloadlist (putting the link back in the downloadList). If the links is again in the linkgrabber, it will be marked as double (because it is listed in the downloadList).... Is this makeable? If that works, JD can find double links the way it works now and the downloadList is cleaned up. Maybe in a next step generate this with counter and generate a list every 100 links, maybe delete links from this list if older than 1year (configurable)... Bye, Christian Last edited by Amiganer; 01.10.2019 at 21:21. Reason: New Thoughts |
#945
|
|||
|
|||
![]() Quote:
So yeah even though you would still be familiar with the syntax and how it work, it would require a bit of conversion and as you said you haven't got the time, the first high level language I learned was VB.NET which have quite a different syntax, it make Javascript, Java, PHP, C and C++ look really similar in comparison, having also touched other kind of language/script/macro software that are different from each other, I find it easy to adapt to a new language, though I have yet to start with Haskell ![]() ![]() But I also can guess how peoples who have seen languages with similar syntax only won't find it as easy to get to a new one. In short, I understand well your position. |
#946
|
|||
|
|||
![]()
Hello.
Where will I fit? A begun with BASIC V2 (C64), than Amiga, I can 68k Assembler, 6502 Assembler, Pascal (including Turbo Pascal), Fortran, Forth, Logo, Python, Java, C (example original K&R), C++, Modula II... Maybe I have some forgotten... Bye, Christian |
#947
|
|||
|
|||
![]()
Hello !
Well basically, you touched BASIC, Assembler and C like language which are 3 notable really different programming language syntax wise (I haven't learned the other yet so I can't speak for them), while the concept stay the same, C and BASIC are already different enough to give you a lot of adaptation capability when it come to learning others language regardless if they have a common syntax of one you already know or a syntax style you aren't familiar with. But knowing Assembly is by far the best, as you, literally, know how the CPU itself work and you can guess what assembly code the compiler/interpreter translate the code of X language into, it give you the best adaptation ability since the pure logic of programming is already acquired, though it don't really prepare you for Object Oriented which is vastly different and other lesser popular which are different from Procedural Programming (and OOP)... So learning Javascript will be really easy for you as the syntax is already something you are accustomed to and the difference to other languages (like how to declare variables for example) is basically still in the sphere of what you know, you will just need to learn HTML Documents which are objects, so it will be more a matter of finding and remembering them than learning them. PHP too would be quite easy to learn for you as it too keep a lot of similarities with C like languages, and if you use it as its own language, you already have everything to just learn the difference and you are clear to go. But for using it in websites it is different from other programming languages and you'll need to learn HTML (at least) and CSS, which are really simple and quick to learn, but it will probably be the most different language you touched from all the others you learned, it have interesting characteristics, such as allowing for syntax errors. While your compilator will never allow you to write "if () [}" or" if () {" and not close it, in HTML where you have to write "<p>your text here</p>" to write text, something like "<p>your text here" (where you should normally write </p> to close) will still work, even plain text without that paragram code will work, it is basically an interpreted language and the browser is the interpreter, but each browser might interpret it slightly differently... Watch the Youtube video "Where HTML beats C?" by Computerphile. You can see the relation of HTML and CSS like the relation between a .c and a .h file, HTML tell your browser what to display and CSS tell it how to display it, and PHP is made so you literally write HTML code inside it (without using any kind of strings or functions, you could have a loop directly followed by HTML code as if it was another PHP line of code) to generate your pages, using PHP logic to make the page dynamically generated, using things like : if (user_is_connected) { HTML code to show user avatar and account meny } else { HTML code to show the register and connect links } PHP use databases like MySQL to get data, basically database are console command program and you simply use console commands from your code to search/write/delete datas. And finally you have Javascript which like PHP allow to make dynamic pages, but allow to transform a page already loaded in the browser while PHP prepare it before sending it, a website where it refresh the page to show results are basically PHP where if it load new things without refreshing will basically be Javascript, though this is in theory, in reality there is a mix of both and Javascript can be used to make change as the page load, not just after, PHP is computer by servers while Javascript is computer by the client's browser and computer. So because of the way they are all depending on each others and the unique syntax of XML/HTML and its relation with CSS which also have its own syntax, it make them totally different from anything else you ever saw, but the concept is still the same at the end and with what you know it will be really easy to learn all that, once you got all that, it is quite easy to work from here. Short answer, you fit in a place where you can probably learn any new language without too much troubles, though some like Haskell and other Functional languages or other different paradigm or Brainf*ck which is a beast of its own are still different enough so you'll scratch your head at first until you get how they work, and HTML, CSS, PHP, database and Javascript are quite unique and require you to understand how they work alone and together, but it will still be easy to learn for you. Though Quantum programming might be the HUGE exception, that's literally the Elephant in the room, as not only you don't work in binary anymore, and you have to know some heavy maths to really exploit it properly, but also the way Quantum physic work is totally unintuitive. There are other exceptions, like ternary computer, Superscalar processor, VLIW, EPIC or even the DNA computing and other weird things that make the massively parallel computing of Super Computer actually "normal" and almost identical to regular computer in term of programming. |
#948
|
|||
|
|||
![]() Quote:
Quote:
Caution: This script will remove links from the download list Code:
// Remove finished links older than 'x' days // Trigger : JDownloader Started var days = 365; //<- Days to keep the finished links in list var now = new Date(); var duration = days * 24 * 60 * 60 * 1000; callAPI("downloadsV2", "queryLinks", { "finishedDate": true }).filter(function(link) { return link.finishedDate; }).forEach(function(link) { if (now - link.finishedDate > duration) getDownloadLinkByUUID(link.uuid).remove(); }) |
#949
|
|||
|
|||
![]() Quote:
(Please put it in comments of the script, so it is not forgotten.) The only Thing: That will keep the growing downloadList, but seems to be the easy way. Is there a documentation for the EventScript? Till now I have not found anything.... Maybe a little strange thing: Is it possible to quit JD and than rewrite the downloadList.zip? How is the correct format of the downloadList? Bye, Christian Last edited by Amiganer; 02.10.2019 at 10:38. Reason: new idea |
#950
|
|||
|
|||
![]() Quote:
Code:
// Move finished link to user-defined package // Trigger: A Download stopped // IMPORTANT: Disable "GeneralSettings.movefilesifdownloaddestinationchangesenabled" in advanced settings if (link.isFinished()) { var newPkgName = "Already Downloaded"; // <- Package name to which the finished link will be moved var linkIds = [link.getUUID()]; var destPackageID = null; getAllFilePackages().some(function(package) { if (package.getName() == newPkgName) { destPackageID = package.getUUID(); return true; } }) if (destPackageID) { callAPI("downloadsV2", "moveLinks", linkIds, null, destPackageID); } else { callAPI("downloadsV2", "movetoNewPackage", linkIds, null, newPkgName, null); } } Quote:
Code:
my.jdownloader.org/developers If you need additional info/help, you can post your queries here. You can also find me/Jiaz in JD Chat. Added 2020.07.05 Code:
// Move finished links to user-defined package // Trigger: Package Finished // IMPORTANT: Disable "GeneralSettings.movefilesifdownloaddestinationchangesenabled" in advanced settings var destPackageID, linkIds = [], date = new Date().toISOString().replace(/(.{4})-(.{2}).+/, "$1$2"), newPkgName = "Already Downloaded " + date; // <- Package name to which the finished link will be moved getAllFilePackages().some(function(package) { if (package.name == newPkgName) { destPackageID = package.UUID; return true; } }) package.getDownloadLinks().forEach(function(link) { if (link.finished) linkIds.push(link.UUID); }) if (destPackageID) { callAPI("downloadsV2", "moveLinks", linkIds, null, destPackageID); } else { callAPI("downloadsV2", "movetoNewPackage", linkIds, null, newPkgName, null); } Last edited by mgpai; 05.07.2020 at 12:58. Reason: Correction (Trigger: A Download stopped) |
#951
|
|||
|
|||
![]() Quote:
So my Idea of recreate the downloadList.zip is obsolet, JD is doing it by himself. What is keeped: The downloadList will be slowing down... I think, that can be done by a plugin? It will collect (like the script now does) the finished links and if a new link arrives compare that with already downloaded linkList created by the plugin himself. If possible that will not more slowdown the downloadList by growing. Is it possible to mark a downloadlink as double in the linkGrabber? As I know, highlithing it (red I think) is not possible, maybe something like a comment that is shown.... complex.... I'll try to figure that out with the new documentation you linked me.... Bye, Christian P.S.: tried it and worked. Thanks. How can I put all already finished links to that script? Another trigger? or running the script once over all links (how to do that)? Only a small issue: I can not give the Script a name? Last edited by Amiganer; 02.10.2019 at 11:19. Reason: working script |
#952
|
|||
|
|||
![]() Quote:
Assuming you have already disabled the 'advanced setting' and also have a "Already Downloaded" package.
|
#953
|
|||
|
|||
![]()
@mgpai:
i have two feature request for my script. -only convert audio stream with language ger ffprobe example: Stream #0:1(ger): Audio: dts Stream #0:2(eng): Audio: dts Stream #0:3(eng): Audio: ac3 -remove all other audio streams except ger one: ffmpeg -i input -map 0 -map -0:a:2 -c copy output Code:
-map 0 selects all streams from the input. -map -0:a:2 then deselects audio stream 3. The stream index starts counting from 0, so audio stream 10 would be 0:a:9. maybe this information helps you. thx in advance! Last edited by Tom; 03.10.2019 at 10:53. |
#954
|
|||
|
|||
![]() Quote:
Code:
// Build/update downloaded links history and add comment to finished link // Trigger : JDownloader Started var list = "c:/downloads/finished.txt"; // <- Set path to history file var history = getPath(list).exists() ? readFile(getPath(list)).split("\r\n") : []; var urls = []; callAPI("downloadsV2", "queryLinks", { "comment": true, "finished": true }).filter(function(apiLink) { return apiLink.finished && apiLink.comment != "Added to History"; }).forEach(function(apiLink) { var link = getDownloadLinkByUUID(apiLink.uuid); var url = link.getPluginURL(); if (history.indexOf(url) == -1) { urls.push(url); link.setComment("Added to History"); } }) if (urls.length) writeFile(getPath(list), urls.join("\r\n") + "\r\n", true); Quote:
Code:
// Disable links, if they exist in history // Trigger: A Download Started var list = "c:/downloads/finished.txt"; // <- Location of history file var history = getPath(list).exists() ? readFile(getPath(list)).split("\r\n") : []; if (history.indexOf(link.getPluginURL()) > -1) link.setEnabled(false); Quote:
Code:
// Move links to to "Already Downloaded" package, if they exist in history // Trigger: Packgizer Hook // IMPORTANT: Enable "Synchronous execution" checkbox if (state == "AFTER") { var list = "c:/downloads/finished.txt"; // <- Location of downloaded links history file var history = getPath(list).exists() ? readFile(getPath(list)).split("\r\n") : []; if (history.indexOf(link.getURL()) > -1) link.setPackageName("Already Downloaded"); } |
#955
|
|||
|
|||
![]() Quote:
This wiki has more information: Code:
trac.ffmpeg.org/wiki/Map I suggest you try converting the file in CLI. Once you find the correct command we can add it the script. |
#956
|
|||
|
|||
![]()
thx, great idea mgpai ;-)
this command works fine: ffmpeg.exe -i path\file -map 0:0 -map 0:1 -c:v copy -c:s copy -c:a: ac3 -b:a 640k -c:s copy outputfile |
#957
|
|||
|
|||
![]() Quote:
Example: Code:
callAsync(function(error) { if (!error) getPath(file).delete(); }, ffmpeg, "-i", file, "-map", "0:0", "-map", "0:1", "-c:v", "copy", "-c:s", "copy", "-c:a:", "ac3", "-b:a", "640k", "-c:s", "copy", file.replace(ext, "_ac3." + ext)); Above command replaces the file extension with 'ac3', but look like the example provided by you only copies the stream and does not convert it. You may need to adjust the output file pattern accordingly. Also, the audio stream map specified may not always be 'german', so you may also need to map the stream by language parameter, instead of stream ID. |
#958
|
|||
|
|||
![]() Quote:
Code:
// Get links from finished crawljob // Trigger: Remote API Event fired if (event.publisher == "linkcrawler" && event.id == "FINISHED") { var jobId = JSON.parse(event.data).jobId; var isJobRunning = function() { return callAPI("linkgrabberv2", "queryLinkCrawlerJobs", { "collectorInfo": true, "jobIds": [jobId] }).some(function(job) { return job.crawling || job.checking; }) } while (isJobRunning()) sleep(5000); callAPI("linkgrabberv2", "queryLinks", { "jobUUIDs": [jobId] }).forEach(function(apiLink) { var link = getCrawledLinkByUUID(apiLink.uuid); //alert(link.getUrl()); }) } |
#959
|
|||
|
|||
![]() Quote:
Quote:
In any case, you may still need to specify the language parameter to make sure your preferred choice of audio stream is converted. |
#960
|
|||
|
|||
![]()
you are right and twice is not needed.
i tested a bit and changed this as it worked in the CLI: "-map", "0:0", "-map", "0:m:language:ger", thx for the hint with the language selection :-) lets see how it works in the next days... |
![]() |
Thread Tools | |
Display Modes | |
|
|