@@ -632,6 +632,12 @@ def force_download(self, link_ids=[], package_ids=[]):
632
632
resp = self .device .action (self .url + "/forceDownload" , params )
633
633
return resp
634
634
635
+ def set_dl_location (self , directory , package_ids = []):
636
+ params = [directory , package_ids ]
637
+ resp = self .device .action (self .url + "/setDownloadDirectory" , params )
638
+ return resp
639
+
640
+
635
641
class Captcha :
636
642
"""
637
643
Class that represents the captcha interface of a Device
@@ -745,8 +751,9 @@ def action(self, path, params=(), http_action="POST"):
745
751
response = self .myjd .request_api (path , http_action , params ,
746
752
action_url )
747
753
if response is None :
748
- # My.JDownloader Api failed too.
749
- return False
754
+ # My.JDownloader Api failed too we assume a problem with the connection or the api server
755
+ # and throw an connection exception.
756
+ raise (MYJDConnectionException ("No connection established\n " ))
750
757
else :
751
758
# My.JDownloader Api worked, lets refresh the direct connections and return
752
759
# the response.
@@ -781,8 +788,9 @@ def action(self, path, params=(), http_action="POST"):
781
788
response = self .myjd .request_api (path , http_action , params ,
782
789
action_url )
783
790
if response is None :
784
- # My.JDownloader Api failed too.
785
- return False
791
+ # My.JDownloader Api failed too we assume a problem with the connection or the api server
792
+ # and throw an connection exception.
793
+ raise (MYJDConnectionException ("No connection established\n " ))
786
794
# My.JDownloader Api worked, lets refresh the direct connections and return
787
795
# the response.
788
796
self .__refresh_direct_connections ()
0 commit comments