#1
|
|||
|
|||
Events Scripter: how skip link
In event scripter when is triggered "Packagizer Hook" i use
Code:
var myuri = link.sourceUrls[0]; to get the source url, and I check if it matches some regex. My goal is remove that link from package if the matches fails. In example I could pass to JDownloader a link to a page "www.siterandom.com/somepage.html" , so JDownloader parse that page and in package where added this sources:
and would like that only "video.mp4" appears in package. This is a trivial example, since my control script is more complex, but the substance is this. Thanks. Last edited by Keryshan; 30.07.2016 at 19:09. Reason: Solved |
#2
|
||||
|
||||
you could do that with linkgrabber filter > filter rule, without the need for event scripter. source domain & filename is not what *.mp4, will result in filtered result.
__________________
raztoki @ jDownloader reporter/developer http://svn.jdownloader.org/users/170 Don't fight the system, use it to your advantage. :] |
#3
|
|||
|
|||
Quote:
but as said Quote:
|
#4
|
||||
|
||||
I would have thought that it would have still worked in ok. For example, if they don't show up, can't you auto add links that do via your script controlling? Maybe you want to also download other formats if mp4 isn't there? then script would be the solution.
It was more so just a thought =] I haven't played much with scripting engine so not sure what's available and not (other than what's displayed within help). best bet is to wait for mgpai to respond, hes usually quick on the ball =] raztoki
__________________
raztoki @ jDownloader reporter/developer http://svn.jdownloader.org/users/170 Don't fight the system, use it to your advantage. :] |
#5
|
|||
|
|||
To my knowledge, currently no methods are available to filter/remove/delete the links with packagizer hook.
|
#6
|
|||
|
|||
@raztoki
Yes, in substance vie event scripter I wuold perform a filter and eventually generate new links to add to package. That's why filter aren't enouth. Clearly I can mix the default filter and the Event Scripter, but it would have been nice to have everything in one script! @mpai thanks for replying... I am sorry that no such possibility exists :-( Last edited by Keryshan; 30.07.2016 at 15:11. |
#7
|
||||
|
||||
I don't know what exactly you need, but doesn't this work?
Code:
var myCrawledLink[] = getAllCrawledLinks();/*Get a list of all crawledlinks*/ var myString = myCrawledLink.getUrl(); var myBoolean = myCrawledLink.remove(); OR myCrawledLink.setEnabled(myBoolean); |
#8
|
|||
|
|||
[solved]
Thanks @ds1508 !
If someone has same problem, here is a snippet of my solution (Event Scripter - "Packagizer Hook"): Code:
if ( link.sourceUrls[0].match(/https?:\/\/www.siteToCrawl.com/i)) { var cr = getAllCrawledLinks() if (cr.length) { for (var i in cr) { var ur = cr[i].getUrl(); var name = cr[i].getName(); // I discriminate on file name if (!name.match(/\.mp4$/)) cr[i].setEnabled(false); } } } That's all! |
#9
|
||||
|
||||
The packagizer can only modify the link, NOT filter/remove it
I will add a "LinkFilter hook" so you can return true/false
__________________
JD-Dev & Server-Admin |
#10
|
|||
|
|||
Quote:
Thank you! I haven't read your reply, but now I can use your LinkFilter: great!!! |
Thread Tools | |
Display Modes | |
|
|