prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Uplea plugin out of date
  Hi,
  any download from uplea.com fails:
  pyLoad reports success on downloading but actually only the HTML page giving acces to download is downloaded...
  
  
  </issue>
  <code>
  [start of module/plugins/hoster/UpleaCom.py]
  1 # -*- coding: utf-8 -*-
  2 
  3 import re
  4 
  5 from urlparse import urljoin
  6 
  7 from module.plugins.internal.XFSHoster import XFSHoster, create_getInfo
  8 
  9 
  10 class UpleaCom(XFSHoster):
  11     __name__    = "UpleaCom"
  12     __type__    = "hoster"
  13     __version__ = "0.06"
  14 
  15     __pattern__ = r'https?://(?:www\.)?uplea\.com/dl/\w{15}'
  16 
  17     __description__ = """Uplea.com hoster plugin"""
  18     __license__     = "GPLv3"
  19     __authors__     = [("Redleon", None)]
  20 
  21 
  22     NAME_PATTERN = r'class="agmd size18">(?P<N>.+?)<'
  23     SIZE_PATTERN = r'size14">(?P<S>[\d.,]+) (?P<U>[\w^_])</span>'
  24 
  25     OFFLINE_PATTERN = r'>You followed an invalid or expired link'
  26 
  27     LINK_PATTERN = r'"(http?://\w+\.uplea\.com/anonym/.*?)"'
  28 
  29     WAIT_PATTERN = r'timeText:([\d.]+),'
  30     STEP_PATTERN = r'<a href="(/step/.+)">'
  31 
  32 
  33     def setup(self):
  34         self.multiDL = False
  35         self.chunkLimit = 1
  36         self.resumeDownload = True
  37 
  38 
  39     def handleFree(self, pyfile):
  40         m = re.search(self.STEP_PATTERN, self.html)
  41         if m is None:
  42             self.error(_("STEP_PATTERN not found"))
  43 
  44         self.html = self.load(urljoin("http://uplea.com/", m.group(1)))
  45 
  46         m = re.search(self.WAIT_PATTERN, self.html)
  47         if m:
  48             self.wait(m.group(1), True)
  49             self.retry()
  50 
  51         m = re.search(self.LINK_PATTERN, self.html)
  52         if m is None:
  53             self.error(_("LINK_PATTERN not found"))
  54 
  55         self.link = m.group(1)
  56         self.wait(15)
  57 
  58 
  59 getInfo = create_getInfo(UpleaCom)
  60
  [end of module/plugins/hoster/UpleaCom.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/module/plugins/hoster/UpleaCom.py b/module/plugins/hoster/UpleaCom.py
  --- a/module/plugins/hoster/UpleaCom.py
  +++ b/module/plugins/hoster/UpleaCom.py
  @@ -10,23 +10,26 @@
   class UpleaCom(XFSHoster):
       __name__    = "UpleaCom"
       __type__    = "hoster"
  -    __version__ = "0.06"
  +    __version__ = "0.07"
   
       __pattern__ = r'https?://(?:www\.)?uplea\.com/dl/\w{15}'
   
       __description__ = """Uplea.com hoster plugin"""
       __license__     = "GPLv3"
  -    __authors__     = [("Redleon", None)]
  +    __authors__     = [("Redleon", None),
  +                       ("GammaC0de", None)]
   
   
       NAME_PATTERN = r'class="agmd size18">(?P<N>.+?)<'
  -    SIZE_PATTERN = r'size14">(?P<S>[\d.,]+) (?P<U>[\w^_])</span>'
  +    SIZE_PATTERN = r'size14">(?P<S>[\d.,]+) (?P<U>[\w^_]+?)</span>'
  +    SIZE_REPLACEMENTS = [('Ko','KB'), ('Mo','MB'), ('Go','GB')]
   
       OFFLINE_PATTERN = r'>You followed an invalid or expired link'
  +    PREMIUM_PATTERN = r'You need to have a Premium subscription to download this file'
   
  -    LINK_PATTERN = r'"(http?://\w+\.uplea\.com/anonym/.*?)"'
  +    LINK_PATTERN = r'"(https?://\w+\.uplea\.com/anonym/.*?)"'
   
  -    WAIT_PATTERN = r'timeText:([\d.]+),'
  +    WAIT_PATTERN = r'timeText: ?([\d.]+),'
       STEP_PATTERN = r'<a href="(/step/.+)">'
   
   
  @@ -45,9 +48,14 @@
   
           m = re.search(self.WAIT_PATTERN, self.html)
           if m:
  +            self.logDebug(_("Waiting %s seconds") % m.group(1))
               self.wait(m.group(1), True)
               self.retry()
   
  +        m = re.search(self.PREMIUM_PATTERN, self.html)
  +        if m:
  +            self.error(_("This URL requires a premium account"))
  +
           m = re.search(self.LINK_PATTERN, self.html)
           if m is None:
               self.error(_("LINK_PATTERN not found"))
  
verification_info: {"golden_diff": "diff --git a/module/plugins/hoster/UpleaCom.py b/module/plugins/hoster/UpleaCom.py\n--- a/module/plugins/hoster/UpleaCom.py\n+++ b/module/plugins/hoster/UpleaCom.py\n@@ -10,23 +10,26 @@\n class UpleaCom(XFSHoster):\n     __name__    = \"UpleaCom\"\n     __type__    = \"hoster\"\n-    __version__ = \"0.06\"\n+    __version__ = \"0.07\"\n \n     __pattern__ = r'https?://(?:www\\.)?uplea\\.com/dl/\\w{15}'\n \n     __description__ = \"\"\"Uplea.com hoster plugin\"\"\"\n     __license__     = \"GPLv3\"\n-    __authors__     = [(\"Redleon\", None)]\n+    __authors__     = [(\"Redleon\", None),\n+                       (\"GammaC0de\", None)]\n \n \n     NAME_PATTERN = r'class=\"agmd size18\">(?P<N>.+?)<'\n-    SIZE_PATTERN = r'size14\">(?P<S>[\\d.,]+) (?P<U>[\\w^_])</span>'\n+    SIZE_PATTERN = r'size14\">(?P<S>[\\d.,]+) (?P<U>[\\w^_]+?)</span>'\n+    SIZE_REPLACEMENTS = [('Ko','KB'), ('Mo','MB'), ('Go','GB')]\n \n     OFFLINE_PATTERN = r'>You followed an invalid or expired link'\n+    PREMIUM_PATTERN = r'You need to have a Premium subscription to download this file'\n \n-    LINK_PATTERN = r'\"(http?://\\w+\\.uplea\\.com/anonym/.*?)\"'\n+    LINK_PATTERN = r'\"(https?://\\w+\\.uplea\\.com/anonym/.*?)\"'\n \n-    WAIT_PATTERN = r'timeText:([\\d.]+),'\n+    WAIT_PATTERN = r'timeText: ?([\\d.]+),'\n     STEP_PATTERN = r'<a href=\"(/step/.+)\">'\n \n \n@@ -45,9 +48,14 @@\n \n         m = re.search(self.WAIT_PATTERN, self.html)\n         if m:\n+            self.logDebug(_(\"Waiting %s seconds\") % m.group(1))\n             self.wait(m.group(1), True)\n             self.retry()\n \n+        m = re.search(self.PREMIUM_PATTERN, self.html)\n+        if m:\n+            self.error(_(\"This URL requires a premium account\"))\n+\n         m = re.search(self.LINK_PATTERN, self.html)\n         if m is None:\n             self.error(_(\"LINK_PATTERN not found\"))\n", "issue": "Uplea plugin out of date\nHi,\nany download from uplea.com fails:\npyLoad reports success on downloading but actually only the HTML page giving acces to download is downloaded...\n\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n\nimport re\n\nfrom urlparse import urljoin\n\nfrom module.plugins.internal.XFSHoster import XFSHoster, create_getInfo\n\n\nclass UpleaCom(XFSHoster):\n    __name__    = \"UpleaCom\"\n    __type__    = \"hoster\"\n    __version__ = \"0.06\"\n\n    __pattern__ = r'https?://(?:www\\.)?uplea\\.com/dl/\\w{15}'\n\n    __description__ = \"\"\"Uplea.com hoster plugin\"\"\"\n    __license__     = \"GPLv3\"\n    __authors__     = [(\"Redleon\", None)]\n\n\n    NAME_PATTERN = r'class=\"agmd size18\">(?P<N>.+?)<'\n    SIZE_PATTERN = r'size14\">(?P<S>[\\d.,]+) (?P<U>[\\w^_])</span>'\n\n    OFFLINE_PATTERN = r'>You followed an invalid or expired link'\n\n    LINK_PATTERN = r'\"(http?://\\w+\\.uplea\\.com/anonym/.*?)\"'\n\n    WAIT_PATTERN = r'timeText:([\\d.]+),'\n    STEP_PATTERN = r'<a href=\"(/step/.+)\">'\n\n\n    def setup(self):\n        self.multiDL = False\n        self.chunkLimit = 1\n        self.resumeDownload = True\n\n\n    def handleFree(self, pyfile):\n        m = re.search(self.STEP_PATTERN, self.html)\n        if m is None:\n            self.error(_(\"STEP_PATTERN not found\"))\n\n        self.html = self.load(urljoin(\"http://uplea.com/\", m.group(1)))\n\n        m = re.search(self.WAIT_PATTERN, self.html)\n        if m:\n            self.wait(m.group(1), True)\n            self.retry()\n\n        m = re.search(self.LINK_PATTERN, self.html)\n        if m is None:\n            self.error(_(\"LINK_PATTERN not found\"))\n\n        self.link = m.group(1)\n        self.wait(15)\n\n\ngetInfo = create_getInfo(UpleaCom)\n", "path": "module/plugins/hoster/UpleaCom.py"}]}