# -*- coding: utf-8 -*-
#
# Test links:
# http://d-h.st/users/shine/?fld_id=37263#files

import re

from urlparse import urljoin

from module.plugins.internal.SimpleCrypter import SimpleCrypter


class DevhostStFolder(SimpleCrypter):
    __name__ = "DevhostStFolder"
    __type__ = "crypter"
    __version__ = "0.01"

    __pattern__ = r"http://(?:www\.)?d-h\.st/users/\w+/\?fld_id=\d+"

    __description__ = """d-h.st decrypter plugin"""
    __author_name_ = "zapp-brannigan"
    __author_mail_ = "fuerst.reinje@web.de"


    LINK_PATTERN = r'width: 530px;"><a href="(.+?)"'


    def getLinks(self):
        return [urljoin("http://d-h.st", link) for link in re.findall(self.LINK_PATTERN, self.html)]

@@ -330,17 +330,17 @@
 rn__ = r
-%22
+'
 http://(
@@ -378,17 +378,17 @@
 d_id=%5Cd+
-%22
+'
 %0A%0A    __
@@ -542,20 +542,8 @@
 = r'
-width: 530px
 ;%22%3E%3C
@@ -554,14 +554,14 @@
 ef=%22
-(.+?)%22
+/(%5Cw+)
 '%0A%0A%0A

Improve patterns a bit