JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #921  
Old 26.09.2019, 15:57
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,013
Default

Quote:
Originally Posted by Demongornot View Post
Well I tried "queryLinkCrawlerJobs" using this :
Please see https://my.jdownloader.org/developers/#tag_265 for the structures/objects
It's
Quote:
"jobUUIDs" = (long[])
__________________
JD-Dev & Server-Admin
Reply With Quote
  #922  
Old 26.09.2019, 16:01
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,013
Default

Quote:
Originally Posted by Demongornot View Post
@mgpai Thanks you !
@Jiaz
It increase the memory only during the crawling execution or it stay ? And if it is the latter, can it be cleared ?
The jobID is stored as property to the link. there is no cleanup for this because that would be contrary to *assignJobID* so you can
later find the links for specific job.

Quote:
Originally Posted by Demongornot View Post
Also I would love an API method to get "job" from "jobId" please !
queryLinkCrawlerJobs, see https://my.jdownloader.org/developers/#tag_262
__________________
JD-Dev & Server-Admin
Reply With Quote
  #923  
Old 26.09.2019, 16:03
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,013
Default

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
Reply With Quote
  #924  
Old 26.09.2019, 16:45
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,013
Default

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
Reply With Quote
  #925  
Old 26.09.2019, 17:20
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,591
Default

Quote:
Originally Posted by Demongornot View Post
Thanks, but it return [] only, even when I make sure links are still crawled.
Sorry. My bad. I thought you wanted to get the crawled links by Job ID. As Jiaz has pointed out, in your query, instead of:
Code:
"jobId": jid

you need to use:
Code:
"jobId": [jid]
Reply With Quote
  #926  
Old 26.09.2019, 17:54
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,013
Default

Quote:
Originally Posted by mgpai View Post
Sorry. My bad. I thought you wanted to get the crawled links by Job ID. As Jiaz has pointed out, in your query, instead of:
Code:
"jobId": jid

you need to use:
Code:
"jobId": [jid]
It's jobIds and not jobId see https://my.jdownloader.org/developers/#tag_260
__________________
JD-Dev & Server-Admin
Reply With Quote
  #927  
Old 26.09.2019, 17:55
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,013
Default

@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
Reply With Quote
  #928  
Old 26.09.2019, 19:16
Demongornot Demongornot is offline
Registered / Inactive
 
Join Date: Sep 2019
Location: Universe, Local group, Milky Way, Solar System, Earth, France
Posts: 50
Default

Quote:
Originally Posted by Jiaz View Post
@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?
I think the best would be a thread created and handled by mods/admins and superior, with only script request, resulting script and script without request and related discussions, the first post (handled by staff) would be a an index with name and if required description of all scripts with a link to their respective posts.
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.
Reply With Quote
  #929  
Old 27.09.2019, 11:09
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,013
Default

@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
Reply With Quote
  #930  
Old 27.09.2019, 12:35
Demongornot Demongornot is offline
Registered / Inactive
 
Join Date: Sep 2019
Location: Universe, Local group, Milky Way, Solar System, Earth, France
Posts: 50
Default

@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.
Reply With Quote
  #931  
Old 27.09.2019, 14:02
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,013
Default

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
Reply With Quote
  #932  
Old 27.09.2019, 19:44
Demongornot Demongornot is offline
Registered / Inactive
 
Join Date: Sep 2019
Location: Universe, Local group, Milky Way, Solar System, Earth, France
Posts: 50
Default

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.
Reply With Quote
  #933  
Old 30.09.2019, 09:14
DunDee DunDee is offline
Registered / Inactive
 
Join Date: Aug 2019
Posts: 16
Default

Quote:
Originally Posted by DunDee View Post
Data from hot storage to cold are moved after no downloading 80 days when it is they can delete my data in 14 days if nobody download it. That's why i need script to simulate download from other account 1fichier.com. Im doing it once on 2 months. Need this script to do it faster with connections make and don't sit in Jd2 and look all time when connected are delete it. Can u do some script for me or modify exist in JD2.
Quote:
//check if downloads are running at all
if (isDownloadControllerRunning() && !isDownloadControllerStopping()) {
var running = getRunningDownloadLinks();
//loop through all running Downloads
for (var i = 0; i < running.length; i++) {
//check if the download has been running at least 30 seconds
if (running[i].getDownloadDuration() > 30000) {
//check if the current speed is below 50kb/s
if (running[i].getSpeed() < 50 * 1024) {
//reset the download
//running[i].reset();
//stop the download and restart it
running[i].abort();
}

}
}
}
Quote:
Originally Posted by Jiaz View Post
Thanks for the feedback. Didn't know that they're going to delete from cold storage after some time
@mgpai: contact me via mail so we can talk about possible scripts/options for dundee
Hi @mgpai , @Jiaz
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.
Reply With Quote
  #934  
Old 30.09.2019, 12:58
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,591
Default

Quote:
Originally Posted by DunDee View Post
Hi @mgpai ... Can u make for me script?
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.
Reply With Quote
  #935  
Old 30.09.2019, 19:18
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,013
Default

@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
Reply With Quote
  #936  
Old 30.09.2019, 19:33
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,013
Default

@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
Reply With Quote
  #937  
Old 30.09.2019, 21:02
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,591
Default

Quote:
Originally Posted by Jiaz View Post
@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.
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.
  • All data storage is based on physical infrastructures, which uses a secure and air-conditioned physical space, uses energy and has a significant cost.
  • In order to always offer you the best services at the best prices, we have to distinguish between data used (Hot Storage) and unused (Cold Storage).
  • Our Free and Access offers include up to 1TB of temporary storage.
  • The Premium offer includes by default an unlimited space of Hot Storage and 2TB of Cold Storage.
  • Extensions to get more Cold Storage are available on your management interface at unbeatable rates.
If I understand correctly, the script which simulates the download will be required only to circumvent it. I am open to be convinced otherwise.

@DunDee: Please contact me in JD Chat.
Reply With Quote
  #938  
Old 01.10.2019, 12:02
Demongornot Demongornot is offline
Registered / Inactive
 
Join Date: Sep 2019
Location: Universe, Local group, Milky Way, Solar System, Earth, France
Posts: 50
Default

Quote:
Originally Posted by Jiaz View Post
@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.
I wasn't thinking about making the first post of the thread the latest version, you could make this the standard of you want, but I it would probably require a lot of team interversion to individually modify every topics, as it is up to the topic creator (who may just be someone registered to ask a script and who don't know about putting the script in the first post) to do that otherwise.
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 !
Reply With Quote
  #939  
Old 01.10.2019, 14:54
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,013
Default

Quote:
Originally Posted by Demongornot View Post
I wasn't thinking about making the first post of the thread the latest version, you could make this the standard of you want, but I it would probably require a lot of team interversion to individually modify every topics, as it is up to the topic creator (who may just be someone registered to ask a script and who don't know about putting the script in the first post) to do that otherwise.
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.
I don't see any difference if I have to update the sticky thread and update to latest script version or update thread itself and either update first post or link updated script version in first post.

Quote:
Originally Posted by Demongornot View Post
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.
Who codes/maintains that *auto submitting/updating code* ?

Quote:
Originally Posted by Demongornot View Post
Regardless how you do it, I agree, as a subforum for scripts would be a nice addition !
Perfect
__________________
JD-Dev & Server-Admin
Reply With Quote
  #940  
Old 01.10.2019, 15:06
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,591
Default

Quote:
Originally Posted by Amiganer View Post
The best would be as it happend if the downloads remain in the Download-Screen. If the links comes in with the grabber and it is in the list, pop up the window: "delete allready downloaded files from list". If that is possible.
If you keep the finished links in downloaded list, you can try (if you haven't already) the following options, which can be used to handle duplicate links.
  • JD can automatically remove the links from linkgrabber when they are added to the downloadlist . You can find/set different actions to handle dupes, in:
    Code:
    Settings > Advanced Settings> LinkgrabberSettings.defaultonaddeddupeslinksaction
  • They can also be prevented from being added to the linkgrabber, by creating linkgrabber filter rules (Settings > Linkgrabber Filter > Filter). After they are filtered, they can also be added back (if you so wish), by clicking "Restore 'n' filtered links" button in the linkgrabber bottom toolbar.

    Filter Rule:
    Code:
    Condition > is true > Link is already in Download List
Reply With Quote
  #941  
Old 01.10.2019, 15:24
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,591
Default

Quote:
Originally Posted by Amiganer View Post
The best would be as it happend if the downloads remain in the Download-Screen. If the links comes in with the grabber and it is in the list, pop up the window: "delete allready downloaded files from list". If that is possible.
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.
Reply With Quote
  #942  
Old 01.10.2019, 15:34
Demongornot Demongornot is offline
Registered / Inactive
 
Join Date: Sep 2019
Location: Universe, Local group, Milky Way, Solar System, Earth, France
Posts: 50
Default

Quote:
Originally Posted by Jiaz View Post
I don't see any difference if I have to update the sticky thread and update to latest script version or update thread itself and either update first post or link updated script version in first post.
With the code I described, it will allow to basically self update the sticky while, in the script's thread, showing the script post's links before the first post.
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.

Quote:
Originally Posted by Jiaz View Post
Who codes/maintains that *auto submitting/updating 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 ?
Reply With Quote
  #943  
Old 01.10.2019, 16:51
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,013
Default

Quote:
Originally Posted by Demongornot View Post
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 ?
None of us is familiar enough for forum code and it's written in PHP and we're all Java guys So none of the team will be able to write it nor find time for it.
__________________
JD-Dev & Server-Admin
Reply With Quote
  #944  
Old 01.10.2019, 21:16
Amiganer Amiganer is offline
JD Fan
 
Join Date: Mar 2019
Posts: 72
Default 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
Reply With Quote
  #945  
Old 01.10.2019, 21:16
Demongornot Demongornot is offline
Registered / Inactive
 
Join Date: Sep 2019
Location: Universe, Local group, Milky Way, Solar System, Earth, France
Posts: 50
Default

Quote:
Originally Posted by Jiaz View Post
None of us is familiar enough for forum code and it's written in PHP and we're all Java guys So none of the team will be able to write it nor find time for it.
That's the opposite for me, I'm not a Java guy, though I know enough C and C++ to be familiar with the syntax and base of it, I did learn a bit of PHP a decade ago, PHP is a little different, but it is lite, it lies somewhere between Javascript and Java, the syntax is closer to Javascript than Java and while in Javascript you need to know a bit of Documents (DOM), for PHP this is more about knowing HTML and CSS, and you also need to be familiar with database like the old yet still popular MySQL for example.
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.
Reply With Quote
  #946  
Old 01.10.2019, 22:15
Amiganer Amiganer is offline
JD Fan
 
Join Date: Mar 2019
Posts: 72
Default 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
Reply With Quote
  #947  
Old 02.10.2019, 01:06
Demongornot Demongornot is offline
Registered / Inactive
 
Join Date: Sep 2019
Location: Universe, Local group, Milky Way, Solar System, Earth, France
Posts: 50
Default

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.
Reply With Quote
  #948  
Old 02.10.2019, 08:12
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,591
Default

Quote:
Originally Posted by Amiganer View Post
... 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?
It is possible to create a script to move the finished links to a different package, but you may need to disable "GeneralSettings.movefilesifdownloaddestinationchangesenabled" in advanced settings. Else, the files on disk will also be moved, if the source and destination package ("Already Downloaded") download folders are different.

Quote:
Originally Posted by Amiganer View Post
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)...
A better option would be to remove the links from the list by matching the finished date. Following script can be used to remove finished links which are older than 'x' days.

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();
})
Reply With Quote
  #949  
Old 02.10.2019, 08:44
Amiganer Amiganer is offline
JD Fan
 
Join Date: Mar 2019
Posts: 72
Default

Quote:
Originally Posted by mgpai View Post
It is possible to create a script to move the finished links to a different package, but you may need to disable "GeneralSettings.movefilesifdownloaddestinationchangesenabled" in advanced settings. Else, the files on disk will also be moved, if the source and destination package ("Already Downloaded") download folders are different.

......
Setting an option should be no problem.
(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
Reply With Quote
  #950  
Old 02.10.2019, 09:42
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,591
Default

Quote:
Originally Posted by Amiganer View Post
Setting an option should be no problem.
(Please put it in comments of the script, so it is not forgotten.)
Caution: This script will move finished links to a different package.

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:
Originally Posted by Amiganer View Post
Is there a documentation for the EventScript? Till now I have not found anything....
A list of available methods (with some examples) can be found in the eventscripter script editor (Main Menu > Show/Hide Help). You can also use MYJD API methods in the eventscripter (using callAPI method).

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)
Reply With Quote
  #951  
Old 02.10.2019, 10:53
Amiganer Amiganer is offline
JD Fan
 
Join Date: Mar 2019
Posts: 72
Default

Quote:
Originally Posted by mgpai View Post
Caution: This script will move finished links to a different package.
...
Than that's it, thank you.
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
Reply With Quote
  #952  
Old 02.10.2019, 11:50
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,591
Default

Quote:
Originally Posted by Amiganer View Post
How can I put all already finished links to that script? Another trigger?
Of course you can use a script, but it will be easier using GUI.

Assuming you have already disabled the 'advanced setting' and also have a "Already Downloaded" package.
  1. Use Quick filter in the bottom toolbar ("Successful Downloads") to view only the finished links.
  2. Select them and use the context menu command "Other > Move to a new Package" and move the links to a new package (For e.g. "Temp")
  3. Disable the quick filter. Merge "Temp" and "Already Downloaded" package, using drag 'n' drop.
Quote:
Originally Posted by Amiganer View Post
I can not give the Script a name?
In the eventscripter script list panel, double-click in the respective row in the 'name' column and type the desired name for the script.
Reply With Quote
  #953  
Old 03.10.2019, 10:50
Tom Tom is offline
JD Adviser
 
Join Date: Jun 2018
Posts: 104
Default

@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.
Reply With Quote
  #954  
Old 03.10.2019, 12:23
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,591
Default

Quote:
Originally Posted by Amiganer View Post
I think, that can be done by a plugin? It will collect (like the script now does) the finished links...
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:
Originally Posted by Amiganer View Post
... and if a new link arrives compare that with already downloaded linkList created by the plugin himself.
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:
Originally Posted by Amiganer View Post
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....
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");
}
Reply With Quote
  #955  
Old 04.10.2019, 08:28
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,591
Default

Quote:
Originally Posted by Tom View Post
-only convert audio stream with language ger
-remove all other audio streams except ger one:
This is not my area of expertise. It will me as much time, as it would you to figure this out. It think if you specify only the audio stream language the output file will contain only that stream and you may not need to remove the others, because they will not be copied/converted at all.

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.
Reply With Quote
  #956  
Old 04.10.2019, 09:20
Tom Tom is offline
JD Adviser
 
Join Date: Jun 2018
Posts: 104
Default

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
Reply With Quote
  #957  
Old 04.10.2019, 09:37
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,591
Default

Quote:
Originally Posted by Tom View Post
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
Replace the command in the script with then new command. Enclose the parameters in quotes separating them with ',' (comma) instead of 'space'.

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.
Reply With Quote
  #958  
Old 04.10.2019, 11:48
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,591
Default

Quote:
Originally Posted by Demongornot View Post
... So I am out of idea about how to analyse only the latest links and already existing ones in a CPU and memory usage friendly way...
Can use this method to get new links added by a crawler job.

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());
    })
}
Reply With Quote
  #959  
Old 04.10.2019, 12:46
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,591
Default

Quote:
Originally Posted by Tom View Post
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
Quote:
Originally Posted by mgpai View Post
... look like the example provided by you only copies the stream and does not convert it.
Your example does indeed convert the audio stream. I saw the "copy" parameter at the end and thought it was for the audio stream. Turns out it was "-c:s copy", which appears twice in it. Does it need to be used twice?

In any case, you may still need to specify the language parameter to make sure your preferred choice of audio stream is converted.
Reply With Quote
  #960  
Old 04.10.2019, 13:18
Tom Tom is offline
JD Adviser
 
Join Date: Jun 2018
Posts: 104
Default

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...
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 00:19.
Provided By AppWork GmbH | Privacy | Imprint
Parts of the Design are used from Kirsch designed by Andrew & Austin
Powered by vBulletin® Version 3.8.10 Beta 1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.