prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  FourChanOrg don't work
  When i try to download a thread (e.g. http://boards.4chan.org/wg/res/5176429) nothing happens, only BasePlugin will be used,
  
  
  </issue>
  <code>
  [start of module/plugins/crypter/FourChanOrg.py]
  1 #!/usr/bin/env python
  2 # -*- coding: utf-8 -*-
  3 
  4 import re
  5 
  6 from module.plugins.Crypter import Crypter
  7 
  8 class FourChanOrg(Crypter):
  9     __name__ = "FourChanOrg"
  10     __type__ = "container"
  11     __pattern__ = r"http://(www\.)?(img\.)?(zip\.)?4chan.org/\w+/(res/|imgboard\.html)"
  12     __version__ = "0.1"
  13     __description__ = """4chan.org Thread Download Plugin"""
  14     __author_name__ = ("Spoob")
  15     __author_mail__ = ("Spoob@pyload.org")
  16 
  17     def __init__(self, parent):
  18         Crypter.__init__(self, parent)
  19         self.parent = parent
  20         self.html = None
  21 
  22     def file_exists(self):
  23         """ returns True or False
  24         """
  25         return True
  26 
  27     def proceed(self, url, location):
  28         url = self.parent.url
  29         html = self.req.load(url)
  30         link_pattern = ""
  31         temp_links = []
  32         if "imagebord.html" in url:
  33             link_pattern = '[<a href="(res/\d*\.html)">Reply</a>]'
  34             temp_links = re.findall(link_pattern, html)
  35             for link in re.findall(link_pattern, html):
  36                 temp_links.append(link)
  37         else:
  38             temp_links = re.findall('File : <a href="(http://(?:img\.)?(?:zip\.)?4chan\.org/\w{,3}/src/\d*\..{3})"', html)
  39         self.links = temp_links
  40
  [end of module/plugins/crypter/FourChanOrg.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/crypter/FourChanOrg.py b/module/plugins/crypter/FourChanOrg.py
  --- a/module/plugins/crypter/FourChanOrg.py
  +++ b/module/plugins/crypter/FourChanOrg.py
  @@ -6,34 +6,20 @@
   from module.plugins.Crypter import Crypter
   
   class FourChanOrg(Crypter):
  +    # Based on 4chandl by Roland Beermann
  +    # https://gist.github.com/enkore/3492599
       __name__ = "FourChanOrg"
       __type__ = "container"
  -    __pattern__ = r"http://(www\.)?(img\.)?(zip\.)?4chan.org/\w+/(res/|imgboard\.html)"
  -    __version__ = "0.1"
  -    __description__ = """4chan.org Thread Download Plugin"""
  -    __author_name__ = ("Spoob")
  -    __author_mail__ = ("Spoob@pyload.org")
  +    __version__ = "0.3"
  +    __pattern__ = r"http://boards\.4chan.org/\w+/res/(\d+)"
  +    __description__ = "Downloader for entire 4chan threads"
   
  -    def __init__(self, parent):
  -        Crypter.__init__(self, parent)
  -        self.parent = parent
  -        self.html = None
  +    def decrypt(self, pyfile):
  +        pagehtml = self.load(pyfile.url)
   
  -    def file_exists(self):
  -        """ returns True or False
  -        """
  -        return True
  +        images = set(re.findall(r'(images\.4chan\.org/[^/]*/src/[^"<]*)', pagehtml))
  +        urls = []
  +        for image in images:
  +            urls.append("http://" + image)
   
  -    def proceed(self, url, location):
  -        url = self.parent.url
  -        html = self.req.load(url)
  -        link_pattern = ""
  -        temp_links = []
  -        if "imagebord.html" in url:
  -            link_pattern = '[<a href="(res/\d*\.html)">Reply</a>]'
  -            temp_links = re.findall(link_pattern, html)
  -            for link in re.findall(link_pattern, html):
  -                temp_links.append(link)
  -        else:
  -            temp_links = re.findall('File : <a href="(http://(?:img\.)?(?:zip\.)?4chan\.org/\w{,3}/src/\d*\..{3})"', html)
  -        self.links = temp_links
  +        self.core.files.addLinks(urls, self.pyfile.package().id)
  
verification_info: {"golden_diff": "diff --git a/module/plugins/crypter/FourChanOrg.py b/module/plugins/crypter/FourChanOrg.py\n--- a/module/plugins/crypter/FourChanOrg.py\n+++ b/module/plugins/crypter/FourChanOrg.py\n@@ -6,34 +6,20 @@\n from module.plugins.Crypter import Crypter\n \n class FourChanOrg(Crypter):\n+    # Based on 4chandl by Roland Beermann\n+    # https://gist.github.com/enkore/3492599\n     __name__ = \"FourChanOrg\"\n     __type__ = \"container\"\n-    __pattern__ = r\"http://(www\\.)?(img\\.)?(zip\\.)?4chan.org/\\w+/(res/|imgboard\\.html)\"\n-    __version__ = \"0.1\"\n-    __description__ = \"\"\"4chan.org Thread Download Plugin\"\"\"\n-    __author_name__ = (\"Spoob\")\n-    __author_mail__ = (\"Spoob@pyload.org\")\n+    __version__ = \"0.3\"\n+    __pattern__ = r\"http://boards\\.4chan.org/\\w+/res/(\\d+)\"\n+    __description__ = \"Downloader for entire 4chan threads\"\n \n-    def __init__(self, parent):\n-        Crypter.__init__(self, parent)\n-        self.parent = parent\n-        self.html = None\n+    def decrypt(self, pyfile):\n+        pagehtml = self.load(pyfile.url)\n \n-    def file_exists(self):\n-        \"\"\" returns True or False\n-        \"\"\"\n-        return True\n+        images = set(re.findall(r'(images\\.4chan\\.org/[^/]*/src/[^\"<]*)', pagehtml))\n+        urls = []\n+        for image in images:\n+            urls.append(\"http://\" + image)\n \n-    def proceed(self, url, location):\n-        url = self.parent.url\n-        html = self.req.load(url)\n-        link_pattern = \"\"\n-        temp_links = []\n-        if \"imagebord.html\" in url:\n-            link_pattern = '[<a href=\"(res/\\d*\\.html)\">Reply</a>]'\n-            temp_links = re.findall(link_pattern, html)\n-            for link in re.findall(link_pattern, html):\n-                temp_links.append(link)\n-        else:\n-            temp_links = re.findall('File : <a href=\"(http://(?:img\\.)?(?:zip\\.)?4chan\\.org/\\w{,3}/src/\\d*\\..{3})\"', html)\n-        self.links = temp_links\n+        self.core.files.addLinks(urls, self.pyfile.package().id)\n", "issue": "FourChanOrg don't work\nWhen i try to download a thread (e.g. http://boards.4chan.org/wg/res/5176429) nothing happens, only BasePlugin will be used,\n\n", "before_files": [{"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport re\n\nfrom module.plugins.Crypter import Crypter\n\nclass FourChanOrg(Crypter):\n    __name__ = \"FourChanOrg\"\n    __type__ = \"container\"\n    __pattern__ = r\"http://(www\\.)?(img\\.)?(zip\\.)?4chan.org/\\w+/(res/|imgboard\\.html)\"\n    __version__ = \"0.1\"\n    __description__ = \"\"\"4chan.org Thread Download Plugin\"\"\"\n    __author_name__ = (\"Spoob\")\n    __author_mail__ = (\"Spoob@pyload.org\")\n\n    def __init__(self, parent):\n        Crypter.__init__(self, parent)\n        self.parent = parent\n        self.html = None\n\n    def file_exists(self):\n        \"\"\" returns True or False\n        \"\"\"\n        return True\n\n    def proceed(self, url, location):\n        url = self.parent.url\n        html = self.req.load(url)\n        link_pattern = \"\"\n        temp_links = []\n        if \"imagebord.html\" in url:\n            link_pattern = '[<a href=\"(res/\\d*\\.html)\">Reply</a>]'\n            temp_links = re.findall(link_pattern, html)\n            for link in re.findall(link_pattern, html):\n                temp_links.append(link)\n        else:\n            temp_links = re.findall('File : <a href=\"(http://(?:img\\.)?(?:zip\\.)?4chan\\.org/\\w{,3}/src/\\d*\\..{3})\"', html)\n        self.links = temp_links\n", "path": "module/plugins/crypter/FourChanOrg.py"}]}