diff options
| author | 2014-11-04 23:42:46 +0100 | |
|---|---|---|
| committer | 2014-11-04 23:42:46 +0100 | |
| commit | f74309f89923317eeaaca31d74dff10590ed3d40 (patch) | |
| tree | 9958a3ed001d54238b9fb8efcbd4516384b596fe | |
| parent | Fix missing urlparse import (diff) | |
| download | pyload-f74309f89923317eeaaca31d74dff10590ed3d40.tar.xz | |
[XFSHoster] Use URL_REPLACEMENTS to clean url
| -rw-r--r-- | module/plugins/hooks/XFileSharingPro.py | 6 | ||||
| -rw-r--r-- | module/plugins/hoster/FileomCom.py | 4 | ||||
| -rw-r--r-- | module/plugins/hoster/FilerioCom.py | 4 | ||||
| -rw-r--r-- | module/plugins/hoster/JunocloudMe.py | 4 | ||||
| -rw-r--r-- | module/plugins/hoster/XFileSharingPro.py | 5 | ||||
| -rw-r--r-- | module/plugins/internal/XFSAccount.py | 10 | ||||
| -rw-r--r-- | module/plugins/internal/XFSHoster.py | 6 | 
7 files changed, 17 insertions, 22 deletions
| diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 6e9962f3c..ddc20b98a 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -24,9 +24,9 @@ class XFileSharingPro(Hook):      # event_list = ["pluginConfigChanged"]      regexp = {'hoster' : (r'https?://(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:embed-)?\w{12}', -                         r'https?://(?:[^/]+\.)?(%s)/(?:embed-)?\w{12}\W?'), -             'crypter': (r'https?://(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:user|folder)s?/\w+', -                         r'https?://(?:[^/]+\.)?(%s)/(?:user|folder)s?/\w+')} +                          r'https?://(?:[^/]+\.)?(%s)/(?:embed-)?\w{12}\W?'), +              'crypter': (r'https?://(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:user|folder)s?/\w+', +                          r'https?://(?:[^/]+\.)?(%s)/(?:user|folder)s?/\w+')}      HOSTER_LIST  = [#WORKING HOSTERS:                      "eyesfile.ca", "file4safe.com", "fileband.com", "filedwon.com", "filevice.com", "hostingbulk.com", diff --git a/module/plugins/hoster/FileomCom.py b/module/plugins/hoster/FileomCom.py index dc3397e68..2b6fd34db 100644 --- a/module/plugins/hoster/FileomCom.py +++ b/module/plugins/hoster/FileomCom.py @@ -9,7 +9,7 @@ from module.plugins.internal.XFSHoster import XFSHoster, create_getInfo  class FileomCom(XFSHoster):      __name__    = "FileomCom"      __type__    = "hoster" -    __version__ = "0.04" +    __version__ = "0.05"      __pattern__ = r'https?://(?:www\.)?fileom\.com/\w{12}' @@ -20,8 +20,6 @@ class FileomCom(XFSHoster):      HOSTER_DOMAIN = "fileom.com" -    URL_REPLACEMENTS = [(r'/$', "")] -      NAME_PATTERN = r'Filename: <span>(?P<N>.+?)<'      SIZE_PATTERN = r'File Size: <span class="size">(?P<S>[\d.,]+) (?P<U>[\w^_]+)' diff --git a/module/plugins/hoster/FilerioCom.py b/module/plugins/hoster/FilerioCom.py index a7a160cc5..52906fc67 100644 --- a/module/plugins/hoster/FilerioCom.py +++ b/module/plugins/hoster/FilerioCom.py @@ -6,7 +6,7 @@ from module.plugins.internal.XFSHoster import XFSHoster, create_getInfo  class FilerioCom(XFSHoster):      __name__    = "FilerioCom"      __type__    = "hoster" -    __version__ = "0.05" +    __version__ = "0.06"      __pattern__ = r'http://(?:www\.)?(filerio\.(in|com)|filekeen\.com)/\w{12}' @@ -18,7 +18,7 @@ class FilerioCom(XFSHoster):      HOSTER_DOMAIN = "filerio.in"      OFFLINE_PATTERN = r'>"File Not Found|File has been removed' -    URL_REPLACEMENTS = [(r'http://.*?/', 'http://filerio.in/')] +    URL_REPLACEMENTS = [(r'/(?:embed-)?(\w{12}).*', r'/\1'), (r'filekeen\.com', "filerio.in")]  getInfo = create_getInfo(FilerioCom) diff --git a/module/plugins/hoster/JunocloudMe.py b/module/plugins/hoster/JunocloudMe.py index 216c56cb1..0f839960a 100644 --- a/module/plugins/hoster/JunocloudMe.py +++ b/module/plugins/hoster/JunocloudMe.py @@ -6,7 +6,7 @@ from module.plugins.internal.XFSHoster import XFSHoster, create_getInfo  class JunocloudMe(XFSHoster):      __name__    = "JunocloudMe"      __type__    = "hoster" -    __version__ = "0.02" +    __version__ = "0.03"      __pattern__ = r'http://(?:\w+\.)?junocloud\.me/\w{12}' @@ -17,7 +17,7 @@ class JunocloudMe(XFSHoster):      HOSTER_DOMAIN = "junocloud.me" -    URL_REPLACEMENTS = [(r'//(junocloud)', r'//dl3.\1')] +    URL_REPLACEMENTS = [(r'/(?:embed-)?(\w{12}).*', r'/\1'), (r'//www\.', "//dl3.")]      NAME_PATTERN = r'<p class="request_file">http://junocloud.me/w{12}/(?P<N>.+?)</p>'      SIZE_PATTERN = r'<p class="request_filesize">Size: (?P<S>[\d.,]+) (?P<U>[\w^_]+)</p>' diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py index 060f05992..c3f8b6f41 100644 --- a/module/plugins/hoster/XFileSharingPro.py +++ b/module/plugins/hoster/XFileSharingPro.py @@ -8,7 +8,7 @@ from module.plugins.internal.XFSHoster import XFSHoster, create_getInfo  class XFileSharingPro(XFSHoster):      __name__    = "XFileSharingPro"      __type__    = "hoster" -    __version__ = "0.41" +    __version__ = "0.42"      __pattern__ = r'^unmatchable$' @@ -17,9 +17,6 @@ class XFileSharingPro(XFSHoster):      __authors__     = [("Walter Purcaro", "vuolter@gmail.com")] -    URL_REPLACEMENTS = [(r'/embed-(\w{12}).*', r'/\1')]  #: support embedded files - -      def _log(self, type, args):          msg = " | ".join([str(a).strip() for a in args if a])          logger = getattr(self.log, type) diff --git a/module/plugins/internal/XFSAccount.py b/module/plugins/internal/XFSAccount.py index 6a3b3605e..6e34409ed 100644 --- a/module/plugins/internal/XFSAccount.py +++ b/module/plugins/internal/XFSAccount.py @@ -2,8 +2,8 @@  import re -from urlparse import urljoin  from time import gmtime, mktime, strptime +from urlparse import urljoin  from module.plugins.Account import Account  from module.plugins.internal.SimpleHoster import parseHtmlForm, set_cookies @@ -23,14 +23,12 @@ class XFSAccount(Account):      """      Following patterns should be defined by each hoster: -      HOSTER_URL: (optional) -        example: HOSTER_URL = r'linestorage.com' -        PREMIUM_PATTERN: (optional) Checks if the account is premium          example: PREMIUM_PATTERN = r'>Renew premium'      """      HOSTER_DOMAIN = None +    HOSTER_URL    = None      COOKIES = [(HOSTER_DOMAIN, "lang", "english")] @@ -51,8 +49,8 @@ class XFSAccount(Account):          # if not self.HOSTER_DOMAIN:              # self.fail(_("Missing HOSTER_DOMAIN")) -        if not hasattr(self, "HOSTER_URL"): -            self.HOSTER_URL = "http://www.%s/" % self.HOSTER_DOMAIN.replace("www.", "", 1) +        if not self.HOSTER_URL: +            self.HOSTER_URL = "http://www.%s/" % self.HOSTER_DOMAIN      def loadAccountInfo(self, user, req): diff --git a/module/plugins/internal/XFSHoster.py b/module/plugins/internal/XFSHoster.py index 12ac4845d..4e9a0ffe6 100644 --- a/module/plugins/internal/XFSHoster.py +++ b/module/plugins/internal/XFSHoster.py @@ -16,7 +16,7 @@ from module.utils import html_unescape  class XFSHoster(SimpleHoster):      __name__    = "XFSHoster"      __type__    = "hoster" -    __version__ = "0.10" +    __version__ = "0.11"      __pattern__ = r'^unmatchable$' @@ -28,7 +28,9 @@ class XFSHoster(SimpleHoster):      HOSTER_DOMAIN = None -    HOSTER_NAME = None +    HOSTER_NAME   = None + +    URL_REPLACEMENTS = [(r'/(?:embed-)?(\w{12}).*', r'/\1')]  #: plus support embedded files      COOKIES = [(HOSTER_DOMAIN, "lang", "english")] | 
