We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
MultiUpOrg crypter issue
Hi all,

I tried to download a link from the following url : http://www.multiup.org/fr/download/acc13ec3f1b1214919b55d4a70c16190/Lulu.Vroumette.S1x03_Capitaine.Lulu.avi
When I use the debug mode, here is what I get :

```
18.08.2015 23:55:44 INFO      Decrypting starts: Lulu.Vroumette.S1x03_Capitaine.Lulu.avi
18.08.2015 23:55:44 DEBUG     HOOK UserAgentSwitcher: Use custom user-agent string: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0
18.08.2015 23:55:44 DEBUG     CRYPTER MultiUpOrg[9]: PROCESS URL http://www.multiup.org/en/download/acc13ec3f1b1214919b55d4a70c16190/Lulu.Vroumette.S1x03_Capitaine.Lulu.avi | PLUGIN VERSION 0.04
18.08.2015 23:55:44 INFO      CRYPTER MultiUpOrg[9]: Updating file info...
18.08.2015 23:55:45 DEBUG     CRYPTER MultiUpOrg[9]: File info: {'status': 2, 'url': u'http://www.multiup.org/en/download/acc13ec3f1b1214919b55d4a70c16190/Lulu.Vroumette.S1x03_Capitaine.Lulu.avi', 'size': 0, 'name': u'Lulu.Vroumette.S1x03_Capitaine.Lulu.avi', 'pattern': {'TYPE': u'download', 'N': u'Lulu.Vroumette.S1x03_Capitaine.Lulu.avi'}}
18.08.2015 23:55:45 DEBUG     CRYPTER MultiUpOrg[9]: Previous file info: {}
18.08.2015 23:55:45 INFO      CRYPTER MultiUpOrg[9]: File name: Lulu.Vroumette.S1x03_Capitaine.Lulu.avi
18.08.2015 23:55:45 INFO      CRYPTER MultiUpOrg[9]: File size: Unknown
18.08.2015 23:55:45 INFO      CRYPTER MultiUpOrg[9]: File status: online
18.08.2015 23:55:45 DEBUG     CRYPTER MultiUpOrg[9]: Looking for direct download link...
18.08.2015 23:55:45 DEBUG     CRYPTER MultiUpOrg[9]: Redirect #0 to: http://www.multiup.org/en/download/acc13ec3f1b1214919b55d4a70c16190/Lulu.Vroumette.S1x03_Capitaine.Lulu.avi
18.08.2015 23:55:45 DEBUG     CRYPTER MultiUpOrg[9]: LOAD URL http://www.multiup.org/en/download/acc13ec3f1b1214919b55d4a70c16190/Lulu.Vroumette.S1x03_Capitaine.Lulu.avi | cookies=True | get={} | req=None | decode=True | multipart=False | post={} | ref=True | just_header=True
18.08.2015 23:55:45 ERROR     Decrypting failed: Lulu.Vroumette.S1x03_Capitaine.Lulu.avi | 'MultiUpOrg' object has no attribute 'links'
Traceback (most recent call last):
  File "/home.sav/dl/pyload/module/PluginThread.py", line 363, in run
    self.active.plugin.preprocessing(self)
  File "/home.sav/dl/pyload/.pyload/userplugins/internal/Hoster.py", line 185, in preprocessing
    return self.process(self.pyfile)
  File "/home.sav/dl/pyload/module/plugins/internal/Crypter.py", line 41, in process
    self.decrypt(pyfile)
  File "/home.sav/dl/pyload/module/plugins/internal/SimpleCrypter.py", line 101, in decrypt
    if self.link or self.links or self.urls or self.packages:
AttributeError: 'MultiUpOrg' object has no attribute 'links'
```

I tried to modify a bit the following file "module/plugins/crypter/MultiUpOrg.py" (
version "0.04") but got no success (in particular, when using french, there is no "<h5>DOWNLOAD</h5>" but "<h5>TÉLÉCHARGER</h5>'.
But it's not the cause of the issue as I tried with the "english" version of the url...

Please could you help me ;)

Regards


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `module/plugins/crypter/MultiUpOrg.py`
Content:
```
1 # -*- coding: utf-8 -*-
2 
3 import re
4 import urlparse
5 
6 from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo
7 
8 
9 class MultiUpOrg(SimpleCrypter):
10     __name__    = "MultiUpOrg"
11     __type__    = "crypter"
12     __version__ = "0.04"
13     __status__  = "testing"
14 
15     __pattern__ = r'http://(?:www\.)?multiup\.org/(en|fr)/(?P<TYPE>project|download|miror)/\w+(/\w+)?'
16     __config__  = [("use_premium"       , "bool", "Use premium account if available"   , True),
17                    ("use_subfolder"     , "bool", "Save package to subfolder"          , True),
18                    ("subfolder_per_pack", "bool", "Create a subfolder for each package", True)]
19 
20     __description__ = """MultiUp.org crypter plugin"""
21     __license__     = "GPLv3"
22     __authors__     = [("Walter Purcaro", "vuolter@gmail.com")]
23 
24 
25     NAME_PATTERN = r'<title>.*(?:Project|Projet|ownload|élécharger) (?P<N>.+?) (\(|- )'
26 
27 
28     def get_links(self):
29         m_type = re.match(self.__pattern__, self.pyfile.url).group('TYPE')
30 
31         if m_type == "project":
32             pattern = r'\n(http://www\.multiup\.org/(?:en|fr)/download/.*)'
33         else:
34             pattern = r'style="width:97%;text-align:left".*\n.*href="(.*)"'
35             if m_type == "download":
36                 dl_pattern = r'href="(.*)">.*\n.*<h5>DOWNLOAD</h5>'
37                 miror_page = urlparse.urljoin("http://www.multiup.org/", re.search(dl_pattern, self.html).group(1))
38                 self.html = self.load(miror_page)
39 
40         return re.findall(pattern, self.html)
41 
42 
43 getInfo = create_getInfo(MultiUpOrg)
44
```

Path: `module/plugins/internal/SimpleCrypter.py`
Content:
```
1 # -*- coding: utf-8 -*-
2 
3 import re
4 
5 from module.plugins.internal.Crypter import Crypter
6 from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, replace_patterns, set_cookie, set_cookies
7 from module.utils import fixup, html_unescape
8 
9 
10 class SimpleCrypter(Crypter, SimpleHoster):
11     __name__    = "SimpleCrypter"
12     __type__    = "crypter"
13     __version__ = "0.60"
14     __status__  = "testing"
15 
16     __pattern__ = r'^unmatchable$'
17     __config__  = [("use_subfolder"     , "bool", "Save package to subfolder"          , True),  #: Overrides pyload.config['general']['folder_per_package']
18                    ("subfolder_per_pack", "bool", "Create a subfolder for each package", True)]
19 
20     __description__ = """Simple decrypter plugin"""
21     __license__     = "GPLv3"
22     __authors__     = [("Walter Purcaro", "vuolter@gmail.com")]
23 
24     """
25     Following patterns should be defined by each crypter:
26 
27       LINK_PATTERN: Download link or regex to catch links in group(1)
28         example: LINK_PATTERN = r'<div class="link"><a href="(.+?)"'
29 
30       NAME_PATTERN: (optional) folder name or page title
31         example: NAME_PATTERN = r'<title>Files of: (?P<N>[^<]+) folder</title>'
32 
33       OFFLINE_PATTERN: (optional) Checks if the page is unreachable
34         example: OFFLINE_PATTERN = r'File (deleted|not found)'
35 
36       TEMP_OFFLINE_PATTERN: (optional) Checks if the page is temporarily unreachable
37         example: TEMP_OFFLINE_PATTERN = r'Server maintainance'
38 
39 
40     You can override the getLinks method if you need a more sophisticated way to extract the links.
41 
42 
43     If the links are splitted on multiple pages you can define the PAGES_PATTERN regex:
44 
45       PAGES_PATTERN: (optional) group(1) should be the number of overall pages containing the links
46         example: PAGES_PATTERN = r'Pages: (\d+)'
47 
48     and its loadPage method:
49 
50 
51       def load_page(self, page_n):
52           return the html of the page number page_n
53     """
54 
55     DIRECT_LINK  = True
56     LEECH_HOSTER = False
57 
58 
59     #@TODO: Remove in 0.4.10
60     def _setup(self):
61         orig_name = self.__name__
62         self.__name__ = (orig_name + ".py").replace("Folder.py", "").replace(".py", "")
63 
64         super(SimpleCrypter, self)._setup()
65 
66         self.__name__ = orig_name
67 
68 
69     #@TODO: Remove in 0.4.10
70     def load_account(self):
71         orig_name = self.__name__
72         self.__name__ = (orig_name + ".py").replace("Folder.py", "").replace(".py", "")
73 
74         super(SimpleCrypter, self).load_account()
75 
76         self.__name__ = orig_name
77 
78 
79     def handle_direct(self, pyfile):
80         for i in xrange(self.get_config("maxredirs", plugin="UserAgentSwitcher")):
81             redirect = self.link or pyfile.url
82             self.log_debug("Redirect #%d to: %s" % (i, redirect))
83 
84             header = self.load(redirect, just_header=True)
85             if 'location' in header and header['location']:
86                 self.link = header['location']
87             else:
88                 break
89         else:
90             self.log_error(_("Too many redirects"))
91 
92 
93     def decrypt(self, pyfile):
94         self.prepare()
95         self.check_info()  #@TODO: Remove in 0.4.10
96 
97         if self.direct_dl:
98             self.log_debug(_("Looking for direct download link..."))
99             self.handle_direct(pyfile)
100 
101             if self.link or self.links or self.urls or self.packages:
102                 self.log_info(_("Direct download link detected"))
103             else:
104                 self.log_info(_("Direct download link not found"))
105 
106         if not (self.link or self.links or self.urls or self.packages):
107             self.preload()
108 
109             self.links = self.get_links() or list()
110 
111             if hasattr(self, 'PAGES_PATTERN') and hasattr(self, 'loadPage'):
112                 self.handle_pages(pyfile)
113 
114             self.log_debug("Package has %d links" % len(self.links))
115 
116         if self.link:
117             self.urls.append(self.link)
118 
119         if self.links:
120             name = folder = pyfile.name
121             self.packages.append((name, self.links, folder))
122 
123 
124     def get_links(self):
125         """
126         Returns the links extracted from self.html
127         You should override this only if it's impossible to extract links using only the LINK_PATTERN.
128         """
129         return re.findall(self.LINK_PATTERN, self.html)
130 
131 
132     def handle_pages(self, pyfile):
133         try:
134             pages = int(re.search(self.PAGES_PATTERN, self.html).group(1))
135         except Exception:
136             pages = 1
137 
138         for p in xrange(2, pages + 1):
139             self.html = self.load_page(p)
140             self.links += self.get_links()
141
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/module/plugins/crypter/MultiUpOrg.py b/module/plugins/crypter/MultiUpOrg.py
--- a/module/plugins/crypter/MultiUpOrg.py
+++ b/module/plugins/crypter/MultiUpOrg.py
@@ -9,10 +9,10 @@
 class MultiUpOrg(SimpleCrypter):
     __name__    = "MultiUpOrg"
     __type__    = "crypter"
-    __version__ = "0.04"
+    __version__ = "0.05"
     __status__  = "testing"
 
-    __pattern__ = r'http://(?:www\.)?multiup\.org/(en|fr)/(?P<TYPE>project|download|miror)/\w+(/\w+)?'
+    __pattern__ = r'http://(?:www\.)?multiup\.org/(en|fr)/(?P<TYPE>project|download|mirror)/\w+(/\w+)?'
     __config__  = [("use_premium"       , "bool", "Use premium account if available"   , True),
                    ("use_subfolder"     , "bool", "Save package to subfolder"          , True),
                    ("subfolder_per_pack", "bool", "Create a subfolder for each package", True)]
@@ -34,8 +34,8 @@
             pattern = r'style="width:97%;text-align:left".*\n.*href="(.*)"'
             if m_type == "download":
                 dl_pattern = r'href="(.*)">.*\n.*<h5>DOWNLOAD</h5>'
-                miror_page = urlparse.urljoin("http://www.multiup.org/", re.search(dl_pattern, self.html).group(1))
-                self.html = self.load(miror_page)
+                mirror_page = urlparse.urljoin("http://www.multiup.org/", re.search(dl_pattern, self.html).group(1))
+                self.html = self.load(mirror_page)
 
         return re.findall(pattern, self.html)
 
diff --git a/module/plugins/internal/SimpleCrypter.py b/module/plugins/internal/SimpleCrypter.py
--- a/module/plugins/internal/SimpleCrypter.py
+++ b/module/plugins/internal/SimpleCrypter.py
@@ -10,7 +10,7 @@
 class SimpleCrypter(Crypter, SimpleHoster):
     __name__    = "SimpleCrypter"
     __type__    = "crypter"
-    __version__ = "0.60"
+    __version__ = "0.61"
     __status__  = "testing"
 
     __pattern__ = r'^unmatchable$'
@@ -91,6 +91,7 @@
 
 
     def decrypt(self, pyfile):
+        self.links = []    #@TODO: Recheck in 0.4.10
         self.prepare()
         self.check_info()  #@TODO: Remove in 0.4.10

{"golden_diff": "diff --git a/module/plugins/crypter/MultiUpOrg.py b/module/plugins/crypter/MultiUpOrg.py\n--- a/module/plugins/crypter/MultiUpOrg.py\n+++ b/module/plugins/crypter/MultiUpOrg.py\n@@ -9,10 +9,10 @@\n class MultiUpOrg(SimpleCrypter):\n     __name__    = \"MultiUpOrg\"\n     __type__    = \"crypter\"\n-    __version__ = \"0.04\"\n+    __version__ = \"0.05\"\n     __status__  = \"testing\"\n \n-    __pattern__ = r'http://(?:www\\.)?multiup\\.org/(en|fr)/(?P<TYPE>project|download|miror)/\\w+(/\\w+)?'\n+    __pattern__ = r'http://(?:www\\.)?multiup\\.org/(en|fr)/(?P<TYPE>project|download|mirror)/\\w+(/\\w+)?'\n     __config__  = [(\"use_premium\"       , \"bool\", \"Use premium account if available\"   , True),\n                    (\"use_subfolder\"     , \"bool\", \"Save package to subfolder\"          , True),\n                    (\"subfolder_per_pack\", \"bool\", \"Create a subfolder for each package\", True)]\n@@ -34,8 +34,8 @@\n             pattern = r'style=\"width:97%;text-align:left\".*\\n.*href=\"(.*)\"'\n             if m_type == \"download\":\n                 dl_pattern = r'href=\"(.*)\">.*\\n.*<h5>DOWNLOAD</h5>'\n-                miror_page = urlparse.urljoin(\"http://www.multiup.org/\", re.search(dl_pattern, self.html).group(1))\n-                self.html = self.load(miror_page)\n+                mirror_page = urlparse.urljoin(\"http://www.multiup.org/\", re.search(dl_pattern, self.html).group(1))\n+                self.html = self.load(mirror_page)\n \n         return re.findall(pattern, self.html)\n \ndiff --git a/module/plugins/internal/SimpleCrypter.py b/module/plugins/internal/SimpleCrypter.py\n--- a/module/plugins/internal/SimpleCrypter.py\n+++ b/module/plugins/internal/SimpleCrypter.py\n@@ -10,7 +10,7 @@\n class SimpleCrypter(Crypter, SimpleHoster):\n     __name__    = \"SimpleCrypter\"\n     __type__    = \"crypter\"\n-    __version__ = \"0.60\"\n+    __version__ = \"0.61\"\n     __status__  = \"testing\"\n \n     __pattern__ = r'^unmatchable$'\n@@ -91,6 +91,7 @@\n \n \n     def decrypt(self, pyfile):\n+        self.links = []    #@TODO: Recheck in 0.4.10\n         self.prepare()\n         self.check_info()  #@TODO: Remove in 0.4.10\n", "issue": "MultiUpOrg crypter issue\nHi all,\n\nI tried to download a link from the following url : http://www.multiup.org/fr/download/acc13ec3f1b1214919b55d4a70c16190/Lulu.Vroumette.S1x03_Capitaine.Lulu.avi\nWhen I use the debug mode, here is what I get :\n\n```\n18.08.2015 23:55:44 INFO      Decrypting starts: Lulu.Vroumette.S1x03_Capitaine.Lulu.avi\n18.08.2015 23:55:44 DEBUG     HOOK UserAgentSwitcher: Use custom user-agent string: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0\n18.08.2015 23:55:44 DEBUG     CRYPTER MultiUpOrg[9]: PROCESS URL http://www.multiup.org/en/download/acc13ec3f1b1214919b55d4a70c16190/Lulu.Vroumette.S1x03_Capitaine.Lulu.avi | PLUGIN VERSION 0.04\n18.08.2015 23:55:44 INFO      CRYPTER MultiUpOrg[9]: Updating file info...\n18.08.2015 23:55:45 DEBUG     CRYPTER MultiUpOrg[9]: File info: {'status': 2, 'url': u'http://www.multiup.org/en/download/acc13ec3f1b1214919b55d4a70c16190/Lulu.Vroumette.S1x03_Capitaine.Lulu.avi', 'size': 0, 'name': u'Lulu.Vroumette.S1x03_Capitaine.Lulu.avi', 'pattern': {'TYPE': u'download', 'N': u'Lulu.Vroumette.S1x03_Capitaine.Lulu.avi'}}\n18.08.2015 23:55:45 DEBUG     CRYPTER MultiUpOrg[9]: Previous file info: {}\n18.08.2015 23:55:45 INFO      CRYPTER MultiUpOrg[9]: File name: Lulu.Vroumette.S1x03_Capitaine.Lulu.avi\n18.08.2015 23:55:45 INFO      CRYPTER MultiUpOrg[9]: File size: Unknown\n18.08.2015 23:55:45 INFO      CRYPTER MultiUpOrg[9]: File status: online\n18.08.2015 23:55:45 DEBUG     CRYPTER MultiUpOrg[9]: Looking for direct download link...\n18.08.2015 23:55:45 DEBUG     CRYPTER MultiUpOrg[9]: Redirect #0 to: http://www.multiup.org/en/download/acc13ec3f1b1214919b55d4a70c16190/Lulu.Vroumette.S1x03_Capitaine.Lulu.avi\n18.08.2015 23:55:45 DEBUG     CRYPTER MultiUpOrg[9]: LOAD URL http://www.multiup.org/en/download/acc13ec3f1b1214919b55d4a70c16190/Lulu.Vroumette.S1x03_Capitaine.Lulu.avi | cookies=True | get={} | req=None | decode=True | multipart=False | post={} | ref=True | just_header=True\n18.08.2015 23:55:45 ERROR     Decrypting failed: Lulu.Vroumette.S1x03_Capitaine.Lulu.avi | 'MultiUpOrg' object has no attribute 'links'\nTraceback (most recent call last):\n  File \"/home.sav/dl/pyload/module/PluginThread.py\", line 363, in run\n    self.active.plugin.preprocessing(self)\n  File \"/home.sav/dl/pyload/.pyload/userplugins/internal/Hoster.py\", line 185, in preprocessing\n    return self.process(self.pyfile)\n  File \"/home.sav/dl/pyload/module/plugins/internal/Crypter.py\", line 41, in process\n    self.decrypt(pyfile)\n  File \"/home.sav/dl/pyload/module/plugins/internal/SimpleCrypter.py\", line 101, in decrypt\n    if self.link or self.links or self.urls or self.packages:\nAttributeError: 'MultiUpOrg' object has no attribute 'links'\n```\n\nI tried to modify a bit the following file \"module/plugins/crypter/MultiUpOrg.py\" (\nversion \"0.04\") but got no success (in particular, when using french, there is no \"<h5>DOWNLOAD</h5>\" but \"<h5>T\u00c9L\u00c9CHARGER</h5>'.\nBut it's not the cause of the issue as I tried with the \"english\" version of the url...\n\nPlease could you help me ;)\n\nRegards\n\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n\nimport re\nimport urlparse\n\nfrom module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo\n\n\nclass MultiUpOrg(SimpleCrypter):\n    __name__    = \"MultiUpOrg\"\n    __type__    = \"crypter\"\n    __version__ = \"0.04\"\n    __status__  = \"testing\"\n\n    __pattern__ = r'http://(?:www\\.)?multiup\\.org/(en|fr)/(?P<TYPE>project|download|miror)/\\w+(/\\w+)?'\n    __config__  = [(\"use_premium\"       , \"bool\", \"Use premium account if available\"   , True),\n                   (\"use_subfolder\"     , \"bool\", \"Save package to subfolder\"          , True),\n                   (\"subfolder_per_pack\", \"bool\", \"Create a subfolder for each package\", True)]\n\n    __description__ = \"\"\"MultiUp.org crypter plugin\"\"\"\n    __license__     = \"GPLv3\"\n    __authors__     = [(\"Walter Purcaro\", \"vuolter@gmail.com\")]\n\n\n    NAME_PATTERN = r'<title>.*(?:Project|Projet|ownload|\u00e9l\u00e9charger) (?P<N>.+?) (\\(|- )'\n\n\n    def get_links(self):\n        m_type = re.match(self.__pattern__, self.pyfile.url).group('TYPE')\n\n        if m_type == \"project\":\n            pattern = r'\\n(http://www\\.multiup\\.org/(?:en|fr)/download/.*)'\n        else:\n            pattern = r'style=\"width:97%;text-align:left\".*\\n.*href=\"(.*)\"'\n            if m_type == \"download\":\n                dl_pattern = r'href=\"(.*)\">.*\\n.*<h5>DOWNLOAD</h5>'\n                miror_page = urlparse.urljoin(\"http://www.multiup.org/\", re.search(dl_pattern, self.html).group(1))\n                self.html = self.load(miror_page)\n\n        return re.findall(pattern, self.html)\n\n\ngetInfo = create_getInfo(MultiUpOrg)\n", "path": "module/plugins/crypter/MultiUpOrg.py"}, {"content": "# -*- coding: utf-8 -*-\n\nimport re\n\nfrom module.plugins.internal.Crypter import Crypter\nfrom module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, replace_patterns, set_cookie, set_cookies\nfrom module.utils import fixup, html_unescape\n\n\nclass SimpleCrypter(Crypter, SimpleHoster):\n    __name__    = \"SimpleCrypter\"\n    __type__    = \"crypter\"\n    __version__ = \"0.60\"\n    __status__  = \"testing\"\n\n    __pattern__ = r'^unmatchable$'\n    __config__  = [(\"use_subfolder\"     , \"bool\", \"Save package to subfolder\"          , True),  #: Overrides pyload.config['general']['folder_per_package']\n                   (\"subfolder_per_pack\", \"bool\", \"Create a subfolder for each package\", True)]\n\n    __description__ = \"\"\"Simple decrypter plugin\"\"\"\n    __license__     = \"GPLv3\"\n    __authors__     = [(\"Walter Purcaro\", \"vuolter@gmail.com\")]\n\n    \"\"\"\n    Following patterns should be defined by each crypter:\n\n      LINK_PATTERN: Download link or regex to catch links in group(1)\n        example: LINK_PATTERN = r'<div class=\"link\"><a href=\"(.+?)\"'\n\n      NAME_PATTERN: (optional) folder name or page title\n        example: NAME_PATTERN = r'<title>Files of: (?P<N>[^<]+) folder</title>'\n\n      OFFLINE_PATTERN: (optional) Checks if the page is unreachable\n        example: OFFLINE_PATTERN = r'File (deleted|not found)'\n\n      TEMP_OFFLINE_PATTERN: (optional) Checks if the page is temporarily unreachable\n        example: TEMP_OFFLINE_PATTERN = r'Server maintainance'\n\n\n    You can override the getLinks method if you need a more sophisticated way to extract the links.\n\n\n    If the links are splitted on multiple pages you can define the PAGES_PATTERN regex:\n\n      PAGES_PATTERN: (optional) group(1) should be the number of overall pages containing the links\n        example: PAGES_PATTERN = r'Pages: (\\d+)'\n\n    and its loadPage method:\n\n\n      def load_page(self, page_n):\n          return the html of the page number page_n\n    \"\"\"\n\n    DIRECT_LINK  = True\n    LEECH_HOSTER = False\n\n\n    #@TODO: Remove in 0.4.10\n    def _setup(self):\n        orig_name = self.__name__\n        self.__name__ = (orig_name + \".py\").replace(\"Folder.py\", \"\").replace(\".py\", \"\")\n\n        super(SimpleCrypter, self)._setup()\n\n        self.__name__ = orig_name\n\n\n    #@TODO: Remove in 0.4.10\n    def load_account(self):\n        orig_name = self.__name__\n        self.__name__ = (orig_name + \".py\").replace(\"Folder.py\", \"\").replace(\".py\", \"\")\n\n        super(SimpleCrypter, self).load_account()\n\n        self.__name__ = orig_name\n\n\n    def handle_direct(self, pyfile):\n        for i in xrange(self.get_config(\"maxredirs\", plugin=\"UserAgentSwitcher\")):\n            redirect = self.link or pyfile.url\n            self.log_debug(\"Redirect #%d to: %s\" % (i, redirect))\n\n            header = self.load(redirect, just_header=True)\n            if 'location' in header and header['location']:\n                self.link = header['location']\n            else:\n                break\n        else:\n            self.log_error(_(\"Too many redirects\"))\n\n\n    def decrypt(self, pyfile):\n        self.prepare()\n        self.check_info()  #@TODO: Remove in 0.4.10\n\n        if self.direct_dl:\n            self.log_debug(_(\"Looking for direct download link...\"))\n            self.handle_direct(pyfile)\n\n            if self.link or self.links or self.urls or self.packages:\n                self.log_info(_(\"Direct download link detected\"))\n            else:\n                self.log_info(_(\"Direct download link not found\"))\n\n        if not (self.link or self.links or self.urls or self.packages):\n            self.preload()\n\n            self.links = self.get_links() or list()\n\n            if hasattr(self, 'PAGES_PATTERN') and hasattr(self, 'loadPage'):\n                self.handle_pages(pyfile)\n\n            self.log_debug(\"Package has %d links\" % len(self.links))\n\n        if self.link:\n            self.urls.append(self.link)\n\n        if self.links:\n            name = folder = pyfile.name\n            self.packages.append((name, self.links, folder))\n\n\n    def get_links(self):\n        \"\"\"\n        Returns the links extracted from self.html\n        You should override this only if it's impossible to extract links using only the LINK_PATTERN.\n        \"\"\"\n        return re.findall(self.LINK_PATTERN, self.html)\n\n\n    def handle_pages(self, pyfile):\n        try:\n            pages = int(re.search(self.PAGES_PATTERN, self.html).group(1))\n        except Exception:\n            pages = 1\n\n        for p in xrange(2, pages + 1):\n            self.html = self.load_page(p)\n            self.links += self.get_links()\n", "path": "module/plugins/internal/SimpleCrypter.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\n\nimport re\nimport urlparse\n\nfrom module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo\n\n\nclass MultiUpOrg(SimpleCrypter):\n    __name__    = \"MultiUpOrg\"\n    __type__    = \"crypter\"\n    __version__ = \"0.05\"\n    __status__  = \"testing\"\n\n    __pattern__ = r'http://(?:www\\.)?multiup\\.org/(en|fr)/(?P<TYPE>project|download|mirror)/\\w+(/\\w+)?'\n    __config__  = [(\"use_premium\"       , \"bool\", \"Use premium account if available\"   , True),\n                   (\"use_subfolder\"     , \"bool\", \"Save package to subfolder\"          , True),\n                   (\"subfolder_per_pack\", \"bool\", \"Create a subfolder for each package\", True)]\n\n    __description__ = \"\"\"MultiUp.org crypter plugin\"\"\"\n    __license__     = \"GPLv3\"\n    __authors__     = [(\"Walter Purcaro\", \"vuolter@gmail.com\")]\n\n\n    NAME_PATTERN = r'<title>.*(?:Project|Projet|ownload|\u00e9l\u00e9charger) (?P<N>.+?) (\\(|- )'\n\n\n    def get_links(self):\n        m_type = re.match(self.__pattern__, self.pyfile.url).group('TYPE')\n\n        if m_type == \"project\":\n            pattern = r'\\n(http://www\\.multiup\\.org/(?:en|fr)/download/.*)'\n        else:\n            pattern = r'style=\"width:97%;text-align:left\".*\\n.*href=\"(.*)\"'\n            if m_type == \"download\":\n                dl_pattern = r'href=\"(.*)\">.*\\n.*<h5>DOWNLOAD</h5>'\n                mirror_page = urlparse.urljoin(\"http://www.multiup.org/\", re.search(dl_pattern, self.html).group(1))\n                self.html = self.load(mirror_page)\n\n        return re.findall(pattern, self.html)\n\n\ngetInfo = create_getInfo(MultiUpOrg)\n", "path": "module/plugins/crypter/MultiUpOrg.py"}, {"content": "# -*- coding: utf-8 -*-\n\nimport re\n\nfrom module.plugins.internal.Crypter import Crypter\nfrom module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, replace_patterns, set_cookie, set_cookies\nfrom module.utils import fixup, html_unescape\n\n\nclass SimpleCrypter(Crypter, SimpleHoster):\n    __name__    = \"SimpleCrypter\"\n    __type__    = \"crypter\"\n    __version__ = \"0.61\"\n    __status__  = \"testing\"\n\n    __pattern__ = r'^unmatchable$'\n    __config__  = [(\"use_subfolder\"     , \"bool\", \"Save package to subfolder\"          , True),  #: Overrides pyload.config['general']['folder_per_package']\n                   (\"subfolder_per_pack\", \"bool\", \"Create a subfolder for each package\", True)]\n\n    __description__ = \"\"\"Simple decrypter plugin\"\"\"\n    __license__     = \"GPLv3\"\n    __authors__     = [(\"Walter Purcaro\", \"vuolter@gmail.com\")]\n\n    \"\"\"\n    Following patterns should be defined by each crypter:\n\n      LINK_PATTERN: Download link or regex to catch links in group(1)\n        example: LINK_PATTERN = r'<div class=\"link\"><a href=\"(.+?)\"'\n\n      NAME_PATTERN: (optional) folder name or page title\n        example: NAME_PATTERN = r'<title>Files of: (?P<N>[^<]+) folder</title>'\n\n      OFFLINE_PATTERN: (optional) Checks if the page is unreachable\n        example: OFFLINE_PATTERN = r'File (deleted|not found)'\n\n      TEMP_OFFLINE_PATTERN: (optional) Checks if the page is temporarily unreachable\n        example: TEMP_OFFLINE_PATTERN = r'Server maintainance'\n\n\n    You can override the getLinks method if you need a more sophisticated way to extract the links.\n\n\n    If the links are splitted on multiple pages you can define the PAGES_PATTERN regex:\n\n      PAGES_PATTERN: (optional) group(1) should be the number of overall pages containing the links\n        example: PAGES_PATTERN = r'Pages: (\\d+)'\n\n    and its loadPage method:\n\n\n      def load_page(self, page_n):\n          return the html of the page number page_n\n    \"\"\"\n\n    DIRECT_LINK  = True\n    LEECH_HOSTER = False\n\n\n    #@TODO: Remove in 0.4.10\n    def _setup(self):\n        orig_name = self.__name__\n        self.__name__ = (orig_name + \".py\").replace(\"Folder.py\", \"\").replace(\".py\", \"\")\n\n        super(SimpleCrypter, self)._setup()\n\n        self.__name__ = orig_name\n\n\n    #@TODO: Remove in 0.4.10\n    def load_account(self):\n        orig_name = self.__name__\n        self.__name__ = (orig_name + \".py\").replace(\"Folder.py\", \"\").replace(\".py\", \"\")\n\n        super(SimpleCrypter, self).load_account()\n\n        self.__name__ = orig_name\n\n\n    def handle_direct(self, pyfile):\n        for i in xrange(self.get_config(\"maxredirs\", plugin=\"UserAgentSwitcher\")):\n            redirect = self.link or pyfile.url\n            self.log_debug(\"Redirect #%d to: %s\" % (i, redirect))\n\n            header = self.load(redirect, just_header=True)\n            if 'location' in header and header['location']:\n                self.link = header['location']\n            else:\n                break\n        else:\n            self.log_error(_(\"Too many redirects\"))\n\n\n    def decrypt(self, pyfile):\n        self.links = []    #@TODO: Recheck in 0.4.10\n        self.prepare()\n        self.check_info()  #@TODO: Remove in 0.4.10\n\n        if self.direct_dl:\n            self.log_debug(_(\"Looking for direct download link...\"))\n            self.handle_direct(pyfile)\n\n            if self.link or self.links or self.urls or self.packages:\n                self.log_info(_(\"Direct download link detected\"))\n            else:\n                self.log_info(_(\"Direct download link not found\"))\n\n        if not (self.link or self.links or self.urls or self.packages):\n            self.preload()\n\n            self.links = self.get_links() or list()\n\n            if hasattr(self, 'PAGES_PATTERN') and hasattr(self, 'loadPage'):\n                self.handle_pages(pyfile)\n\n            self.log_debug(\"Package has %d links\" % len(self.links))\n\n        if self.link:\n            self.urls.append(self.link)\n\n        if self.links:\n            name = folder = pyfile.name\n            self.packages.append((name, self.links, folder))\n\n\n    def get_links(self):\n        \"\"\"\n        Returns the links extracted from self.html\n        You should override this only if it's impossible to extract links using only the LINK_PATTERN.\n        \"\"\"\n        return re.findall(self.LINK_PATTERN, self.html)\n\n\n    def handle_pages(self, pyfile):\n        try:\n            pages = int(re.search(self.PAGES_PATTERN, self.html).group(1))\n        except Exception:\n            pages = 1\n\n        for p in xrange(2, pages + 1):\n            self.html = self.load_page(p)\n            self.links += self.get_links()\n", "path": "module/plugins/internal/SimpleCrypter.py"}]}