#1
|
|||
|
|||
![]()
Hi,
I would like to create simple application in Java which checks link status (if it is active or not). Where I can find information about it ? Can I use only some classes from JDownloader to do it ? Thanks for answers. Greetings |
#2
|
||||
|
||||
![]()
I'm sorry but "simple" is not that "simple"
![]() You can use classes from JDownloader Project, AppworkUtils only as a library.
__________________
JD-Dev & Server-Admin |
#3
|
||||
|
||||
![]()
The needed information you can find within the Plugin Class itself. eg
jd.plugins.hoster.Uploadedto, the requestFileInformation method
__________________
JD-Dev & Server-Admin |
#4
|
|||
|
|||
![]()
is there no something simple like
LinkChecker lC = new LinkChecker(); lC.check("www....") ? or maybe I can use LinkCollector .getInstance() .addCrawlerJob(.......) ? I just want to know if link is online or offline..nothing more ;/ |
#5
|
||||
|
||||
![]()
Yes, that would work but you will need nearly all JDownloader source for that
![]() In that case you could simply use an existing JDownloader and use the remote api and do whatever you want to do and still receive all the updates from us ![]()
__________________
JD-Dev & Server-Admin |
#6
|
|||
|
|||
![]()
Hmm where I can find documentation for remote api ?
Only what I want to check is if link is online or offline but i have a lot of links to check ![]() Is there any limit for using remote API ? |
#7
|
||||
|
||||
![]()
API, see here https://support.jdownloader.org/inde...erorg-api-docu
There is no limit. There are existing clients for MyJDownloader in Java/JS/php....
__________________
JD-Dev & Server-Admin |
#8
|
|||
|
|||
![]()
Hm OK but I don't undertand where is Java/JS/php.. ?
I have installed J2DBeta and created account. But on what local address does service work ? I saw in the Internet some PHP classess for API. I think that for me would be the best solution do it in PHP |
#9
|
||||
|
||||
![]()
Java Client is svn://svn.jdownloader.org/jdownloader/MyJDownloaderClient
JS, I can give you if you need it. php, google for it There is no local address. You either use the tunnel mode via api.jdownloader.org or establish a direct connection to your JDownloader and then use ip:port combination that got established
__________________
JD-Dev & Server-Admin |
#10
|
|||
|
|||
![]()
If I would like to establish a direct connection, What I have to do ?
I can't find settings where I can set PORT or IP. I have a lot of links to check so I tihnk that tunnel via api.jdownloader.org is not the best Idea. |
#11
|
||||
|
||||
![]()
You use api.jdownloader.org and then use the command to establish a direct connection
then you can directly speak to your JDownloader instance. You can enable the "Deprecated API" in advanced settings in JDownloader, then you can access all api commands Without Encryption/Authentication.
__________________
JD-Dev & Server-Admin |
#12
|
|||
|
|||
![]()
So can't I set direct connection to my JDownloader instance using options (advenced) in JDownloader ?
I see there Connect IP, port etc Last edited by Stepel; 21.10.2015 at 21:40. |
#13
|
||||
|
||||
![]()
Yes you can...I already descibed it.....First you login at api.jdownloader.org and then ask your jdownloader for direct connection mode and then you can connect directly
OR you enable the "deprecated api" in advanced settings and bypass myjdownloader and be able to use the api directly without any encryption/authentication at all
__________________
JD-Dev & Server-Admin |
#14
|
|||
|
|||
![]()
What is appkey parameter ?
I checked one class for php, I connect and add Link and i get response with token etc..but nothing new in my linkgrabber.. I've noticed that i Have response from "connect" but addLink returns FALSE :/ Last edited by Stepel; 23.10.2015 at 00:07. |
#15
|
||||
|
||||
![]()
I think best would be to join chat so we can talk live about this (irc, freenode, #jdteam)
appkey = use your email so we can contact you in case we need to
__________________
JD-Dev & Server-Admin |
#16
|
|||
|
|||
![]()
Hi,
what response should I get from method AddLinks ? I add link via API from PHP but I get url= http://api.jdownloader.org/t_78a652f...berv2/addLinks response= { "rid" : 1445726889, "data" : "" } data is empty ? I need to get information about LINK_AVALIABLE ? Is there method which return list of Lingrabber List ? I can't find in documentation :( |
#17
|
||||
|
||||
![]()
Hi,
There is no single method way You need to do 1.) add links 2.) get linkcollector list when crawling / checking is finished This is because the whole crawling/checking is multithreaded and the api cannot wait till everything is done (timeout), that's why you have to poll for results or listen to event channel There is no checklink(url) because an url can also lead to multiple results + multithreaded from above. addLinks has no response in error free
__________________
JD-Dev & Server-Admin |
#18
|
|||
|
|||
![]()
Yes I know that there is no checklink(url)
but is there method to get linkcollector list ? There should be information about status like in JD2. I don't want even download file. I see that if I paste(or add by API) properly link status is ONLINE else OFFLINE so it works as I want. |
#19
|
||||
|
||||
![]()
Yes there is, see the api doc for querylinks. I guess the php client was first work with just 1,2 example methods. you will have to add the addtional methods yourself. Contact us in chat between Mo-Fr if you need help with that.
__________________
JD-Dev & Server-Admin |
#20
|
|||
|
|||
![]()
Hi, what i should send when I want removeLink ?
WHat is ID of link ? it is uuid ana packageUUID from response from queryLink ? |
#21
|
||||
|
||||
![]()
packageUUID is the UUID from the package
each link has its own UUID you can either remove the complete package or single links
__________________
JD-Dev & Server-Admin |
#22
|
|||
|
|||
![]()
Are both fields mandatory ? I haven't seen in Java code that those parameters have defalut values.
|
#23
|
||||
|
||||
![]()
no, they are not, leave them empty (not null)
when you provide a packageUUID -> you want to delete all children from package in case you only want some links, provide their linkUUIDs
__________________
JD-Dev & Server-Admin |
#24
|
|||
|
|||
![]()
Should it be sth like that (just example):
{"url":"/linkgrabberv2/removeLinks","links":["{}"],"packages":["{1446157638919}"],"rid":1446157644,"apiVer":1} ? |
#25
|
||||
|
||||
![]()
no,the parameters are not named. they are not key/value!
parameters are given in an json array! ["string",-1,{Object}]
__________________
JD-Dev & Server-Admin |
#26
|
|||
|
|||
![]()
Ok thanks, in PHP it should look like
$json_data = '{"url":"'.$action.'","params":[['.$links.'],['.$packages.']],"rid":'.$this -> getUniqueRid().',"apiVer":'.$this -> apiVer.'}'; it works as I want ![]() Now I have to connect directly to my JDonwloader instance |
#27
|
||||
|
||||
![]()
@Stepel: Thanks for the feedback
For direct connection. Query /device/getDirectConnectionInfos it will return a list of IP/PORT pairs you can try to connect simply replace api.jdownloader.org with IP/PORT when doing a request to JDownloader for server commands keep api.jdownloader.org you can use /device/ping command for simple connection testing
__________________
JD-Dev & Server-Admin |
#28
|
|||
|
|||
![]()
What do you mean by "Query /device/getDirectConnectionInfos
it will return a list of IP/PORT pairs you can try to connect" ? Is it enugh to change api.jdownloader.org in advance settings ? What I should set more ? |
#29
|
||||
|
||||
![]()
You call the command /device/getDirectConnectionInfos on the device(your JDownloader)
the answer contains a list of IP/PORT Then you can use IP:PORT instead of api.jdownloader.org and use the command /device/ping if the connection works if yes, use the IP:PORT for all further device requests if no, try next IP:PORT and check again you simply exchange api.jdownloader.org with the IP:PORT that works, nothing more, nothing less
__________________
JD-Dev & Server-Admin Last edited by raztoki; 03.11.2015 at 11:07. Reason: disable smiles |
#30
|
|||
|
|||
![]()
Hm Have I to change only in my php class or in advance settings?
If I want to try at home i think i have to set port forwarding on my router :/ response= { "rid" : 1446587609, "data" : { "infos" : [ { "port" : 46487, "ip" : "192.168.1.3" }, { "port" : 46487, "ip" : "127.0.0.1" } ] } } This is what i got. |
#31
|
||||
|
||||
![]()
you have to update php client and add support to use
ip:port from list when sending commands to your device by default it uses api.jdownloader.org you will have to modify code to use ip:port instead You only need to enable upnp/port forwarding if you want to use direct-mode outside your wlan/lan
__________________
JD-Dev & Server-Admin |
#32
|
|||
|
|||
![]()
Something doesn't work.
I have pure linux with jd2 and public ip. getDirectConnectionInfos returns me IP and PORT. Should I have to be connected to my.jownloader.org in my instance or not ? In PHP I have private $api_url = "http://api.jdownloader.org"; Are you suggesting to change it to private $api_url = "http://IP:PORT"; o without http ? What about advanced settings in my jd2 instance ? Should I change something there ? Last edited by raztoki; 06.11.2015 at 10:08. Reason: disabled smilies & spelling fixes |
#33
|
||||
|
||||
![]()
With a valid IP:Port from getDirectConnectionInfos
you simply use $api_url = "http://api.jdownloader.org" for all commands that are server side (eg account stuff) and $api_url = "http://IP:PORT"; for all commands that are jdownloader side
__________________
JD-Dev & Server-Admin Last edited by raztoki; 06.11.2015 at 10:06. Reason: disabled smilies |
#34
|
|||
|
|||
![]()
Do I have to be connected to my.jdownloader.org in my instancje or not ?
What about advanced settings in my jd2 instance ? Should I change something there ? |
#35
|
||||
|
||||
![]()
Nothing to change in advanced settings
my.jdownloader.org is just a simple webclient for the api it is api.jdownloader.org you first login there to get your session/token and then call your device for getDirectConnectionInfos and then can use IP:PORT for all further requests to your device.
__________________
JD-Dev & Server-Admin |
#36
|
|||
|
|||
![]()
Sth doesn't work :(
Should I see something if I open http://IP:PORT in browser? |
#37
|
|||
|
|||
![]()
I don't understand something.
Why I should connect first to api.jdownloader.org ? I thought that my JD2 instance is my "server" when I use direct connection.. |
#38
|
|||
|
|||
![]()
Don't I need Tomcat or sth ?
|
#39
|
||||
|
||||
![]()
No, you should NOT see anything when you simply open IP:PORT in browser.
You first connect to api.jdownloader.org to get a session, authenticate yourself to your JDownloader. Then query connection infos via getDirectConnectionInfos and then can directly connect to your JDownloader via the authenticated session. And no, why should you need an additional webserver? You connect to JDownloader
__________________
JD-Dev & Server-Admin |
#40
|
|||
|
|||
![]()
I am just asking because I don't understand why it doesn't work :(
|
![]() |
Thread Tools | |
Display Modes | |
|
|