Skip to content

Commit e547d07

Browse files
authored
Merge pull request #43 from mmarquezs/develop
Release 1.1.0
2 parents 003a702 + 4a933f9 commit e547d07

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

myjdapi/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@
3434
MYJDUnknownException,
3535
)
3636

37-
__version__ = "1.0.7"
37+
__version__ = "1.1.0"

myjdapi/myjdapi.py

+12-4
Original file line numberDiff line numberDiff line change
@@ -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+
635641
class 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()

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
long_description = f.read()
1212
setup(
1313
name='myjdapi',
14-
version='1.0.7',
14+
version='1.1.0',
1515
description='Library to use My.Jdownloader API in an easy way.',
1616
long_description=long_description,
1717
url='https://github.com/mmarquezs/My.Jdownloader-API-Python-Library/',

0 commit comments

Comments
 (0)