Skip to content

Commit

Permalink
Merge pull request #43 from mmarquezs/develop
Browse files Browse the repository at this point in the history
Release 1.1.0
  • Loading branch information
mmarquezs authored May 19, 2021
2 parents 003a702 + 4a933f9 commit e547d07
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion myjdapi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@
MYJDUnknownException,
)

__version__ = "1.0.7"
__version__ = "1.1.0"
16 changes: 12 additions & 4 deletions myjdapi/myjdapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,12 @@ def force_download(self, link_ids=[], package_ids=[]):
resp = self.device.action(self.url + "/forceDownload", params)
return resp

def set_dl_location(self, directory, package_ids=[]):
params = [directory, package_ids]
resp = self.device.action(self.url + "/setDownloadDirectory", params)
return resp


class Captcha:
"""
Class that represents the captcha interface of a Device
Expand Down Expand Up @@ -745,8 +751,9 @@ def action(self, path, params=(), http_action="POST"):
response = self.myjd.request_api(path, http_action, params,
action_url)
if response is None:
# My.JDownloader Api failed too.
return False
# My.JDownloader Api failed too we assume a problem with the connection or the api server
# and throw an connection exception.
raise (MYJDConnectionException("No connection established\n"))
else:
# My.JDownloader Api worked, lets refresh the direct connections and return
# the response.
Expand Down Expand Up @@ -781,8 +788,9 @@ def action(self, path, params=(), http_action="POST"):
response = self.myjd.request_api(path, http_action, params,
action_url)
if response is None:
# My.JDownloader Api failed too.
return False
# My.JDownloader Api failed too we assume a problem with the connection or the api server
# and throw an connection exception.
raise (MYJDConnectionException("No connection established\n"))
# My.JDownloader Api worked, lets refresh the direct connections and return
# the response.
self.__refresh_direct_connections()
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
long_description = f.read()
setup(
name='myjdapi',
version='1.0.7',
version='1.1.0',
description='Library to use My.Jdownloader API in an easy way.',
long_description=long_description,
url='https://github.com/mmarquezs/My.Jdownloader-API-Python-Library/',
Expand Down

0 comments on commit e547d07

Please sign in to comment.