Skip to content

Commit

Permalink
Added remove_links to linkgrabber and downloads.
Browse files Browse the repository at this point in the history
  • Loading branch information
mmarquezs committed Dec 18, 2021
1 parent 3cf8e07 commit ffed924
Show file tree
Hide file tree
Showing 3 changed files with 28 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.1.2"
__version__ = "1.1.3"
30 changes: 26 additions & 4 deletions myjdapi/myjdapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,12 +414,19 @@ def get_childrenchanged(self):
"""
pass

def remove_links(self):
def remove_links(self, link_ids = [], package_ids = []):
"""
No idea what parameters i have to pass and/or i don't know what it does.
If i find out i will implement it :P
Remove packages and/or links of the linkgrabber list.
Requires at least a link_ids or package_ids list, or both.
:param link_ids: link UUID's.
:type: list of strings
:param package_ids: Package UUID's.
:type: list of strings.
"""
pass
params = [link_ids, package_ids]
resp = self.device.action(self.url + "/removeLinks", params)
return resp

def get_downfolderhistoryselectbase(self):
"""
Expand Down Expand Up @@ -639,6 +646,21 @@ def set_dl_location(self, directory, package_ids=[]):
params = [directory, package_ids]
resp = self.device.action(self.url + "/setDownloadDirectory", params)
return resp

def remove_links(self, link_ids = [], package_ids = []):
"""
Remove packages and/or links of the downloads list.
NOTE: For more specific removal, like deleting the files etc, use the /cleanup api.
Requires at least a link_ids or package_ids list, or both.
:param link_ids: link UUID's.
:type: list of strings
:param package_ids: Package UUID's.
:type: list of strings.
"""
params = [link_ids, package_ids]
resp = self.device.action(self.url + "/removeLinks", params)
return resp


class Captcha:
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.1.2',
version='1.1.3',
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 ffed924

Please sign in to comment.