diff options
Diffstat (limited to 'module/plugins')
| -rw-r--r-- | module/plugins/container/LinkList.py | 22 | 
1 files changed, 17 insertions, 5 deletions
| diff --git a/module/plugins/container/LinkList.py b/module/plugins/container/LinkList.py index cadf491a9..6352746fd 100644 --- a/module/plugins/container/LinkList.py +++ b/module/plugins/container/LinkList.py @@ -9,8 +9,8 @@ class LinkList(Container):      __version__ = "0.1"      __pattern__ = r"(?!http://).*\.txt"      __description__ = """Read Link Lists in txt format""" -    __author_name__ = ("spoob") -    __author_mail__ = ("spoob@pyload.org") +    __author_name__ = ("spoob", "jeix") +    __author_mail__ = ("spoob@pyload.org", "jeix@hasnomail.com")      def __init__(self, parent):          Container.__init__(self, parent) @@ -19,13 +19,25 @@ class LinkList(Container):          self.read_config()      def proceed(self, linkList, location): -        tmpLinks = []          txt = open(linkList, 'r')          links = txt.readlines() +        packages = {"Parsed links":[],} +        curPack = "Parsed links"          for link in links:              if link != "\n": -                tmpLinks.append(link.replace("\n", "")) +                if link.startswith(";"): +                    continue +                if link.startswith("[") and link.endswith("]\n"): +                    # new package +                    curPack = link[1:-2] +                    packages[curPack] = [] +                    continue +                packages[curPack].append(link.replace("\n", ""))          txt.close() +         +        # empty Parsed links fix +        if len(packages["Parsed links"]) < 1: +            del packages["Parsed links"]          if not self.parent.core.config['general']['debug_mode']:              txt = open(linkList, 'w') @@ -33,4 +45,4 @@ class LinkList(Container):              txt.close()              #@TODO: maybe delete read txt file? -        self.links = tmpLinks +        self.links = packages | 
