@@ -632,6 +632,12 @@ def force_download(self, link_ids=[], package_ids=[]):
632632 resp = self .device .action (self .url + "/forceDownload" , params )
633633 return resp
634634
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+
635641class Captcha :
636642 """
637643 Class that represents the captcha interface of a Device
@@ -745,8 +751,9 @@ def action(self, path, params=(), http_action="POST"):
745751 response = self .myjd .request_api (path , http_action , params ,
746752 action_url )
747753 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 " ))
750757 else :
751758 # My.JDownloader Api worked, lets refresh the direct connections and return
752759 # the response.
@@ -781,8 +788,9 @@ def action(self, path, params=(), http_action="POST"):
781788 response = self .myjd .request_api (path , http_action , params ,
782789 action_url )
783790 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 " ))
786794 # My.JDownloader Api worked, lets refresh the direct connections and return
787795 # the response.
788796 self .__refresh_direct_connections ()
0 commit comments