diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-10-11 15:14:28 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-10-11 15:14:28 +0200 |
commit | f76e5c2336718dca9da8033ba22cd83c72c7b3b3 (patch) | |
tree | 5e4152ed534417ba24c04aedfb2a4070ae669372 | |
parent | [FileshareInUa] Mark dead (diff) | |
download | pyload-f76e5c2336718dca9da8033ba22cd83c72c7b3b3.tar.xz |
Pattern update 1
75 files changed, 93 insertions, 95 deletions
diff --git a/module/plugins/PluginManager.py b/module/plugins/PluginManager.py index 9c7cab64c..e263f8e04 100644 --- a/module/plugins/PluginManager.py +++ b/module/plugins/PluginManager.py @@ -20,7 +20,7 @@ class PluginManager: TYPES = ("crypter", "container", "hoster", "captcha", "accounts", "hooks", "internal") PATTERN = re.compile(r'__pattern__.*=.*r("|\')([^"\']+)') - VERSION = re.compile(r'__version__.*=.*("|\')([0-9.]+)') + VERSION = re.compile(r'__version__.*=.*("|\')([\d.]+)') CONFIG = re.compile(r'__config__.*=.*\[([^\]]+)', re.MULTILINE) DESC = re.compile(r'__description__.?=.?("|"""|\')([^"\']+)') diff --git a/module/plugins/accounts/CzshareCom.py b/module/plugins/accounts/CzshareCom.py index c3c1bbcc8..ea24a4e71 100644 --- a/module/plugins/accounts/CzshareCom.py +++ b/module/plugins/accounts/CzshareCom.py @@ -17,7 +17,7 @@ class CzshareCom(Account): ("stickell", "l.stickell@yahoo.it")] - CREDIT_LEFT_PATTERN = r'<tr class="active">\s*<td>([0-9 ,]+) (KiB|MiB|GiB)</td>\s*<td>([^<]*)</td>\s*</tr>' + CREDIT_LEFT_PATTERN = r'<tr class="active">\s*<td>([\d ,]+) (KiB|MiB|GiB)</td>\s*<td>([^<]*)</td>\s*</tr>' def loadAccountInfo(self, user, req): diff --git a/module/plugins/accounts/FastshareCz.py b/module/plugins/accounts/FastshareCz.py index 62ea0ba7b..eadb9184c 100644 --- a/module/plugins/accounts/FastshareCz.py +++ b/module/plugins/accounts/FastshareCz.py @@ -16,7 +16,7 @@ class FastshareCz(Account): ("stickell", "l.stickell@yahoo.it")] - CREDIT_PATTERN = r'(?:Kredit|Credit)\s*</td>\s*<td[^>]*>([\d. \w]+) ' + CREDIT_PATTERN = r'(?:Kredit|Credit)\s*</td>\s*<td[^>]*>([\w.]+) ' def loadAccountInfo(self, user, req): diff --git a/module/plugins/accounts/FilejungleCom.py b/module/plugins/accounts/FilejungleCom.py index 2db3b1138..1301b34f2 100644 --- a/module/plugins/accounts/FilejungleCom.py +++ b/module/plugins/accounts/FilejungleCom.py @@ -19,7 +19,7 @@ class FilejungleCom(Account): login_timeout = 60 URL = "http://filejungle.com/" - TRAFFIC_LEFT_PATTERN = r'"/extend_premium\.php">Until (\d+ [A-Za-z]+ \d+)<br' + TRAFFIC_LEFT_PATTERN = r'"/extend_premium\.php">Until (\d+ \w+ \d+)<br' LOGIN_FAILED_PATTERN = r'<span htmlfor="loginUser(Name|Password)" generated="true" class="fail_info">' diff --git a/module/plugins/accounts/FreakshareCom.py b/module/plugins/accounts/FreakshareCom.py index 949e5a8ba..904c3ba3e 100644 --- a/module/plugins/accounts/FreakshareCom.py +++ b/module/plugins/accounts/FreakshareCom.py @@ -19,7 +19,7 @@ class FreakshareCom(Account): def loadAccountInfo(self, user, req): page = req.load("http://freakshare.com/") - validuntil = r"ltig bis:</td>\s*<td><b>([0-9 \-:.]+)</b></td>" + validuntil = r"ltig bis:</td>\s*<td><b>([\d.:-]+)</b></td>" validuntil = re.search(validuntil, page, re.MULTILINE) validuntil = validuntil.group(1).strip() validuntil = mktime(strptime(validuntil, "%d.%m.%Y - %H:%M")) diff --git a/module/plugins/accounts/FshareVn.py b/module/plugins/accounts/FshareVn.py index 11ad736f6..b208743e0 100644 --- a/module/plugins/accounts/FshareVn.py +++ b/module/plugins/accounts/FshareVn.py @@ -20,7 +20,7 @@ class FshareVn(Account): VALID_UNTIL_PATTERN = ur'<dt>Thời hạn dùng:</dt>\s*<dd>([^<]+)</dd>' LIFETIME_PATTERN = ur'<dt>Lần đăng nhập trước:</dt>\s*<dd>[^<]+</dd>' - TRAFFIC_LEFT_PATTERN = ur'<dt>Tổng Dung Lượng Tài Khoản</dt>\s*<dd[^>]*>([0-9.]+) ([kKMG])B</dd>' + TRAFFIC_LEFT_PATTERN = ur'<dt>Tổng Dung Lượng Tài Khoản</dt>\s*<dd[^>]*>([\d.]+) ([kKMG])B</dd>' DIRECT_DOWNLOAD_PATTERN = ur'<input type="checkbox"\s*([^=>]*)[^>]*/>Kích hoạt download trực tiếp</dt>' diff --git a/module/plugins/accounts/HellshareCz.py b/module/plugins/accounts/HellshareCz.py index 33d4df7d3..53c9906c1 100644 --- a/module/plugins/accounts/HellshareCz.py +++ b/module/plugins/accounts/HellshareCz.py @@ -56,7 +56,7 @@ class HellshareCz(Account): #Switch to English self.logDebug("Switch lang - URL: %s" % req.lastEffectiveURL) json = req.load("%s?do=locRouter-show" % req.lastEffectiveURL) - hash = re.search(r"(--[0-9a-f]+-)", json).group(1) + hash = re.search(r"(\-\-[0-9a-f]+\-)", json).group(1) self.logDebug("Switch lang - HASH: %s" % hash) html = req.load('http://www.hellshare.com/%s/' % hash) diff --git a/module/plugins/accounts/MultishareCz.py b/module/plugins/accounts/MultishareCz.py index 851599e89..6d2f0d64f 100644 --- a/module/plugins/accounts/MultishareCz.py +++ b/module/plugins/accounts/MultishareCz.py @@ -17,7 +17,7 @@ class MultishareCz(Account): __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] - TRAFFIC_LEFT_PATTERN = r'<span class="profil-zvyrazneni">Kredit:</span>\s*<strong>(?P<S>[0-9,]+) (?P<U>\w+)</strong>' + TRAFFIC_LEFT_PATTERN = r'<span class="profil-zvyrazneni">Kredit:</span>\s*<strong>(?P<S>[\d,]+) (?P<U>\w+)</strong>' ACCOUNT_INFO_PATTERN = r'<input type="hidden" id="(u_ID|u_hash)" name="[^"]*" value="([^"]+)">' diff --git a/module/plugins/accounts/TurbobitNet.py b/module/plugins/accounts/TurbobitNet.py index 2db1bfa14..065668815 100644 --- a/module/plugins/accounts/TurbobitNet.py +++ b/module/plugins/accounts/TurbobitNet.py @@ -19,7 +19,7 @@ class TurbobitNet(Account): def loadAccountInfo(self, user, req): html = req.load("http://turbobit.net") - m = re.search(r'<u>Turbo Access</u> to ([0-9.]+)', html) + m = re.search(r'<u>Turbo Access</u> to ([\d.]+)', html) if m: premium = True validuntil = mktime(strptime(m.group(1), "%d.%m.%Y")) diff --git a/module/plugins/accounts/UlozTo.py b/module/plugins/accounts/UlozTo.py index 3663fb65d..2298e252b 100644 --- a/module/plugins/accounts/UlozTo.py +++ b/module/plugins/accounts/UlozTo.py @@ -16,7 +16,7 @@ class UlozTo(Account): ("pulpe", None)] - TRAFFIC_LEFT_PATTERN = r'<li class="menu-kredit"><a href="/kredit" title="[^"]*?GB = ([0-9.]+) MB"' + TRAFFIC_LEFT_PATTERN = r'<li class="menu-kredit"><a href="/kredit" title="[^"]*?GB = ([\d.]+) MB"' def loadAccountInfo(self, user, req): diff --git a/module/plugins/accounts/UploadheroCom.py b/module/plugins/accounts/UploadheroCom.py index 868e51e98..ec34e425e 100644 --- a/module/plugins/accounts/UploadheroCom.py +++ b/module/plugins/accounts/UploadheroCom.py @@ -18,7 +18,7 @@ class UploadheroCom(Account): def loadAccountInfo(self, user, req): - premium_pattern = re.compile('Il vous reste <span class="bleu">([0-9]+)</span> jours premium.') + premium_pattern = re.compile('Il vous reste <span class="bleu">(\d+)</span> jours premium.') data = self.getAccountData(user) page = req.load("http://uploadhero.co/my-account") diff --git a/module/plugins/crypter/ChipDe.py b/module/plugins/crypter/ChipDe.py index 7752ee3bb..a4d6ad285 100644 --- a/module/plugins/crypter/ChipDe.py +++ b/module/plugins/crypter/ChipDe.py @@ -19,7 +19,7 @@ class ChipDe(Crypter): def decrypt(self, pyfile): self.html = self.load(pyfile.url) try: - f = re.search(r'"(http://video.chip.de/\d+?/.*)"', self.html) + f = re.search(r'"(http://video\.chip\.de/.+)"', self.html) except: self.fail('Failed to find the URL') else: diff --git a/module/plugins/crypter/CryptItCom.py b/module/plugins/crypter/CryptItCom.py index 58f0d77b6..372938119 100644 --- a/module/plugins/crypter/CryptItCom.py +++ b/module/plugins/crypter/CryptItCom.py @@ -8,7 +8,7 @@ class CryptItCom(DeadCrypter): __type__ = "crypter" __version__ = "0.11" - __pattern__ = r'http://(?:www\.)?crypt-it\.com/(s|e|d|c)/[\w]+' + __pattern__ = r'http://(?:www\.)?crypt-it\.com/(s|e|d|c)/\w+' __description__ = """Crypt-it.com decrypter plugin""" __license__ = "GPLv3" diff --git a/module/plugins/crypter/DDLMusicOrg.py b/module/plugins/crypter/DDLMusicOrg.py index c224ee732..a78794b6d 100644 --- a/module/plugins/crypter/DDLMusicOrg.py +++ b/module/plugins/crypter/DDLMusicOrg.py @@ -28,7 +28,7 @@ class DDLMusicOrg(Crypter): if re.search(r"Wer dies nicht rechnen kann", html) is not None: self.offline() - math = re.search(r"(\d+) ([\+-]) (\d+) =\s+<inp", self.html) + math = re.search(r"(\d+) ([+-]) (\d+) =\s+<inp", self.html) id = re.search(r"name=\"id\" value=\"(\d+)\"", self.html).group(1) linknr = re.search(r"name=\"linknr\" value=\"(\d+)\"", self.html).group(1) diff --git a/module/plugins/crypter/ILoadTo.py b/module/plugins/crypter/ILoadTo.py index 638d15191..184b71d04 100644 --- a/module/plugins/crypter/ILoadTo.py +++ b/module/plugins/crypter/ILoadTo.py @@ -8,7 +8,7 @@ class ILoadTo(DeadCrypter): __type__ = "crypter" __version__ = "0.11" - __pattern__ = r'http://(?:www\.)?iload\.to/go/\d+-[\w\.-]+/' + __pattern__ = r'http://(?:www\.)?iload\.to/go/\d+-[\w.-]+/' __description__ = """Iload.to decrypter plugin""" __license__ = "GPLv3" diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py index 22d496913..8b8d2ebd4 100644 --- a/module/plugins/crypter/NCryptIn.py +++ b/module/plugins/crypter/NCryptIn.py @@ -231,7 +231,7 @@ class NCryptIn(Crypter): self.logDebug("Handling Container links") package_links = [] - pattern = r"/container/(rsdf|dlc|ccf)/([a-z0-9]+)" + pattern = r"/container/(rsdf|dlc|ccf)/(\w+)" containersLinks = re.findall(pattern, self.html) self.logDebug("Decrypting %d Container links" % len(containersLinks)) for containerLink in containersLinks: diff --git a/module/plugins/crypter/SafelinkingNet.py b/module/plugins/crypter/SafelinkingNet.py index a496812d2..737e4fc10 100644 --- a/module/plugins/crypter/SafelinkingNet.py +++ b/module/plugins/crypter/SafelinkingNet.py @@ -23,7 +23,7 @@ class SafelinkingNet(Crypter): __authors__ = [("quareevo", "quareevo@arcor.de")] - SOLVEMEDIA_PATTERN = "solvemediaApiKey = '([\w\.\-_]+)';" + SOLVEMEDIA_PATTERN = "solvemediaApiKey = '([\w.-]+)';" def decrypt(self, pyfile): diff --git a/module/plugins/crypter/SecuredIn.py b/module/plugins/crypter/SecuredIn.py index 701c4843a..2ad7819d8 100644 --- a/module/plugins/crypter/SecuredIn.py +++ b/module/plugins/crypter/SecuredIn.py @@ -8,7 +8,7 @@ class SecuredIn(DeadCrypter): __type__ = "crypter" __version__ = "0.21" - __pattern__ = r'http://(?:www\.)?secured\.in/download-[\d]+-[\w]{8}\.html' + __pattern__ = r'http://(?:www\.)?secured\.in/download-[\d]+-\w{8}\.html' __description__ = """Secured.in decrypter plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hooks/DeathByCaptcha.py b/module/plugins/hooks/DeathByCaptcha.py index d58da9a88..2548506cb 100644 --- a/module/plugins/hooks/DeathByCaptcha.py +++ b/module/plugins/hooks/DeathByCaptcha.py @@ -124,7 +124,7 @@ class DeathByCaptcha(Hook): def submit(self, captcha, captchaType="file", match=None): #workaround multipart-post bug in HTTPRequest.py - if re.match("^[A-Za-z0-9]*$", self.getConfig("passkey")): + if re.match("^\w*$", self.getConfig("passkey")): multipart = True data = (FORM_FILE, captcha) else: diff --git a/module/plugins/hooks/ImageTyperz.py b/module/plugins/hooks/ImageTyperz.py index aaa3c7bbd..b7ee6b105 100644 --- a/module/plugins/hooks/ImageTyperz.py +++ b/module/plugins/hooks/ImageTyperz.py @@ -73,7 +73,7 @@ class ImageTyperz(Hook): try: #workaround multipart-post bug in HTTPRequest.py - if re.match("^[A-Za-z0-9]*$", self.getConfig("passkey")): + if re.match("^\w*$", self.getConfig("passkey")): multipart = True data = (FORM_FILE, captcha) else: diff --git a/module/plugins/hooks/MergeFiles.py b/module/plugins/hooks/MergeFiles.py index 627a9ec3c..5a23ff862 100644 --- a/module/plugins/hooks/MergeFiles.py +++ b/module/plugins/hooks/MergeFiles.py @@ -32,7 +32,7 @@ class MergeFiles(Hook): files = {} fid_dict = {} for fid, data in pack.getChildren().iteritems(): - if re.search("\.[0-9]{3}$", data['name']): + if re.search("\.\d{3}$", data['name']): if data['name'][:-4] not in files: files[data['name'][:-4]] = [] files[data['name'][:-4]].append(data['name']) diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index fe5808789..b0fe36c9f 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -150,7 +150,7 @@ class UpdateManager(Hook): updated = [] - vre = re.compile(r'__version__.*=.*("|\')([0-9.]+)') + vre = re.compile(r'__version__.*=.*("|\')([\d.]+)') url = updates[0] schema = updates[1].split('|') if "BLACKLIST" in updates: diff --git a/module/plugins/hoster/BayfilesCom.py b/module/plugins/hoster/BayfilesCom.py index 3d4306df5..98c5d27ba 100644 --- a/module/plugins/hoster/BayfilesCom.py +++ b/module/plugins/hoster/BayfilesCom.py @@ -13,7 +13,7 @@ class BayfilesCom(SimpleHoster): __type__ = "hoster" __version__ = "0.07" - __pattern__ = r'https?://(?:www\.)?bayfiles\.(com|net)/file/(?P<ID>[a-zA-Z0-9]+/[a-zA-Z0-9]+/[^/]+)' + __pattern__ = r'https?://(?:www\.)?bayfiles\.(com|net)/file/(?P<ID>\w+/\w+/[^/]+)' __description__ = """Bayfiles.com hoster plugin""" __license__ = "GPLv3" @@ -21,10 +21,10 @@ class BayfilesCom(SimpleHoster): ("Walter Purcaro", "vuolter@gmail.com")] - FILE_INFO_PATTERN = r'<p title="(?P<N>[^"]+)">[^<]*<strong>(?P<S>[0-9., ]+)(?P<U>[kKMG])i?B</strong></p>' + FILE_INFO_PATTERN = r'<p title="(?P<N>[^"]+)">[^<]*<strong>(?P<S>[\d .,]+)(?P<U>\w+)</strong></p>' OFFLINE_PATTERN = r'(<p>The requested file could not be found.</p>|<title>404 Not Found</title>)' - WAIT_PATTERN = r'>Your IP [0-9.]* has recently downloaded a file\. Upgrade to premium or wait (\d+) minutes\.<' + WAIT_PATTERN = r'>Your IP [\d.]* has recently downloaded a file\. Upgrade to premium or wait (\d+) minutes\.<' VARS_PATTERN = r'var vfid = (\d+);\s*var delay = (\d+);' FREE_LINK_PATTERN = r"javascript:window.location.href = '([^']+)';" PREMIUM_LINK_PATTERN = r'(?:<a class="highlighted-btn" href="|(?=http://s\d+\.baycdn\.com/dl/))(.*?)"' diff --git a/module/plugins/hoster/BitshareCom.py b/module/plugins/hoster/BitshareCom.py index 2a0b0fa9b..1e98a1349 100644 --- a/module/plugins/hoster/BitshareCom.py +++ b/module/plugins/hoster/BitshareCom.py @@ -13,7 +13,7 @@ class BitshareCom(SimpleHoster): __type__ = "hoster" __version__ = "0.50" - __pattern__ = r'http://(?:www\.)?bitshare\.com/(files/(?P<id1>[a-zA-Z0-9]+)(/(?P<name>.*?)\.html)?|\?f=(?P<id2>[a-zA-Z0-9]+))' + __pattern__ = r'http://(?:www\.)?bitshare\.com/(files/(?P<id1>\w+)(/(?P<name>.*?)\.html)?|\?f=(?P<id2>\w+))' __description__ = """Bitshare.com hoster plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hoster/CzshareCom.py b/module/plugins/hoster/CzshareCom.py index 9e965b972..0ec60b5d1 100644 --- a/module/plugins/hoster/CzshareCom.py +++ b/module/plugins/hoster/CzshareCom.py @@ -22,7 +22,7 @@ class CzshareCom(SimpleHoster): FILE_NAME_PATTERN = r'<div class="tab" id="parameters">\s*<p>\s*Cel. n.zev: <a href=[^>]*>(?P<N>[^<]+)</a>' - FILE_SIZE_PATTERN = r'<div class="tab" id="category">(?:\s*<p>[^\n]*</p>)*\s*Velikost:\s*(?P<S>[0-9., ]+)(?P<U>[kKMG])i?B\s*</div>' + FILE_SIZE_PATTERN = r'<div class="tab" id="category">(?:\s*<p>[^\n]*</p>)*\s*Velikost:\s*(?P<S>[\d .,]+)(?P<U>\w+)\s*</div>' OFFLINE_PATTERN = r'<div class="header clearfix">\s*<h2 class="red">' FILE_SIZE_REPLACEMENTS = [(' ', '')] @@ -35,7 +35,7 @@ class CzshareCom(SimpleHoster): PREMIUM_FORM_PATTERN = r'<form action="/profi_down.php" method="post">(.*?)</form>' FORM_INPUT_PATTERN = r'<input[^>]* name="([^"]+)" value="([^"]+)"[^>]*/>' MULTIDL_PATTERN = r"<p><font color='red'>Z[^<]*PROFI.</font></p>" - USER_CREDIT_PATTERN = r'<div class="credit">\s*kredit: <strong>([0-9., ]+)([kKMG]i?B)</strong>\s*</div><!-- .credit -->' + USER_CREDIT_PATTERN = r'<div class="credit">\s*kredit: <strong>([\d .,]+)(\w+)</strong>\s*</div><!-- .credit -->' def checkTrafficLeft(self): diff --git a/module/plugins/hoster/DepositfilesCom.py b/module/plugins/hoster/DepositfilesCom.py index 54ceabb6c..67b00342e 100644 --- a/module/plugins/hoster/DepositfilesCom.py +++ b/module/plugins/hoster/DepositfilesCom.py @@ -23,7 +23,7 @@ class DepositfilesCom(SimpleHoster): FILE_NAME_PATTERN = r'<script type="text/javascript">eval\( unescape\(\'(?P<N>.*?)\'' - FILE_SIZE_PATTERN = r': <b>(?P<S>[0-9.]+) (?P<U>[kKMG])i?B</b>' + FILE_SIZE_PATTERN = r': <b>(?P<S>[\d.]+) (?P<U>\w+)</b>' OFFLINE_PATTERN = r'<span class="html_download_api-not_exists"></span>' FILE_NAME_REPLACEMENTS = [(r'\%u([0-9A-Fa-f]{4})', lambda m: unichr(int(m.group(1), 16))), diff --git a/module/plugins/hoster/DlFreeFr.py b/module/plugins/hoster/DlFreeFr.py index 1938d112e..b9ef39bb0 100644 --- a/module/plugins/hoster/DlFreeFr.py +++ b/module/plugins/hoster/DlFreeFr.py @@ -114,7 +114,7 @@ class DlFreeFr(SimpleHoster): __type__ = "hoster" __version__ = "0.25" - __pattern__ = r'http://(?:www\.)?dl\.free\.fr/([a-zA-Z0-9]+|getfile\.pl\?file=/[a-zA-Z0-9]+)' + __pattern__ = r'http://(?:www\.)?dl\.free\.fr/(\w+|getfile\.pl\?file=/\w+)' __description__ = """Dl.free.fr hoster plugin""" __license__ = "GPLv3" @@ -124,7 +124,7 @@ class DlFreeFr(SimpleHoster): FILE_NAME_PATTERN = r'Fichier:</td>\s*<td[^>]*>(?P<N>[^>]*)</td>' - FILE_SIZE_PATTERN = r'Taille:</td>\s*<td[^>]*>(?P<S>[\d.]+[KMG])o' + FILE_SIZE_PATTERN = r'Taille:</td>\s*<td[^>]*>(?P<S>[\d.]+\w)o' OFFLINE_PATTERN = r"Erreur 404 - Document non trouv|Fichier inexistant|Le fichier demandé n'a pas été trouvé" diff --git a/module/plugins/hoster/EdiskCz.py b/module/plugins/hoster/EdiskCz.py index 4855247a1..014826e32 100644 --- a/module/plugins/hoster/EdiskCz.py +++ b/module/plugins/hoster/EdiskCz.py @@ -17,7 +17,7 @@ class EdiskCz(SimpleHoster): __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] - FILE_INFO_PATTERN = r'<span class="fl" title="(?P<N>[^"]+)">\s*.*?\((?P<S>[0-9.]*) (?P<U>[kKMG])i?B\)</h1></span>' + FILE_INFO_PATTERN = r'<span class="fl" title="(?P<N>[^"]+)">\s*.*?\((?P<S>[\d.]*) (?P<U>\w+)\)</h1></span>' OFFLINE_PATTERN = r'<h3>This file does not exist due to one of the following:</h3><ul><li>' ACTION_PATTERN = r'/en/download/(\d+/.*\.html)' diff --git a/module/plugins/hoster/ExtabitCom.py b/module/plugins/hoster/ExtabitCom.py index 808ff712c..4b0d3d95b 100644 --- a/module/plugins/hoster/ExtabitCom.py +++ b/module/plugins/hoster/ExtabitCom.py @@ -26,7 +26,7 @@ class ExtabitCom(SimpleHoster): OFFLINE_PATTERN = r'>File not found<' TEMP_OFFLINE_PATTERN = r'>(File is temporary unavailable|No download mirror)<' - LINK_PATTERN = r'[\'"](http://guest\d+\.extabit\.com/[a-z0-9]+/.*?)[\'"]' + LINK_PATTERN = r'[\'"](http://guest\d+\.extabit\.com/\w+/.*?)[\'"]' def handleFree(self): diff --git a/module/plugins/hoster/FastixRu.py b/module/plugins/hoster/FastixRu.py index ca22638f1..7f61f7d7c 100644 --- a/module/plugins/hoster/FastixRu.py +++ b/module/plugins/hoster/FastixRu.py @@ -14,7 +14,7 @@ class FastixRu(Hoster): __type__ = "hoster" __version__ = "0.04" - __pattern__ = r'http://(?:www\.)?fastix\.(ru|it)/file/(?P<ID>[a-zA-Z0-9]{24})' + __pattern__ = r'http://(?:www\.)?fastix\.(ru|it)/file/(?P<ID>\w{24})' __description__ = """Fastix hoster plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hoster/FileParadoxIn.py b/module/plugins/hoster/FileParadoxIn.py index e72399cfe..dd5faf274 100644 --- a/module/plugins/hoster/FileParadoxIn.py +++ b/module/plugins/hoster/FileParadoxIn.py @@ -20,7 +20,6 @@ class FileParadoxIn(XFSPHoster): HOSTER_NAME = "fileparadox.in" FILE_SIZE_PATTERN = r'</font>\s*\(\s*(?P<S>[^)]+)\s*\)</font>' - LINK_PATTERN = r'(http://([^/]*?fileparadox.in|\d+\.\d+\.\d+\.\d+)(:\d+/d/|/files/\w+/\w+/)[^"\'<]+)' getInfo = create_getInfo(FileParadoxIn) diff --git a/module/plugins/hoster/FileStoreTo.py b/module/plugins/hoster/FileStoreTo.py index 4333f800b..89865e8be 100644 --- a/module/plugins/hoster/FileStoreTo.py +++ b/module/plugins/hoster/FileStoreTo.py @@ -18,7 +18,7 @@ class FileStoreTo(SimpleHoster): ("stickell", "l.stickell@yahoo.it")] - FILE_INFO_PATTERN = r'File: <span[^>]*>(?P<N>.+)</span><br />Size: (?P<S>[\d,.]+) (?P<U>\w+)' + FILE_INFO_PATTERN = r'File: <span[^>]*>(?P<N>.+)</span><br />Size: (?P<S>[\d.,]+) (?P<U>\w+)' OFFLINE_PATTERN = r'>Download-Datei wurde nicht gefunden<' diff --git a/module/plugins/hoster/FilefactoryCom.py b/module/plugins/hoster/FilefactoryCom.py index a9fbdaff1..878d18d0a 100644 --- a/module/plugins/hoster/FilefactoryCom.py +++ b/module/plugins/hoster/FilefactoryCom.py @@ -22,7 +22,7 @@ class FilefactoryCom(SimpleHoster): __type__ = "hoster" __version__ = "0.50" - __pattern__ = r'https?://(?:www\.)?filefactory\.com/file/(?P<id>[a-zA-Z0-9]+)' + __pattern__ = r'https?://(?:www\.)?filefactory\.com/file/(?P<id>\w+)' __description__ = """Filefactory.com hoster plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hoster/FileomCom.py b/module/plugins/hoster/FileomCom.py index ec767c1e8..d3038154c 100644 --- a/module/plugins/hoster/FileomCom.py +++ b/module/plugins/hoster/FileomCom.py @@ -23,7 +23,7 @@ class FileomCom(XFSPHoster): FILE_URL_REPLACEMENTS = [(r'/$', "")] FILE_NAME_PATTERN = r'Filename: <span>(?P<N>.+?)<' - FILE_SIZE_PATTERN = r'File Size: <span class="size">(?P<S>[\d\.]+) (?P<U>\w+)' + FILE_SIZE_PATTERN = r'File Size: <span class="size">(?P<S>[\d.]+) (?P<U>\w+)' ERROR_PATTERN = r'class=["\']err["\'][^>]*>(.*?)(?:\'|</)' diff --git a/module/plugins/hoster/FilepostCom.py b/module/plugins/hoster/FilepostCom.py index 11afb4afb..0dc0d7c63 100644 --- a/module/plugins/hoster/FilepostCom.py +++ b/module/plugins/hoster/FilepostCom.py @@ -21,7 +21,7 @@ class FilepostCom(SimpleHoster): __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] - FILE_INFO_PATTERN = r'<input type="text" id="url" value=\'<a href[^>]*>(?P<N>[^>]+?) - (?P<S>[0-9\.]+ [kKMG]i?B)</a>\' class="inp_text"/>' + FILE_INFO_PATTERN = r'<input type="text" id="url" value=\'<a href[^>]*>(?P<N>[^>]+?) - (?P<S>[\d.]+) (?P<U>\w+)</a>\' class="inp_text"/>' OFFLINE_PATTERN = r'class="error_msg_title"> Invalid or Deleted File. </div>|<div class="file_info file_info_deleted">' PREMIUM_ONLY_PATTERN = r'members only. Please upgrade to premium|a premium membership is required to download this file' diff --git a/module/plugins/hoster/FourSharedCom.py b/module/plugins/hoster/FourSharedCom.py index 596173b88..a36f43eea 100644 --- a/module/plugins/hoster/FourSharedCom.py +++ b/module/plugins/hoster/FourSharedCom.py @@ -19,7 +19,7 @@ class FourSharedCom(SimpleHoster): FILE_NAME_PATTERN = r'<meta name="title" content="(?P<N>.+?)"' - FILE_SIZE_PATTERN = r'<span title="Size: (?P<S>[0-9,.]+) (?P<U>[kKMG])i?B">' + FILE_SIZE_PATTERN = r'<span title="Size: (?P<S>[\d.,]+) (?P<U>\w+)">' OFFLINE_PATTERN = r'The file link that you requested is not valid\.|This file was deleted.' FILE_NAME_REPLACEMENTS = [(r"&#(\d+).", lambda m: unichr(int(m.group(1))))] diff --git a/module/plugins/hoster/FreakshareCom.py b/module/plugins/hoster/FreakshareCom.py index 808ca1ab0..df06f2e74 100644 --- a/module/plugins/hoster/FreakshareCom.py +++ b/module/plugins/hoster/FreakshareCom.py @@ -132,7 +132,7 @@ class FreakshareCom(Hoster): self.wantReconnect = True return secondsToMidnight(gmt=2) - timestring = re.search('\s*var\s(?:downloadWait|time)\s=\s(\d*)[.\d]*;', self.html) + timestring = re.search('\s*var\s(?:downloadWait|time)\s=\s(\d*)[\d.]*;', self.html) if timestring: return int(timestring.group(1)) + 1 # add 1 sec as tenths of seconds are cut off else: @@ -166,7 +166,7 @@ class FreakshareCom(Hoster): # comment this in, when it doesnt work as well #print "\n\n%s\n\n" % ";".join(["%s=%s" % x for x in to_sort]) - challenge = re.search(r"http://api\.recaptcha\.net/challenge\?k=([0-9A-Za-z]+)", herewego) + challenge = re.search(r"http://api\.recaptcha\.net/challenge\?k=(\w+)", herewego) if challenge: re_captcha = ReCaptcha(self) diff --git a/module/plugins/hoster/FshareVn.py b/module/plugins/hoster/FshareVn.py index 500d4648a..7e66d846c 100644 --- a/module/plugins/hoster/FshareVn.py +++ b/module/plugins/hoster/FshareVn.py @@ -36,7 +36,7 @@ class FshareVn(SimpleHoster): __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] - FILE_INFO_PATTERN = r'<p>(?P<N>[^<]+)<\\/p>[\\trn\s]*<p>(?P<S>[0-9,.]+)\s*(?P<U>[kKMG])i?B<\\/p>' + FILE_INFO_PATTERN = r'<p>(?P<N>[^<]+)<\\/p>[\\trn\s]*<p>(?P<S>[\d.,]+)\s*(?P<U>\w+)<\\/p>' OFFLINE_PATTERN = r'<div class=\\"f_left file_w\\"|<\\/p>\\t\\t\\t\\t\\r\\n\\t\\t<p><\\/p>\\t\\t\\r\\n\\t\\t<p>0 KB<\\/p>' FILE_NAME_REPLACEMENTS = [("(.*)", doubleDecode)] diff --git a/module/plugins/hoster/GamefrontCom.py b/module/plugins/hoster/GamefrontCom.py index da16b0eb5..413b9ee10 100644 --- a/module/plugins/hoster/GamefrontCom.py +++ b/module/plugins/hoster/GamefrontCom.py @@ -12,7 +12,7 @@ class GamefrontCom(Hoster): __type__ = "hoster" __version__ = "0.04" - __pattern__ = r'http://(?:www\.)?gamefront.com/files/[A-Za-z0-9]+' + __pattern__ = r'http://(?:www\.)?gamefront.com/files/\w+' __description__ = """Gamefront.com hoster plugin""" __license__ = "GPLv3" @@ -58,9 +58,9 @@ class GamefrontCom(Hoster): return name.group(1) def _getLink(self): - self.html2 = self.load("http://www.gamefront.com/" + re.search("(files/service/thankyou\\?id=[A-Za-z0-9]+)", + self.html2 = self.load("http://www.gamefront.com/" + re.search("(files/service/thankyou\\?id=\w+)", self.html).group(1)) - return re.search("<a href=\"(http://media[0-9]+\.gamefront.com/.*)\">click here</a>", self.html2).group(1).replace("&", "&") + return re.search("<a href=\"(http://media\d+\.gamefront.com/.*)\">click here</a>", self.html2).group(1).replace("&", "&") def getInfo(urls): diff --git a/module/plugins/hoster/HellshareCz.py b/module/plugins/hoster/HellshareCz.py index 0661ea70c..a22ed6926 100644 --- a/module/plugins/hoster/HellshareCz.py +++ b/module/plugins/hoster/HellshareCz.py @@ -18,7 +18,7 @@ class HellshareCz(SimpleHoster): FILE_NAME_PATTERN = r'<h1 id="filename"[^>]*>(?P<N>[^<]+)</h1>' - FILE_SIZE_PATTERN = r'<strong id="FileSize_master">(?P<S>[0-9.]*) (?P<U>[kKMG])i?B</strong>' + FILE_SIZE_PATTERN = r'<strong id="FileSize_master">(?P<S>[\d.]*) (?P<U>\w+)</strong>' OFFLINE_PATTERN = r'<h1>File not found.</h1>' SHOW_WINDOW_PATTERN = r'<a href="([^?]+/(\d+)/\?do=(fileDownloadButton|relatedFileDownloadButton-\2)-showDownloadWindow)"' diff --git a/module/plugins/hoster/HundredEightyUploadCom.py b/module/plugins/hoster/HundredEightyUploadCom.py index 02cfe219d..d1bfb620f 100644 --- a/module/plugins/hoster/HundredEightyUploadCom.py +++ b/module/plugins/hoster/HundredEightyUploadCom.py @@ -21,7 +21,7 @@ class HundredEightyUploadCom(XFSPHoster): HOSTER_NAME = "180upload.com" FILE_NAME_PATTERN = r'Filename:</b></td><td nowrap>(?P<N>.+)</td></tr>-->' - FILE_SIZE_PATTERN = r'Size:</b></td><td>(?P<S>[\d.]+) (?P<U>[A-Z]+)\s*<small>' + FILE_SIZE_PATTERN = r'Size:</b></td><td>(?P<S>[\d.]+) (?P<U>\w+)\s*<small>' getInfo = create_getInfo(HundredEightyUploadCom) diff --git a/module/plugins/hoster/IfileIt.py b/module/plugins/hoster/IfileIt.py index 2c228ee8e..39bfcb233 100644 --- a/module/plugins/hoster/IfileIt.py +++ b/module/plugins/hoster/IfileIt.py @@ -21,7 +21,7 @@ class IfileIt(SimpleHoster): LINK_PATTERN = r'</span> If it doesn\'t, <a target="_blank" href="([^"]+)">' RECAPTCHA_PATTERN = r"var __recaptcha_public\s*=\s*'([^']+)';" - FILE_INFO_PATTERN = r'<span style="cursor: default;[^>]*>\s*(?P<N>.*?)\s* \s*<strong>\s*(?P<S>[0-9.]+)\s*(?P<U>[kKMG])i?B\s*</strong>\s*</span>' + FILE_INFO_PATTERN = r'<span style="cursor: default;[^>]*>\s*(?P<N>.*?)\s* \s*<strong>\s*(?P<S>[\d.]+)\s*(?P<U>\w+)\s*</strong>\s*</span>' OFFLINE_PATTERN = r'<span style="cursor: default;[^>]*>\s* \s*<strong>\s*</strong>\s*</span>' TEMP_OFFLINE_PATTERN = r'<span class="msg_red">Downloading of this file is temporarily disabled</span>' diff --git a/module/plugins/hoster/JumbofilesCom.py b/module/plugins/hoster/JumbofilesCom.py index 842c31f2a..254d9cffa 100644 --- a/module/plugins/hoster/JumbofilesCom.py +++ b/module/plugins/hoster/JumbofilesCom.py @@ -17,7 +17,7 @@ class JumbofilesCom(SimpleHoster): __authors__ = [("godofdream", "soilfiction@gmail.com")] - FILE_INFO_PATTERN = r'<TR><TD>(?P<N>[^<]+?)\s*<small>\((?P<S>[\d.]+)\s*(?P<U>[KMG][bB])\)</small></TD></TR>' + FILE_INFO_PATTERN = r'<TR><TD>(?P<N>[^<]+?)\s*<small>\((?P<S>[\d.]+)\s*(?P<U>\w+)' OFFLINE_PATTERN = r'Not Found or Deleted / Disabled due to inactivity or DMCA' LINK_PATTERN = r'<meta http-equiv="refresh" content="10;url=(.+)">' diff --git a/module/plugins/hoster/MegaNz.py b/module/plugins/hoster/MegaNz.py index 10eac6236..91719b86b 100644 --- a/module/plugins/hoster/MegaNz.py +++ b/module/plugins/hoster/MegaNz.py @@ -18,7 +18,7 @@ class MegaNz(Hoster): __type__ = "hoster" __version__ = "0.14" - __pattern__ = r'https?://([a-z0-9]+\.)?mega\.co\.nz/#!([a-zA-Z0-9!_\-]+)' + __pattern__ = r'https?://(\w+\.)?mega\.co\.nz/#!([\w!-]+)' __description__ = """Mega.co.nz hoster plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hoster/MegaRapidCz.py b/module/plugins/hoster/MegaRapidCz.py index d36db5e7c..282a8ec6d 100644 --- a/module/plugins/hoster/MegaRapidCz.py +++ b/module/plugins/hoster/MegaRapidCz.py @@ -35,7 +35,7 @@ class MegaRapidCz(SimpleHoster): FILE_NAME_PATTERN = r'<h1[^>]*><span[^>]*>(?:<a[^>]*>)?(?P<N>[^<]+)' - FILE_SIZE_PATTERN = r'<td class="i">Velikost:</td>\s*<td class="h"><strong>\s*(?P<S>[0-9.]+) (?P<U>[kKMG])i?B</strong></td>' + FILE_SIZE_PATTERN = r'<td class="i">Velikost:</td>\s*<td class="h"><strong>\s*(?P<S>[\d.]+) (?P<U>\w+)</strong></td>' OFFLINE_PATTERN = ur'Nastala chyba 404|Soubor byl smazán' FORCE_CHECK_TRAFFIC = True diff --git a/module/plugins/hoster/MegacrypterCom.py b/module/plugins/hoster/MegacrypterCom.py index 855fba9b2..67dec2a0b 100644 --- a/module/plugins/hoster/MegacrypterCom.py +++ b/module/plugins/hoster/MegacrypterCom.py @@ -11,7 +11,7 @@ class MegacrypterCom(MegaNz): __type__ = "hoster" __version__ = "0.2" - __pattern__ = r'(https?://[a-z0-9]{0,10}\.?megacrypter\.com/[a-zA-Z0-9!_\-]+)' + __pattern__ = r'(https?://\w{0,10}\.?megacrypter\.com/[\w!-]+)' __description__ = """Megacrypter.com decrypter plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hoster/MegasharesCom.py b/module/plugins/hoster/MegasharesCom.py index e7ac1d250..985c77dd5 100644 --- a/module/plugins/hoster/MegasharesCom.py +++ b/module/plugins/hoster/MegasharesCom.py @@ -26,7 +26,7 @@ class MegasharesCom(SimpleHoster): LINK_PATTERN = r'<div id="show_download_button_%d"[^>]*>\s*<a href="([^"]+)">' PASSPORT_LEFT_PATTERN = r'Your Download Passport is: <[^>]*>(\w+).*?You have.*?<[^>]*>.*?([\d.]+) (\w+)' - PASSPORT_RENEW_PATTERN = r'Your download passport will renew(?:.|\n)*?(\d+).*?(\d+).*?(\d+)' + PASSPORT_RENEW_PATTERN = r'Your download passport will renew(?:.|\n)*(\d+).*?(\d+).*?(\d+)' REACTIVATE_NUM_PATTERN = r'<input[^>]*id="random_num" value="(\d+)" />' REACTIVATE_PASSPORT_PATTERN = r'<input[^>]*id="passport_num" value="(\w+)" />' REQUEST_URI_PATTERN = r'var request_uri = "([^"]+)";' diff --git a/module/plugins/hoster/NarodRu.py b/module/plugins/hoster/NarodRu.py index 4de4d5946..c1e1e308a 100644 --- a/module/plugins/hoster/NarodRu.py +++ b/module/plugins/hoster/NarodRu.py @@ -12,7 +12,7 @@ class NarodRu(SimpleHoster): __type__ = "hoster" __version__ = "0.1" - __pattern__ = r'http://(?:www\.)?narod(\.yandex)?\.ru/(disk|start/[0-9]+\.\w+-narod\.yandex\.ru)/(?P<ID>\d+)/.+' + __pattern__ = r'http://(?:www\.)?narod(\.yandex)?\.ru/(disk|start/\d+\.\w+-narod\.yandex\.ru)/(?P<ID>\d+)/.+' __description__ = """Narod.ru hoster plugin""" __license__ = "GPLv3" @@ -25,7 +25,7 @@ class NarodRu(SimpleHoster): FILE_SIZE_REPLACEMENTS = [(u'КБ', 'KB'), (u'МБ', 'MB'), (u'ГБ', 'GB')] FILE_URL_REPLACEMENTS = [("narod.yandex.ru/", "narod.ru/"), - (r"/start/[0-9]+\.\w+-narod\.yandex\.ru/([0-9]{6,15})/\w+/(\w+)", r"/disk/\1/\2")] + (r"/start/\d+\.\w+-narod\.yandex\.ru/(\d{6,15})/\w+/(\w+)", r"/disk/\1/\2")] CAPTCHA_PATTERN = r'<number url="(.*?)">(\w+)</number>' LINK_PATTERN = r'<a class="h-link" rel="yandex_bar" href="(.+?)">' diff --git a/module/plugins/hoster/NosuploadCom.py b/module/plugins/hoster/NosuploadCom.py index d94593227..cd28baf19 100644 --- a/module/plugins/hoster/NosuploadCom.py +++ b/module/plugins/hoster/NosuploadCom.py @@ -19,7 +19,7 @@ class NosuploadCom(XFSPHoster): HOSTER_NAME = "nosupload.com" - FILE_SIZE_PATTERN = r'<p><strong>Size:</strong> (?P<S>[0-9\.]+) (?P<U>[kKMG]?B)</p>' + FILE_SIZE_PATTERN = r'<p><strong>Size:</strong> (?P<S>[\d.]+) (?P<U>\w+)</p>' LINK_PATTERN = r'<a class="select" href="(http://.+?)">Download</a>' WAIT_PATTERN = r'Please wait.*?>(\d+)</span>' diff --git a/module/plugins/hoster/NowDownloadEu.py b/module/plugins/hoster/NowDownloadEu.py index f3da3033f..2bde071ab 100644 --- a/module/plugins/hoster/NowDownloadEu.py +++ b/module/plugins/hoster/NowDownloadEu.py @@ -19,13 +19,13 @@ class NowDownloadEu(SimpleHoster): ("Walter Purcaro", "vuolter@gmail.com")] - FILE_INFO_PATTERN = r'Downloading</span> <br> (?P<N>.*) (?P<S>[0-9,.]+) (?P<U>[kKMG])i?B </h4>' + FILE_INFO_PATTERN = r'Downloading</span> <br> (?P<N>.*) (?P<S>[\d.,]+) (?P<U>\w+) </h4>' OFFLINE_PATTERN = r'(This file does not exist!)' - TOKEN_PATTERN = r'"(/api/token\.php\?token=[a-z0-9]+)"' - CONTINUE_PATTERN = r'"(/dl2/[a-z0-9]+/[a-z0-9]+)"' + TOKEN_PATTERN = r'"(/api/token\.php\?token=\w+)"' + CONTINUE_PATTERN = r'"(/dl2/\w+/\w+)"' WAIT_PATTERN = r'\.countdown\(\{until: \+(\d+),' - LINK_PATTERN = r'"(http://f\d+\.nowdownload\.ch/dl/[a-z0-9]+/[a-z0-9]+/[^<>"]*?)"' + LINK_PATTERN = r'"(http://f\d+\.nowdownload\.ch/dl/\w+/\w+)' FILE_NAME_REPLACEMENTS = [("&#?\w+;", fixup), (r'<[^>]*>', '')] diff --git a/module/plugins/hoster/PornhostCom.py b/module/plugins/hoster/PornhostCom.py index 94bbb426b..51426de71 100644 --- a/module/plugins/hoster/PornhostCom.py +++ b/module/plugins/hoster/PornhostCom.py @@ -10,7 +10,7 @@ class PornhostCom(Hoster): __type__ = "hoster" __version__ = "0.2" - __pattern__ = r'http://(?:www\.)?pornhost\.com/([0-9]+/[0-9]+\.html|[0-9]+)' + __pattern__ = r'http://(?:www\.)?pornhost\.com/(\d+/\d+\.html|\d+)' __description__ = """Pornhost.com hoster plugin""" __license__ = "GPLv3" @@ -38,11 +38,11 @@ class PornhostCom(Hoster): url = re.search(r'download this file</label>.*?<a href="(.*?)"', self.html) if url is None: - url = re.search(r'"(http://dl[0-9]+\.pornhost\.com/files/.*?/.*?/.*?/.*?/.*?/.*?\..*?)"', self.html) + url = re.search(r'"(http://dl\d+\.pornhost\.com/files/.*?/.*?/.*?/.*?/.*?/.*?\..*?)"', self.html) if url is None: url = re.search(r'width: 894px; height: 675px">.*?<img src="(.*?)"', self.html) if url is None: - url = re.search(r'"http://file[0-9]+\.pornhost\.com/[0-9]+/.*?"', + url = re.search(r'"http://file\d+\.pornhost\.com/\d+/.*?"', self.html) # TODO: fix this one since it doesn't match return url.group(1).strip() @@ -57,7 +57,7 @@ class PornhostCom(Hoster): if name is None: name = re.search(r'<title>pornhost\.com - free file hosting with a twist -(.*?)</title>', self.html) if name is None: - name = re.search(r'"http://file[0-9]+\.pornhost\.com/.*?/(.*?)"', self.html) + name = re.search(r'"http://file\d+\.pornhost\.com/.*?/(.*?)"', self.html) name = name.group(1).strip() + ".flv" diff --git a/module/plugins/hoster/PornhubCom.py b/module/plugins/hoster/PornhubCom.py index 12d47e3b7..fad915fb1 100644 --- a/module/plugins/hoster/PornhubCom.py +++ b/module/plugins/hoster/PornhubCom.py @@ -10,7 +10,7 @@ class PornhubCom(Hoster): __type__ = "hoster" __version__ = "0.5" - __pattern__ = r'http://(?:www\.)?pornhub\.com/view_video\.php\?viewkey=[\w\d]+' + __pattern__ = r'http://(?:www\.)?pornhub\.com/view_video\.php\?viewkey=\w+' __description__ = """Pornhub.com hoster plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hoster/QuickshareCz.py b/module/plugins/hoster/QuickshareCz.py index de8ae04af..441f08e4b 100644 --- a/module/plugins/hoster/QuickshareCz.py +++ b/module/plugins/hoster/QuickshareCz.py @@ -20,7 +20,7 @@ class QuickshareCz(SimpleHoster): FILE_NAME_PATTERN = r'<th width="145px">Název:</th>\s*<td style="word-wrap:break-word;">(?P<N>[^<]+)</td>' - FILE_SIZE_PATTERN = r'<th>Velikost:</th>\s*<td>(?P<S>[0-9.]+) (?P<U>[kKMG])i?B</td>' + FILE_SIZE_PATTERN = r'<th>Velikost:</th>\s*<td>(?P<S>[\d.]+) (?P<U>\w+)</td>' OFFLINE_PATTERN = r'<script type="text/javascript">location.href=\'/chyba\';</script>' @@ -29,7 +29,7 @@ class QuickshareCz(SimpleHoster): self.getFileInfo() # parse js variables - self.jsvars = dict((x, y.strip("'")) for x, y in re.findall(r"var (\w+) = ([0-9.]+|'[^']*')", self.html)) + self.jsvars = dict((x, y.strip("'")) for x, y in re.findall(r"var (\w+) = ([\d.]+|'[^']*')", self.html)) self.logDebug(self.jsvars) pyfile.name = self.jsvars['ID3'] diff --git a/module/plugins/hoster/RapidgatorNet.py b/module/plugins/hoster/RapidgatorNet.py index 0223af3c1..f1d59efea 100644 --- a/module/plugins/hoster/RapidgatorNet.py +++ b/module/plugins/hoster/RapidgatorNet.py @@ -29,7 +29,7 @@ class RapidgatorNet(SimpleHoster): API_URL = "http://rapidgator.net/api/file" FILE_NAME_PATTERN = r'<title>Download file (?P<N>.*)</title>' - FILE_SIZE_PATTERN = r'File size:\s*<strong>(?P<S>[\d\.]+) (?P<U>\w+)</strong>' + FILE_SIZE_PATTERN = r'File size:\s*<strong>(?P<S>[\d.]+) (?P<U>\w+)</strong>' OFFLINE_PATTERN = r'>(File not found|Error 404)' JSVARS_PATTERN = r"\s+var\s*(startTimerUrl|getDownloadUrl|captchaUrl|fid|secs)\s*=\s*'?(.*?)'?;" diff --git a/module/plugins/hoster/RapidshareCom.py b/module/plugins/hoster/RapidshareCom.py index 22887e7cc..88154b5e9 100644 --- a/module/plugins/hoster/RapidshareCom.py +++ b/module/plugins/hoster/RapidshareCom.py @@ -46,7 +46,7 @@ class RapidshareCom(Hoster): __type__ = "hoster" __version__ = "1.39" - __pattern__ = r'https?://(?:www\.)?rapidshare.com/(?:files/(?P<id>\d*?)/(?P<name>[^?]+)|#!download\|(?:\w+)\|(?P<id_new>\d+)\|(?P<name_new>[^|]+))' + __pattern__ = r'https?://(?:www\.)?rapidshare.com/(?:files/(?P<id>\d+)/(?P<name>[^?]+)|#!download\|(?:\w+)\|(?P<id_new>\d+)\|(?P<name_new>[^|]+))' __config__ = [("server", "Cogent;Deutsche Telekom;Level(3);Level(3) #2;GlobalCrossing;Level(3) #3;Teleglobe;GlobalCrossing #2;TeliaSonera #2;Teleglobe #2;TeliaSonera #3;TeliaSonera", "Preferred Server", "None")] diff --git a/module/plugins/hoster/RyushareCom.py b/module/plugins/hoster/RyushareCom.py index 833577c1a..4a5811581 100644 --- a/module/plugins/hoster/RyushareCom.py +++ b/module/plugins/hoster/RyushareCom.py @@ -25,7 +25,7 @@ class RyushareCom(XFSPHoster): HOSTER_NAME = "ryushare.com" - FILE_SIZE_PATTERN = r'You have requested <font color="red">[^<]+</font> \((?P<S>[\d\.]+) (?P<U>\w+)' + FILE_SIZE_PATTERN = r'You have requested <font color="red">[^<]+</font> \((?P<S>[\d.]+) (?P<U>\w+)' WAIT_PATTERN = r'You have to wait ((?P<hour>\d+) hour[s]?, )?((?P<min>\d+) minute[s], )?(?P<sec>\d+) second[s]' LINK_PATTERN = r'<a href="([^"]+)">Click here to download<' diff --git a/module/plugins/hoster/SendspaceCom.py b/module/plugins/hoster/SendspaceCom.py index b9907794d..834eff1a9 100644 --- a/module/plugins/hoster/SendspaceCom.py +++ b/module/plugins/hoster/SendspaceCom.py @@ -18,7 +18,7 @@ class SendspaceCom(SimpleHoster): FILE_NAME_PATTERN = r'<h2 class="bgray">\s*<(?:b|strong)>(?P<N>[^<]+)</' - FILE_SIZE_PATTERN = r'<div class="file_description reverse margin_center">\s*<b>File Size:</b>\s*(?P<S>[0-9.]+)(?P<U>[kKMG])i?B\s*</div>' + FILE_SIZE_PATTERN = r'<div class="file_description reverse margin_center">\s*<b>File Size:</b>\s*(?P<S>[\d.]+)(?P<U>\w+)\s*</div>' OFFLINE_PATTERN = r'<div class="msg error" style="cursor: default">Sorry, the file you requested is not available.</div>' LINK_PATTERN = r'<a id="download_button" href="([^"]+)"' diff --git a/module/plugins/hoster/ShareplaceCom.py b/module/plugins/hoster/ShareplaceCom.py index ef15f586a..84be2706f 100644 --- a/module/plugins/hoster/ShareplaceCom.py +++ b/module/plugins/hoster/ShareplaceCom.py @@ -12,7 +12,7 @@ class ShareplaceCom(Hoster): __type__ = "hoster" __version__ = "0.11" - __pattern__ = r'(http://)?(?:www\.)?shareplace\.(com|org)/\?[a-zA-Z0-9]+' + __pattern__ = r'(http://)?(?:www\.)?shareplace\.(com|org)/\?\w+' __description__ = """Shareplace.com hoster plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hoster/SoundcloudCom.py b/module/plugins/hoster/SoundcloudCom.py index 1fa1ec6ea..9305a2142 100644 --- a/module/plugins/hoster/SoundcloudCom.py +++ b/module/plugins/hoster/SoundcloudCom.py @@ -22,7 +22,7 @@ class SoundcloudCom(Hoster): # default UserAgent of HTTPRequest fails for this hoster so we use this one self.req.http.c.setopt(pycurl.USERAGENT, 'Mozilla/5.0') page = self.load(pyfile.url) - m = re.search(r'<div class="haudio.*?large.*?" data-sc-track="(?P<ID>[0-9]*)"', page) + m = re.search(r'<div class="haudio.*?large.*?" data-sc-track="(?P<ID>\d*)"', page) songId = clientId = "" if m: songId = m.group("ID") diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py index b56697da8..1eb3c98e9 100644 --- a/module/plugins/hoster/TurbobitNet.py +++ b/module/plugins/hoster/TurbobitNet.py @@ -28,7 +28,7 @@ class TurbobitNet(SimpleHoster): FILE_NAME_PATTERN = r'id="file-title">(?P<N>.+?)<' - FILE_SIZE_PATTERN = r'class="file-size">(?P<S>[\d,.]+) (?P<U>\w+)' + FILE_SIZE_PATTERN = r'class="file-size">(?P<S>[\d.,]+) (?P<U>\w+)' OFFLINE_PATTERN = r'<h2>File Not Found</h2>|html\(\'File (?:was )?not found' FILE_URL_REPLACEMENTS = [(__pattern__, "http://turbobit.net/\g<ID>.html")] diff --git a/module/plugins/hoster/TwoSharedCom.py b/module/plugins/hoster/TwoSharedCom.py index 4bef13a67..44c927f4b 100644 --- a/module/plugins/hoster/TwoSharedCom.py +++ b/module/plugins/hoster/TwoSharedCom.py @@ -18,7 +18,7 @@ class TwoSharedCom(SimpleHoster): FILE_NAME_PATTERN = r'<h1>(?P<N>.*)</h1>' - FILE_SIZE_PATTERN = r'<span class="dtitle">File size:</span>\s*(?P<S>[0-9,.]+) (?P<U>[kKMG])i?B' + FILE_SIZE_PATTERN = r'<span class="dtitle">File size:</span>\s*(?P<S>[\d.,]+) (?P<U>\w+)' OFFLINE_PATTERN = r'The file link that you requested is not valid\.|This file was deleted\.' LINK_PATTERN = r"window.location ='([^']+)';" diff --git a/module/plugins/hoster/UlozTo.py b/module/plugins/hoster/UlozTo.py index cf92560bc..9b6842ae7 100644 --- a/module/plugins/hoster/UlozTo.py +++ b/module/plugins/hoster/UlozTo.py @@ -26,10 +26,10 @@ class UlozTo(SimpleHoster): FILE_INFO_PATTERN = r'<p>File <strong>(?P<N>[^<]+)</strong> is password protected</p>' FILE_NAME_PATTERN = r'<title>(?P<N>[^<]+) \| Uloz.to</title>' - FILE_SIZE_PATTERN = r'<span id="fileSize">.*?(?P<S>[0-9.]+\s[kMG]?B)</span>' + FILE_SIZE_PATTERN = r'<span id="fileSize">.*?(?P<S>[\d.]+\s[kMG]?B)</span>' OFFLINE_PATTERN = r'<title>404 - Page not found</title>|<h1 class="h1">File (has been deleted|was banned)</h1>' - FILE_SIZE_REPLACEMENTS = [('([0-9.]+)\s([kMG])B', convertDecimalPrefix)] + FILE_SIZE_REPLACEMENTS = [('([\d.]+)\s([kMG])B', convertDecimalPrefix)] FILE_URL_REPLACEMENTS = [(r"(?<=http://)([^/]+)", "www.ulozto.net")] ADULT_PATTERN = r'<form action="(?P<link>[^\"]*)" method="post" id="frm-askAgeForm">' diff --git a/module/plugins/hoster/UloziskoSk.py b/module/plugins/hoster/UloziskoSk.py index 1ce7c8879..536830bd9 100644 --- a/module/plugins/hoster/UloziskoSk.py +++ b/module/plugins/hoster/UloziskoSk.py @@ -18,7 +18,7 @@ class UloziskoSk(SimpleHoster): FILE_NAME_PATTERN = r'<div class="down1">(?P<N>[^<]+)</div>' - FILE_SIZE_PATTERN = ur'Veľkosť súboru: <strong>(?P<S>[0-9.]+) (?P<U>[kKMG])i?B</strong><br />' + FILE_SIZE_PATTERN = ur'Veľkosť súboru: <strong>(?P<S>[\d.]+) (?P<U>\w+)</strong><br />' OFFLINE_PATTERN = ur'<span class = "red">Zadaný súbor neexistuje z jedného z nasledujúcich dôvodov:</span>' LINK_PATTERN = r'<form name = "formular" action = "([^"]+)" method = "post">' diff --git a/module/plugins/hoster/UnibytesCom.py b/module/plugins/hoster/UnibytesCom.py index ec6df395c..8e732d1fd 100644 --- a/module/plugins/hoster/UnibytesCom.py +++ b/module/plugins/hoster/UnibytesCom.py @@ -12,7 +12,7 @@ class UnibytesCom(SimpleHoster): __type__ = "hoster" __version__ = "0.1" - __pattern__ = r'http://(?:www\.)?unibytes\.com/[a-zA-Z0-9-._ ]{11}B' + __pattern__ = r'http://(?:www\.)?unibytes\.com/[\w .-]{11}B' __description__ = """UniBytes.com hoster plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hoster/UploadStationCom.py b/module/plugins/hoster/UploadStationCom.py index 7b3f4d55e..c8b0ca361 100644 --- a/module/plugins/hoster/UploadStationCom.py +++ b/module/plugins/hoster/UploadStationCom.py @@ -8,7 +8,7 @@ class UploadStationCom(DeadHoster): __type__ = "hoster" __version__ = "0.52" - __pattern__ = r'http://(?:www\.)?uploadstation\.com/file/(?P<id>[A-Za-z0-9]+)' + __pattern__ = r'http://(?:www\.)?uploadstation\.com/file/(?P<id>\w+)' __description__ = """UploadStation.com hoster plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hoster/UploadheroCom.py b/module/plugins/hoster/UploadheroCom.py index d22280102..ced5762ba 100644 --- a/module/plugins/hoster/UploadheroCom.py +++ b/module/plugins/hoster/UploadheroCom.py @@ -30,8 +30,8 @@ class UploadheroCom(SimpleHoster): IP_BLOCKED_PATTERN = r'href="(/lightbox_block_download.php\?min=.*?)"' IP_WAIT_PATTERN = r'<span id="minutes">(\d+)</span>.*\s*<span id="seconds">(\d+)</span>' - CAPTCHA_PATTERN = r'"(/captchadl\.php\?[a-z0-9]+)"' - FREE_URL_PATTERN = r'var magicomfg = \'<a href="(http://[^<>"]*?)"|"(http://storage\d+\.uploadhero\.co/\?d=[A-Za-z0-9]+/[^<>"/]+)"' + CAPTCHA_PATTERN = r'"(/captchadl\.php\?\w+)"' + FREE_URL_PATTERN = r'var magicomfg = \'<a href="(http://[^<>"]*?)"|"(http://storage\d+\.uploadhero\.co/\?d=\w+/[^<>"/]+)"' PREMIUM_URL_PATTERN = r'<a href="([^"]+)" id="downloadnow"' diff --git a/module/plugins/hoster/UploadingCom.py b/module/plugins/hoster/UploadingCom.py index 7033a364d..6a457602f 100644 --- a/module/plugins/hoster/UploadingCom.py +++ b/module/plugins/hoster/UploadingCom.py @@ -13,7 +13,7 @@ class UploadingCom(SimpleHoster): __type__ = "hoster" __version__ = "0.36" - __pattern__ = r'http://(?:www\.)?uploading\.com/files/(?:get/)?(?P<ID>[\w\d]+)' + __pattern__ = r'http://(?:www\.)?uploading\.com/files/(?:get/)?(?P<ID>\w+)' __description__ = """Uploading.com hoster plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hoster/VeehdCom.py b/module/plugins/hoster/VeehdCom.py index 50d24f4c9..f82d429d1 100644 --- a/module/plugins/hoster/VeehdCom.py +++ b/module/plugins/hoster/VeehdCom.py @@ -59,9 +59,9 @@ class VeehdCom(Hoster): # replace unwanted characters in filename if self.getConfig('filename_spaces'): - pattern = '[^0-9A-Za-z\.\ ]+' + pattern = '[^\w ]+' else: - pattern = '[^0-9A-Za-z\.]+' + pattern = '[^\w.]+' return re.sub(pattern, self.getConfig('replacement_char'), name) + '.avi' diff --git a/module/plugins/hoster/VidPlayNet.py b/module/plugins/hoster/VidPlayNet.py index 95ed386d7..6ac43ef6e 100644 --- a/module/plugins/hoster/VidPlayNet.py +++ b/module/plugins/hoster/VidPlayNet.py @@ -21,7 +21,6 @@ class VidPlayNet(XFSPHoster): HOSTER_NAME = "vidplay.net" FILE_NAME_PATTERN = r'<b>Password:</b></div>\s*<h[1-6]>(?P<N>[^<]+)</h[1-6]>' - LINK_PATTERN = r'(http://([^/]*?%s|\d+\.\d+\.\d+\.\d+)(:\d+)?(/d/|(?:/files)?/\d+/\w+/)[^"\'<&]+)' % HOSTER_NAME getInfo = create_getInfo(VidPlayNet) diff --git a/module/plugins/hoster/WrzucTo.py b/module/plugins/hoster/WrzucTo.py index 0a5d9bfb4..0076635e2 100644 --- a/module/plugins/hoster/WrzucTo.py +++ b/module/plugins/hoster/WrzucTo.py @@ -12,7 +12,7 @@ class WrzucTo(SimpleHoster): __type__ = "hoster" __version__ = "0.01" - __pattern__ = r'http://(?:www\.)?wrzuc\.to/([a-zA-Z0-9]+(\.wt|\.html)|(\w+/?linki/[a-zA-Z0-9]+))' + __pattern__ = r'http://(?:www\.)?wrzuc\.to/(\w+(\.wt|\.html)|(\w+/?linki/\w+))' __description__ = """Wrzuc.to hoster plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hoster/WuploadCom.py b/module/plugins/hoster/WuploadCom.py index 5b4e2318f..ba1356a29 100644 --- a/module/plugins/hoster/WuploadCom.py +++ b/module/plugins/hoster/WuploadCom.py @@ -8,7 +8,7 @@ class WuploadCom(DeadHoster): __type__ = "hoster" __version__ = "0.23" - __pattern__ = r'http://(?:www\.)?wupload\..*?/file/(([a-z][0-9]+/)?[0-9]+)(/.*)?' + __pattern__ = r'http://(?:www\.)?wupload\..*?/file/((\w+/)?\d+)(/.*)?' __description__ = """Wupload.com hoster plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hoster/XVideosCom.py b/module/plugins/hoster/XVideosCom.py index 6192782c8..a631a4dc3 100644 --- a/module/plugins/hoster/XVideosCom.py +++ b/module/plugins/hoster/XVideosCom.py @@ -12,7 +12,7 @@ class XVideosCom(Hoster): __type__ = "hoster" __version__ = "0.1" - __pattern__ = r'http://(?:www\.)?xvideos\.com/video([0-9]+)/.*' + __pattern__ = r'http://(?:www\.)?xvideos\.com/video(\d+)/.*' __description__ = """XVideos.com hoster plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hoster/YourfilesTo.py b/module/plugins/hoster/YourfilesTo.py index efbb927f0..4487a728a 100644 --- a/module/plugins/hoster/YourfilesTo.py +++ b/module/plugins/hoster/YourfilesTo.py @@ -12,7 +12,7 @@ class YourfilesTo(Hoster): __type__ = "hoster" __version__ = "0.21" - __pattern__ = r'(http://)?(?:www\.)?yourfiles\.(to|biz)/\?d=[a-zA-Z0-9]+' + __pattern__ = r'(http://)?(?:www\.)?yourfiles\.(to|biz)/\?d=\w+' __description__ = """Youfiles.to hoster plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hoster/ZDF.py b/module/plugins/hoster/ZDF.py index a59812271..83a3bd95c 100644 --- a/module/plugins/hoster/ZDF.py +++ b/module/plugins/hoster/ZDF.py @@ -13,7 +13,7 @@ class ZDF(Hoster): __type__ = "hoster" __version__ = "0.8" - __pattern__ = r'http://(?:www\.)?zdf\.de/ZDFmediathek/[^0-9]*([0-9]+)[^0-9]*' + __pattern__ = r'http://(?:www\.)?zdf\.de/ZDFmediathek/\D*(\d+)\D*' __description__ = """ZDF.de hoster plugin""" __license__ = "GPLv3" @@ -36,7 +36,7 @@ class ZDF(Hoster): @staticmethod def get_id(url): - return int(re.search(r"[^0-9]*([0-9]{4,})[^0-9]*", url).group(1)) + return int(re.search(r"\D*(\d{4,})\D*", url).group(1)) def process(self, pyfile): xml = fromstring(self.load(self.XML_API % self.get_id(pyfile.url))) diff --git a/module/plugins/internal/UnRar.py b/module/plugins/internal/UnRar.py index d95d55831..7478d68db 100644 --- a/module/plugins/internal/UnRar.py +++ b/module/plugins/internal/UnRar.py @@ -32,9 +32,9 @@ class UnRar(AbtractExtractor): CMD = "unrar" # there are some more uncovered rar formats - re_version = re.compile(r"(UNRAR 5[\.\d]+(.*?)freeware)") + re_version = re.compile(r"(UNRAR 5[\d.]+(.*?)freeware)") re_splitfile = re.compile(r"(.*)\.part(\d+)\.rar$", re.I) - re_partfiles = re.compile(r".*\.(rar|r[0-9]+)", re.I) + re_partfiles = re.compile(r".*\.(rar|r\d+)", re.I) re_filelist = re.compile(r"(.+)\s+(\d+)\s+(\d+)\s+") re_filelist5 = re.compile(r"(.+)\s+(\d+)\s+\d\d-\d\d-\d\d\s+\d\d:\d\d\s+(.+)") re_wrongpwd = re.compile("(Corrupt file or wrong password|password incorrect)", re.I) |