#921
|
||||
|
||||
Please see https://my.jdownloader.org/developers/#tag_265 for the structures/objects
It's Quote:
__________________
JD-Dev & Server-Admin |
#922
|
||||
|
||||
Quote:
later find the links for specific job. Quote:
__________________
JD-Dev & Server-Admin |
#923
|
||||
|
||||
I really recommend to NOT use api event stream at all and just use *On new link* and *Download has stopped*. in case you want to stick with api event stream, there should be events when new links got added to linkgrabber list instead of listening to the linkcrawler events
__________________
JD-Dev & Server-Admin |
#924
|
||||
|
||||
The script with trigger api event stream mustn't be synchronized/blocking because it may slow down alot or even cause deadlocks. I will provide new methods to provide synchronized blocks within scripts instead of the complete script
__________________
JD-Dev & Server-Admin |
#925
|
|||
|
|||
Quote:
Code:
"jobId": jid you need to use: Code:
"jobId": [jid] |
#926
|
||||
|
||||
Quote:
__________________
JD-Dev & Server-Admin |
#927
|
||||
|
||||
@Demongornot: I suggest we create a new Thread for questions about development /api use and leave this thread for questions/finished scripts. What do you think?
__________________
JD-Dev & Server-Admin |
#928
|
|||
|
|||
Quote:
And another thread where we discuss general script related questions which aren't directly related to script requests and resulting scripts. You'll have a lot of post to move, sort and create links to though. I'll wait for your answer/decision before posting answers for the previous posts related to my questions. |
#929
|
||||
|
||||
@Demongornot: I agree. Maybe instead of a thread, maybe a seperate subforum dedicated to threads and each thread contains a single script with request/script ... new thread->new request -> script in this thread. that way it's easier to search and discuss for requests/feature wishes and scripts.
what do you and @mgpai think about this?
__________________
JD-Dev & Server-Admin |
#930
|
|||
|
|||
@Jiaz I agree, a subforum for development (which could include a thread for functions/methods request), API and scripts in general and another for scripts request and posting, though a main thread that catalog and link all the posted scripts would still be nice and useful, I am not a believer in the search system, though I use it as much as possible, I know that it isn't perfect (I might loose hours per weeks fighting against the stupid Google algo, even using include, exclude, date and other filters, and yet Google is the best out there) and one could miss a script just because it have a different name than his function might suggest.
The most practical thing for the "index" would be that everyone making a script could "submit" his post containing the script, moderators and highers would just need to validate it and voila, the link to said post will be automatically added to the list, if he submit another post with the same script name, it will simply be for updating the link to a newer version, this way it don't require a long and tedious job for the team to keep the list updated. |
#931
|
||||
|
||||
I don't see any real advantage from an index for scripts than just a simple subforum where each script has its own thread and the script can be discussed and updated within same thread. That way the team isn't involved and ppl can request scripts and community and nice ppl like you&mgpai can respond in thread and provide scripts, then the thread tag can be changed from request to finished .
__________________
JD-Dev & Server-Admin |
#932
|
|||
|
|||
It's all up to you to take the final decision.
I wasn't talking about only an index but rather both a subforum which include a pinned index thread, which would work exactly as you described while adding an easier way to find scripts. It would offer the advantage to see all the scripts at an unique place without the user having the search feature which doesn't always work, it can also help discovering scripts we didn't know we wanted/needed and would have never thought about searching them. It can easily prevent to miss a script because the title of the request or of the poster isn't good enough to find said script because of its name (hence why I talked about a basic description when required) or if an user search for a specific script with no ideas how to call it and/or if keywords from inside a post would be to general and drawn the potential answer inside many unrelated posts. Also there are some script that can be good for some peoples who need really specific feature but who wouldn't make it into that list because they could be exploited in a negative way if the user don't know what he is doing, it would help to avoid this script to be "easily" found, and lets peoples who specifically want it to search for it as the "normal" way would be to look at the index. The other side of this is best demonstrated by my first post, where an users who ask if something in JDownloader (it will probably not be posted in the scripts subforum) can be done and someone and someone answer them with a script solving their issue, it won't require to move the thread to the subforum nor renaming it, as the name could be totally irrelevant for scripts request/search. And finally, in a thread, a long discussion can happen with many versions of the script being posted, the first and last to be found aren't necessarily the one an user might want but rather an outdated or a special version requested by someone who had specific needs, an index would help an user who isn't computer literate to find the good one as its name/description will link to the specific post of the "general" and latest version. That's my arguments in favor in a pinned index in the subforum. I got that idea from the Kerbal Space Program game's forum, the mods subforum contain an index who did the same : **External links are only visible to Support Staff****External links are only visible to Support Staff** Sadly it was from a member and not from the team, meaning that when the user became inactive, the thread wasn't updated anymore. |
#933
|
|||
|
|||
Quote:
Quote:
Quote:
Can u make for me script? Im waiting for your help this is big problem for me Need simulate connections for fichier connect downloads and after download some data or specific time skip and move forward my list next simulate. I got many data i do it once in 80-90 days. Now again must Quota is in my account and 14 days to move this files from cold storage to hot storage if don't do it they will delete my files. Manually it's couple days time for me if i will be got some help i will be grateful for your time for me. Last edited by DunDee; 30.09.2019 at 09:20. |
#934
|
|||
|
|||
Sorry, but I have to decline this particular request. I have, in my previous posts (in this thead), explained why I do not wish to create scripts which simulate downloads.
|
#935
|
||||
|
||||
@mgpai: I told him to contact you. He has a valid use-case and it's fine for me if you help creating a script. He needs to *load* the files from his own account for specific time, else they will count as inactive and trashed/deleted.
__________________
JD-Dev & Server-Admin |
#936
|
||||
|
||||
@Demongornot: now I understand. a new subforum with each thread to a specific script and it's questions/discussion. latest script version in first post. and one sticky thread that serves as an index for all scripts/managed threads for easier *look and find* ? To be honest, I don't have the time for maintaining or supporting that subforum but if you would spend time on it and @mgpai would also agree on this, I would setup such a subforum for you.
__________________
JD-Dev & Server-Admin |
#937
|
|||
|
|||
Quote:
Code:
1fichier.com/hlp.html That is their business model. If users needs additional cold storage, they have have to opt for a different plan.
@DunDee: Please contact me in JD Chat. |
#938
|
|||
|
|||
Quote:
What I was thinking about is, the sticky index thread simply link directly to the post in the thread where the latest script version is, this can also allow for multiples scripts per post to be linked in the index. And if a auto submitting and updating code is put in place on the forum, it mean the only job for the team would be to check for any abuse rather than having manually to link all them, except the initial subforum sorting and threads building if course. But it can also be used to link the script's posts in the first page of the thread. Regardless how you do it, I agree, as a subforum for scripts would be a nice addition ! |
#939
|
||||
|
||||
Quote:
Quote:
Perfect
__________________
JD-Dev & Server-Admin |
#940
|
|||
|
|||
Quote:
|
#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
|
|||
|
|||
Preventing double Downloads
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
|
|||
|
|||
Programming Languages
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 | |
|
|