Skip to content

Commit ffed924

Browse files
committed
Added remove_links to linkgrabber and downloads.
1 parent 3cf8e07 commit ffed924

File tree

3 files changed

+28
-6
lines changed

3 files changed

+28
-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.1.2"
37+
__version__ = "1.1.3"

myjdapi/myjdapi.py

+26-4
Original file line numberDiff line numberDiff line change
@@ -414,12 +414,19 @@ def get_childrenchanged(self):
414414
"""
415415
pass
416416

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

424431
def get_downfolderhistoryselectbase(self):
425432
"""
@@ -639,6 +646,21 @@ def set_dl_location(self, directory, package_ids=[]):
639646
params = [directory, package_ids]
640647
resp = self.device.action(self.url + "/setDownloadDirectory", params)
641648
return resp
649+
650+
def remove_links(self, link_ids = [], package_ids = []):
651+
"""
652+
Remove packages and/or links of the downloads list.
653+
NOTE: For more specific removal, like deleting the files etc, use the /cleanup api.
654+
Requires at least a link_ids or package_ids list, or both.
655+
656+
:param link_ids: link UUID's.
657+
:type: list of strings
658+
:param package_ids: Package UUID's.
659+
:type: list of strings.
660+
"""
661+
params = [link_ids, package_ids]
662+
resp = self.device.action(self.url + "/removeLinks", params)
663+
return resp
642664

643665

644666
class Captcha:

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.1.2',
14+
version='1.1.3',
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)