diff options
Diffstat (limited to 'module/plugins')
65 files changed, 68 insertions, 122 deletions
diff --git a/module/plugins/PluginManager.py b/module/plugins/PluginManager.py index 034e40d4a..c4f4f8924 100644 --- a/module/plugins/PluginManager.py +++ b/module/plugins/PluginManager.py @@ -21,7 +21,7 @@ class PluginManager: PATTERN = re.compile(r'__pattern__.*=.*r("|\')([^"\']+)') VERSION = re.compile(r'__version__.*=.*("|\')([\d.]+)') - CONFIG = re.compile(r'__config__.*=.*\[([^\]]+)', re.MULTILINE) + CONFIG = re.compile(r'__config__.*=.*\[([^\]]+)', re.M) DESC = re.compile(r'__description__.?=.?("|"""|\')([^"\']+)') diff --git a/module/plugins/accounts/FreakshareCom.py b/module/plugins/accounts/FreakshareCom.py index 2ee7a33ea..c03e2b047 100644 --- a/module/plugins/accounts/FreakshareCom.py +++ b/module/plugins/accounts/FreakshareCom.py @@ -20,12 +20,12 @@ class FreakshareCom(Account): page = req.load("http://freakshare.com/") validuntil = r'ltig bis:</td>\s*<td><b>([\d.:-]+)</b></td>' - validuntil = re.search(validuntil, page, re.MULTILINE) + validuntil = re.search(validuntil, page, re.M) validuntil = validuntil.group(1).strip() validuntil = mktime(strptime(validuntil, "%d.%m.%Y - %H:%M")) traffic = r'Traffic verbleibend:</td>\s*<td>([^<]+)' - traffic = re.search(traffic, page, re.MULTILINE) + traffic = re.search(traffic, page, re.M) traffic = traffic.group(1).strip() traffic = self.parseTraffic(traffic) diff --git a/module/plugins/accounts/UploadedTo.py b/module/plugins/accounts/UploadedTo.py index 147962838..55017eb30 100644 --- a/module/plugins/accounts/UploadedTo.py +++ b/module/plugins/accounts/UploadedTo.py @@ -24,7 +24,7 @@ class UploadedTo(Account): if premium: raw_traffic = re.search(r'<th colspan="2"><b class="cB">([^<]+)', html).group(1).replace('.', '') - raw_valid = re.search(r"<td>Duration:</td>\s*<th>([^<]+)", html, re.MULTILINE).group(1).strip() + raw_valid = re.search(r"<td>Duration:</td>\s*<th>([^<]+)", html, re.M).group(1).strip() traffic = int(self.parseTraffic(raw_traffic)) diff --git a/module/plugins/container/CCF.py b/module/plugins/container/CCF.py index 4d62be553..e64b0197f 100644 --- a/module/plugins/container/CCF.py +++ b/module/plugins/container/CCF.py @@ -36,7 +36,7 @@ class CCF(Container): tempdlc_name = save_join(download_folder, "tmp_%s.dlc" % pyfile.name) tempdlc = open(tempdlc_name, "w") - tempdlc.write(re.search(r'<dlc>(.*)</dlc>', tempdlc_content, re.DOTALL).group(1)) + tempdlc.write(re.search(r'<dlc>(.*)</dlc>', tempdlc_content, re.S).group(1)) tempdlc.close() self.urls = [tempdlc_name] diff --git a/module/plugins/crypter/CzshareComFolder.py b/module/plugins/crypter/CzshareComFolder.py index 9a3881617..2b4d736b7 100644 --- a/module/plugins/crypter/CzshareComFolder.py +++ b/module/plugins/crypter/CzshareComFolder.py @@ -23,7 +23,7 @@ class CzshareComFolder(Crypter): def decrypt(self, pyfile): html = self.load(pyfile.url) - m = re.search(self.FOLDER_PATTERN, html, re.DOTALL) + m = re.search(self.FOLDER_PATTERN, html, re.S) if m is None: self.fail("Parse error (FOLDER)") diff --git a/module/plugins/crypter/DuckCryptInfo.py b/module/plugins/crypter/DuckCryptInfo.py index 737ed59ec..54a2bd8b9 100644 --- a/module/plugins/crypter/DuckCryptInfo.py +++ b/module/plugins/crypter/DuckCryptInfo.py @@ -43,7 +43,7 @@ class DuckCryptInfo(Crypter): cryptlinks = soup.findAll("div", attrs={"class": "folderbox"}) self.logDebug("Redirectet to " + str(cryptlinks)) if not cryptlinks: - self.error("no links m") + self.error("No link found") for clink in cryptlinks: if clink.find("a"): self.handleLink(clink.find("a")['href']) diff --git a/module/plugins/crypter/FileserveComFolder.py b/module/plugins/crypter/FileserveComFolder.py index bdb07cbdc..fd4c28918 100644 --- a/module/plugins/crypter/FileserveComFolder.py +++ b/module/plugins/crypter/FileserveComFolder.py @@ -26,7 +26,7 @@ class FileserveComFolder(Crypter): new_links = [] - folder = re.search(self.FOLDER_PATTERN, html, re.DOTALL) + folder = re.search(self.FOLDER_PATTERN, html, re.S) if folder is None: self.fail("Parse error (FOLDER)") diff --git a/module/plugins/crypter/FreetexthostCom.py b/module/plugins/crypter/FreetexthostCom.py index 35ee7791c..402a04c22 100644 --- a/module/plugins/crypter/FreetexthostCom.py +++ b/module/plugins/crypter/FreetexthostCom.py @@ -18,7 +18,7 @@ class FreetexthostCom(SimpleCrypter): def getLinks(self): - m = re.search(r'<div id="contentsinner">\s*(.+)<div class="viewcount">', self.html, re.DOTALL) + m = re.search(r'<div id="contentsinner">\s*(.+)<div class="viewcount">', self.html, re.S) if m is None: self.fail('Unable to extract links | Plugin may be out-of-date') links = m.group(1) diff --git a/module/plugins/crypter/LetitbitNetFolder.py b/module/plugins/crypter/LetitbitNetFolder.py index c7f6fc738..7f1f8f3d0 100644 --- a/module/plugins/crypter/LetitbitNetFolder.py +++ b/module/plugins/crypter/LetitbitNetFolder.py @@ -24,7 +24,7 @@ class LetitbitNetFolder(Crypter): def decrypt(self, pyfile): html = self.load(pyfile.url) - folder = re.search(self.FOLDER_PATTERN, html, re.DOTALL) + folder = re.search(self.FOLDER_PATTERN, html, re.S) if folder is None: self.fail("Parse error (FOLDER)") diff --git a/module/plugins/crypter/LinkSaveIn.py b/module/plugins/crypter/LinkSaveIn.py index e601e8173..b22d87f38 100644 --- a/module/plugins/crypter/LinkSaveIn.py +++ b/module/plugins/crypter/LinkSaveIn.py @@ -125,7 +125,6 @@ class LinkSaveIn(SimpleCrypter): if self.captcha: if "Wrong code. Please retry" in self.html: - self.logDebug("Invalid captcha, retrying") self.invalidCaptcha() self.retry() else: @@ -140,7 +139,7 @@ class LinkSaveIn(SimpleCrypter): elif type_ == "web": return self.handleWebLinks() else: - self.error('unknown source type "%s" (this is probably a bug)' % type_) + self.error('Unknown source type "%s" (this is probably a bug)' % type_) def handleWebLinks(self): @@ -176,7 +175,7 @@ class LinkSaveIn(SimpleCrypter): type_ = type_.lower() self.logDebug("Seach for %s Container links" % type_.upper()) if not type_.isalnum(): # check to prevent broken re-pattern (cnl2,rsdf,ccf,dlc,web are all alpha-numeric) - self.error('unknown container type "%s" (this is probably a bug)' % type_) + self.error('Unknown container type "%s" (this is probably a bug)' % type_) pattern = r'\(\'%s_link\'\).href=unescape\(\'(.*?\.%s)\'\)' % (type_, type_) containersLinks = re.findall(pattern, self.html) self.logDebug("Found %d %s Container links" % (len(containersLinks), type_.upper())) diff --git a/module/plugins/crypter/LinkdecrypterCom.py b/module/plugins/crypter/LinkdecrypterCom.py index 0358d1308..98efd3d84 100644 --- a/module/plugins/crypter/LinkdecrypterCom.py +++ b/module/plugins/crypter/LinkdecrypterCom.py @@ -58,7 +58,7 @@ class LinkdecrypterCom(Crypter): self.html = self.load('http://linkdecrypter.com/', post=post_dict, cookies=True, decode=True) while self.passwords or retries: - m = re.search(self.TEXTAREA_PATTERN, self.html, flags=re.DOTALL) + m = re.search(self.TEXTAREA_PATTERN, self.html, flags=re.S) if m: return [x for x in m.group(1).splitlines() if '[LINK-ERROR]' not in x] diff --git a/module/plugins/crypter/LixIn.py b/module/plugins/crypter/LixIn.py index 32423e228..744066d19 100644 --- a/module/plugins/crypter/LixIn.py +++ b/module/plugins/crypter/LixIn.py @@ -27,7 +27,7 @@ class LixIn(Crypter): m = re.match(self.__pattern__, url) if m is None: - self.fail("couldn't identify file id") + self.error("Unable to identify file ID") id = m.group("ID") self.logDebug("File id is %s" % id) @@ -36,7 +36,7 @@ class LixIn(Crypter): m = re.search(self.SUBMIT_PATTERN, self.html) if m is None: - self.fail("link doesn't seem valid") + self.error("Link doesn't seem valid") m = re.search(self.CAPTCHA_PATTERN, self.html) if m: @@ -54,7 +54,7 @@ class LixIn(Crypter): m = re.search(self.LINK_PATTERN, self.html) if m is None: - self.fail("can't find destination url") + self.error("Unable to find destination url") else: self.urls = [m.group("link")] self.logDebug("Found link %s, adding to package" % self.urls[0]) diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py index 54b6eeba2..6c31a19f1 100644 --- a/module/plugins/crypter/NCryptIn.py +++ b/module/plugins/crypter/NCryptIn.py @@ -94,7 +94,7 @@ class NCryptIn(Crypter): r'<table class="global">(.*?)</table>', r'<iframe\s+style="display:none(.*?)</iframe>') for pattern in patterns: - rexpr = re.compile(pattern, re.DOTALL) + rexpr = re.compile(pattern, re.S) content = re.sub(rexpr, "", content) return content @@ -107,7 +107,7 @@ class NCryptIn(Crypter): def isProtected(self): - form = re.search(r'<form.*?name.*?protected.*?>(.*?)</form>', self.cleanedHtml, re.DOTALL) + form = re.search(r'<form.*?name.*?protected.*?>(.*?)</form>', self.cleanedHtml, re.S) if form is not None: content = form.group(1) for keyword in ("password", "captcha"): @@ -133,7 +133,7 @@ class NCryptIn(Crypter): def unlockProtection(self): postData = {} - form = re.search(r'<form name="protected"(.*?)</form>', self.cleanedHtml, re.DOTALL).group(1) + form = re.search(r'<form name="protected"(.*?)</form>', self.cleanedHtml, re.S).group(1) # Submit package password if "password" in form: @@ -181,7 +181,6 @@ class NCryptIn(Crypter): if self.protection_type == "captcha": if "The securitycheck was wrong!" in self.cleanedHtml: - self.logDebug("Invalid captcha, retrying") self.invalidCaptcha() self.retry() else: @@ -205,7 +204,7 @@ class NCryptIn(Crypter): elif link_source_type == "web": return self.handleWebLinks() else: - self.error('unknown source type "%s" (this is probably a bug)' % link_source_type) + self.error('Unknown source type "%s" (this is probably a bug)' % link_source_type) def handleSingleLink(self): diff --git a/module/plugins/crypter/QuickshareCzFolder.py b/module/plugins/crypter/QuickshareCzFolder.py index 60c2d1a40..c368353f7 100644 --- a/module/plugins/crypter/QuickshareCzFolder.py +++ b/module/plugins/crypter/QuickshareCzFolder.py @@ -23,7 +23,7 @@ class QuickshareCzFolder(Crypter): def decrypt(self, pyfile): html = self.load(pyfile.url) - m = re.search(self.FOLDER_PATTERN, html, re.DOTALL) + m = re.search(self.FOLDER_PATTERN, html, re.S) if m is None: self.fail("Parse error (FOLDER)") self.urls.extend(re.findall(self.LINK_PATTERN, m.group(1))) diff --git a/module/plugins/crypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py index b4ee31568..5c9d9e5ca 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -173,7 +173,6 @@ class RelinkUs(Crypter): if self.captcha: if self.CAPTCHA_ERROR_ROKEN in self.html: - self.logDebug("Invalid captcha, retrying") self.invalidCaptcha() self.retry() else: @@ -194,7 +193,7 @@ class RelinkUs(Crypter): def handleCNL2Links(self): self.logDebug("Search for CNL2 links") package_links = [] - m = re.search(self.CNL2_FORM_REGEX, self.html, re.DOTALL) + m = re.search(self.CNL2_FORM_REGEX, self.html, re.S) if m is not None: cnl2_form = m.group(1) try: @@ -248,11 +247,11 @@ class RelinkUs(Crypter): def _getCipherParams(self, cnl2_form): # Get jk jk_re = self.CNL2_FORMINPUT_REGEX % self.CNL2_JK_KEY - vjk = re.findall(jk_re, cnl2_form, re.IGNORECASE) + vjk = re.findall(jk_re, cnl2_form, re.I) # Get crypted crypted_re = self.CNL2_FORMINPUT_REGEX % RelinkUs.CNL2_CRYPTED_KEY - vcrypted = re.findall(crypted_re, cnl2_form, re.IGNORECASE) + vcrypted = re.findall(crypted_re, cnl2_form, re.I) # Log and return self.logDebug("Detected %d crypted blocks" % len(vcrypted)) diff --git a/module/plugins/crypter/SafelinkingNet.py b/module/plugins/crypter/SafelinkingNet.py index 9ef4529cb..fcc48ca22 100644 --- a/module/plugins/crypter/SafelinkingNet.py +++ b/module/plugins/crypter/SafelinkingNet.py @@ -31,7 +31,7 @@ class SafelinkingNet(Crypter): if re.match(self.__pattern__, url).group(1) == "d": self.req.http.c.setopt(FOLLOWLOCATION, 0) self.load(url) - m = re.search("^Location: (.+)$", self.req.http.header, re.MULTILINE) + m = re.search("^Location: (.+)$", self.req.http.header, re.M) if m: self.urls = [m.group(1)] else: diff --git a/module/plugins/crypter/ShareLinksBiz.py b/module/plugins/crypter/ShareLinksBiz.py index 126a7e5dc..bc79c5f70 100644 --- a/module/plugins/crypter/ShareLinksBiz.py +++ b/module/plugins/crypter/ShareLinksBiz.py @@ -121,7 +121,6 @@ class ShareLinksBiz(Crypter): # Resolve captcha href = self._resolveCoords(coords, captchaMap) if href is None: - self.logDebug("Invalid captcha resolving, retrying") self.invalidCaptcha() self.setWait(5, False) self.wait() @@ -154,7 +153,6 @@ class ShareLinksBiz(Crypter): if self.captcha: if "Your choice was wrong" in self.html: - self.logDebug("Invalid captcha, retrying") self.invalidCaptcha() self.setWait(5) self.wait() @@ -168,7 +166,7 @@ class ShareLinksBiz(Crypter): # Extract from web package header title_re = r'<h2><img.*?/>(.*)</h2>' - m = re.search(title_re, self.html, re.DOTALL) + m = re.search(title_re, self.html, re.S) if m is not None: title = m.group(1).strip() if 'unnamed' not in title: @@ -202,7 +200,7 @@ class ShareLinksBiz(Crypter): fwLink = self.baseUrl + "/get/frm/" + code response = self.load(fwLink) jscode = re.search(r'<script language="javascript">\s*eval\((.*)\)\s*</script>', response, - re.DOTALL).group(1) + re.S).group(1) jscode = self.js.eval("f = %s" % jscode) jslauncher = "window=''; parent={frames:{Main:{location:{href:''}}},location:''}; %s; parent.frames.Main.location.href" dlLink = self.js.eval(jslauncher % jscode) diff --git a/module/plugins/crypter/UlozToFolder.py b/module/plugins/crypter/UlozToFolder.py index bc8571f7c..241f382ad 100644 --- a/module/plugins/crypter/UlozToFolder.py +++ b/module/plugins/crypter/UlozToFolder.py @@ -27,7 +27,7 @@ class UlozToFolder(Crypter): new_links = [] for i in xrange(1, 100): self.logInfo("Fetching links from page %i" % i) - m = re.search(self.FOLDER_PATTERN, html, re.DOTALL) + m = re.search(self.FOLDER_PATTERN, html, re.S) if m is None: self.fail("Parse error (FOLDER)") diff --git a/module/plugins/hoster/BezvadataCz.py b/module/plugins/hoster/BezvadataCz.py index 9da1861ce..426b4f494 100644 --- a/module/plugins/hoster/BezvadataCz.py +++ b/module/plugins/hoster/BezvadataCz.py @@ -30,7 +30,7 @@ class BezvadataCz(SimpleHoster): #download button m = re.search(r'<a class="stahnoutSoubor".*?href="(.*?)"', self.html) if m is None: - self.error("page1 URL") + self.error("Page 1 URL") url = "http://bezvadata.cz%s" % m.group(1) #captcha form @@ -43,7 +43,7 @@ class BezvadataCz(SimpleHoster): m = re.search(r'<img src="data:image/png;base64,(.*?)"', self.html) if m is None: - self.error("captcha img") + self.error("Wrong captcha image") #captcha image is contained in html page as base64encoded data but decryptCaptcha() expects image url self.load, proper_load = self.loadcaptcha, self.load @@ -65,7 +65,7 @@ class BezvadataCz(SimpleHoster): self.checkErrors() m = re.search(r'<a class="stahnoutSoubor2" href="(.*?)">', self.html) if m is None: - self.error("page2 URL") + self.error("Page 2 URL") url = "http://bezvadata.cz%s" % m.group(1) self.logDebug("DL URL %s" % url) diff --git a/module/plugins/hoster/BitshareCom.py b/module/plugins/hoster/BitshareCom.py index fe2ff0be6..a7edf60f3 100644 --- a/module/plugins/hoster/BitshareCom.py +++ b/module/plugins/hoster/BitshareCom.py @@ -72,7 +72,6 @@ class BitshareCom(SimpleHoster): # This may either download our file or forward us to an error page url = self.getDownloadUrl() - self.logDebug("Downloading file with url [%s]" % url) self.download(url) check = self.checkDownload({"404": ">404 Not Found<", "Error": ">Error occured<"}) @@ -149,7 +148,7 @@ class BitshareCom(SimpleHoster): return True elif "ERROR:SESSION ERROR" in response: self.retry() - self.logDebug("Wrong captcha") + self.invalidCaptcha() diff --git a/module/plugins/hoster/CrockoCom.py b/module/plugins/hoster/CrockoCom.py index 00b102258..8fac72ef2 100644 --- a/module/plugins/hoster/CrockoCom.py +++ b/module/plugins/hoster/CrockoCom.py @@ -43,7 +43,7 @@ class CrockoCom(SimpleHoster): else: break - m = re.search(self.FORM_PATTERN, self.html, re.DOTALL) + m = re.search(self.FORM_PATTERN, self.html, re.S) if m is None: self.error('ACTION') diff --git a/module/plugins/hoster/CzshareCom.py b/module/plugins/hoster/CzshareCom.py index 2b8278a7e..be1c3ab97 100644 --- a/module/plugins/hoster/CzshareCom.py +++ b/module/plugins/hoster/CzshareCom.py @@ -66,7 +66,7 @@ class CzshareCom(SimpleHoster): def handlePremium(self): # parse download link try: - form = re.search(self.PREMIUM_FORM_PATTERN, self.html, re.DOTALL).group(1) + form = re.search(self.PREMIUM_FORM_PATTERN, self.html, re.S).group(1) inputs = dict(re.findall(self.FORM_INPUT_PATTERN, form)) except Exception, e: self.logError("Parse error (FORM): %s" % e) @@ -91,7 +91,7 @@ class CzshareCom(SimpleHoster): self.longWait(5 * 60, 12) try: - form = re.search(self.FREE_FORM_PATTERN, self.html, re.DOTALL).group(1) + form = re.search(self.FREE_FORM_PATTERN, self.html, re.S).group(1) inputs = dict(re.findall(self.FORM_INPUT_PATTERN, form)) self.pyfile.size = int(inputs['size']) except Exception, e: diff --git a/module/plugins/hoster/DateiTo.py b/module/plugins/hoster/DateiTo.py index 07033a203..1a2e78ef3 100644 --- a/module/plugins/hoster/DateiTo.py +++ b/module/plugins/hoster/DateiTo.py @@ -56,7 +56,6 @@ class DateiTo(SimpleHoster): self.fail('Too bad...') download_url = self.html - self.logDebug("Download URL", download_url) self.download(download_url) diff --git a/module/plugins/hoster/DevhostSt.py b/module/plugins/hoster/DevhostSt.py index 643538e4d..fce9e6387 100644 --- a/module/plugins/hoster/DevhostSt.py +++ b/module/plugins/hoster/DevhostSt.py @@ -38,7 +38,6 @@ class DevhostSt(SimpleHoster): self.error("Download link not found") dl_url = m.group(1) - self.logDebug("Download URL = " + dl_url) self.download(dl_url, disposition=True) check = self.checkDownload({'html': re.compile("html")}) diff --git a/module/plugins/hoster/ExtabitCom.py b/module/plugins/hoster/ExtabitCom.py index 489b2453e..15f8b5d1c 100644 --- a/module/plugins/hoster/ExtabitCom.py +++ b/module/plugins/hoster/ExtabitCom.py @@ -67,11 +67,12 @@ class ExtabitCom(SimpleHoster): self.error('JSON') self.html = self.load("http://extabit.com/file/%s%s" % (fileID, response['href'])) + m = re.search(self.LINK_PATTERN, self.html) if m is None: self.error('Download URL') + url = m.group(1) - self.logDebug("Download URL: " + url) self.download(url) diff --git a/module/plugins/hoster/FileSharkPl.py b/module/plugins/hoster/FileSharkPl.py index 20f0e1cc0..427ae9dcc 100644 --- a/module/plugins/hoster/FileSharkPl.py +++ b/module/plugins/hoster/FileSharkPl.py @@ -121,7 +121,6 @@ class FileSharkPl(SimpleHoster): if check == "DL-found": self.correctCaptcha() - self.logDebug("Captcha solved correct") elif check == "wrong_captcha": self.invalidCaptcha() diff --git a/module/plugins/hoster/FileStoreTo.py b/module/plugins/hoster/FileStoreTo.py index b8e56271b..28dc4a8fa 100644 --- a/module/plugins/hoster/FileStoreTo.py +++ b/module/plugins/hoster/FileStoreTo.py @@ -30,7 +30,6 @@ class FileStoreTo(SimpleHoster): self.wait(10) ldc = re.search(r'wert="(\w+)"', self.html).group(1) link = self.load("http://filestore.to/ajax/download.php", get={"LDC": ldc}) - self.logDebug("Download link = " + link) self.download(link) diff --git a/module/plugins/hoster/FilecloudIo.py b/module/plugins/hoster/FilecloudIo.py index 659a2cc0f..74652be04 100644 --- a/module/plugins/hoster/FilecloudIo.py +++ b/module/plugins/hoster/FilecloudIo.py @@ -93,14 +93,15 @@ class FilecloudIo(SimpleHoster): if response['dl']: self.html = self.load('http://filecloud.io/download.html') + m = re.search(self.LINK_PATTERN % self.file_info['ID'], self.html) if m is None: self.error("Download URL") - download_url = m.group(1) - self.logDebug("Download URL: %s" % download_url) if "size" in self.file_info and self.file_info['size']: self.check_data = {"size": int(self.file_info['size'])} + + download_url = m.group(1) self.download(download_url) else: self.fail("Unexpected server response") diff --git a/module/plugins/hoster/FilefactoryCom.py b/module/plugins/hoster/FilefactoryCom.py index dcb2fd8f0..f4729cf2f 100644 --- a/module/plugins/hoster/FilefactoryCom.py +++ b/module/plugins/hoster/FilefactoryCom.py @@ -81,7 +81,6 @@ class FilefactoryCom(SimpleHoster): elif 'content-disposition' in header: url = self.pyfile.url else: - self.logInfo('You could enable "Direct Downloads" on http://filefactory.com/account/') html = self.load(self.pyfile.url) m = re.search(self.LINK_PATTERN, html) if m: diff --git a/module/plugins/hoster/FilerNet.py b/module/plugins/hoster/FilerNet.py index e02f5a37c..9bb00ba92 100644 --- a/module/plugins/hoster/FilerNet.py +++ b/module/plugins/hoster/FilerNet.py @@ -73,7 +73,6 @@ class FilerNet(SimpleHoster): self.correctCaptcha() break else: - self.logInfo("Wrong captcha") self.invalidCaptcha() if not downloadURL: diff --git a/module/plugins/hoster/FileserveCom.py b/module/plugins/hoster/FileserveCom.py index 0f8372cf7..b3f197736 100644 --- a/module/plugins/hoster/FileserveCom.py +++ b/module/plugins/hoster/FileserveCom.py @@ -15,7 +15,7 @@ def checkFile(plugin, urls): html = getURL(plugin.URLS[1], post={"urls": "\n".join(urls)}, decode=True) file_info = [] - for li in re.finditer(plugin.LINKCHECK_TR, html, re.DOTALL): + for li in re.finditer(plugin.LINKCHECK_TR, html, re.S): try: cols = re.findall(plugin.LINKCHECK_TD, li.group(1)) if cols: @@ -160,12 +160,10 @@ class FileserveCom(Hoster): for _ in xrange(5): challenge, code = recaptcha.challenge(captcha_key) - response = json_loads(self.load(self.URLS[2], post={'recaptcha_challenge_field': challenge, 'recaptcha_response_field': code, 'recaptcha_shortencode_field': self.file_id})) - self.logDebug("reCaptcha response : %s" % response) if not response['success']: self.invalidCaptcha() else: diff --git a/module/plugins/hoster/FlyFilesNet.py b/module/plugins/hoster/FlyFilesNet.py index 6aa5ecf28..8c5c95839 100644 --- a/module/plugins/hoster/FlyFilesNet.py +++ b/module/plugins/hoster/FlyFilesNet.py @@ -42,5 +42,4 @@ class FlyFilesNet(SimpleHoster): download_url = parsed_url.replace('#downlink|', '') - self.logDebug("Download URL: %s" % download_url) self.download(download_url) diff --git a/module/plugins/hoster/GigapetaCom.py b/module/plugins/hoster/GigapetaCom.py index 65d940c5a..b606322cf 100644 --- a/module/plugins/hoster/GigapetaCom.py +++ b/module/plugins/hoster/GigapetaCom.py @@ -52,7 +52,6 @@ class GigapetaCom(SimpleHoster): self.fail("No valid captcha code entered") self.req.http.c.setopt(FOLLOWLOCATION, 1) - self.logDebug("Download URL: %s" % download_url) self.download(download_url) diff --git a/module/plugins/hoster/HellshareCz.py b/module/plugins/hoster/HellshareCz.py index 7a8579e78..8809da5ef 100644 --- a/module/plugins/hoster/HellshareCz.py +++ b/module/plugins/hoster/HellshareCz.py @@ -40,9 +40,8 @@ class HellshareCz(SimpleHoster): m = re.search(self.SHOW_WINDOW_PATTERN, self.html) if m is None: self.error('SHOW WINDOW') - self.url = "http://www.hellshare.com" + m.group(1) - self.logDebug("DOWNLOAD URL: " + self.url) + self.url = "http://www.hellshare.com" + m.group(1) self.download(self.url) diff --git a/module/plugins/hoster/IfolderRu.py b/module/plugins/hoster/IfolderRu.py index 176225e30..93b8948de 100644 --- a/module/plugins/hoster/IfolderRu.py +++ b/module/plugins/hoster/IfolderRu.py @@ -70,7 +70,6 @@ class IfolderRu(SimpleHoster): download_url = re.search(self.LINK_PATTERN, self.html).group(1) self.correctCaptcha() - self.logDebug("Download URL: %s" % download_url) self.download(download_url) diff --git a/module/plugins/hoster/JumbofilesCom.py b/module/plugins/hoster/JumbofilesCom.py index f43ee7697..40f234673 100644 --- a/module/plugins/hoster/JumbofilesCom.py +++ b/module/plugins/hoster/JumbofilesCom.py @@ -31,7 +31,6 @@ class JumbofilesCom(SimpleHoster): post_data = {"id": ukey, "op": "download3", "rand": ""} html = self.load(self.pyfile.url, post=post_data, decode=True) url = re.search(self.LINK_PATTERN, html).group(1) - self.logDebug("Download " + url) self.download(url) diff --git a/module/plugins/hoster/Keep2shareCC.py b/module/plugins/hoster/Keep2shareCC.py index a56ac36da..d6258bb06 100644 --- a/module/plugins/hoster/Keep2shareCC.py +++ b/module/plugins/hoster/Keep2shareCC.py @@ -38,7 +38,7 @@ class Keep2shareCC(SimpleHoster): self.fid = re.search(r'<input type="hidden" name="slow_id" value="([^"]+)">', self.html).group(1) self.html = self.load(self.pyfile.url, post={'yt0': '', 'slow_id': self.fid}) - m = re.search(r"function download\(\){.*window\.location\.href = '([^']+)';", self.html, re.DOTALL) + m = re.search(r"function download\(\){.*window\.location\.href = '([^']+)';", self.html, re.S) if m: # Direct mode self.startDownload(m.group(1)) else: @@ -94,7 +94,6 @@ class Keep2shareCC(SimpleHoster): self.correctCaptcha() break else: - self.logInfo("Wrong captcha") self.invalidCaptcha() else: self.fail("All captcha attempts failed") diff --git a/module/plugins/hoster/KingfilesNet.py b/module/plugins/hoster/KingfilesNet.py index 223241f5a..b4e393c37 100644 --- a/module/plugins/hoster/KingfilesNet.py +++ b/module/plugins/hoster/KingfilesNet.py @@ -53,7 +53,7 @@ class KingfilesNet(SimpleHoster): self.error("Random key not found") rand = m.group(1) - self.logDebug("rand", rand) + self.logDebug("rand = ", rand) post_data = {'op': "download2", 'id': file_id, diff --git a/module/plugins/hoster/LetitbitNet.py b/module/plugins/hoster/LetitbitNet.py index 9357cc758..983a50c6c 100644 --- a/module/plugins/hoster/LetitbitNet.py +++ b/module/plugins/hoster/LetitbitNet.py @@ -71,7 +71,7 @@ class LetitbitNet(SimpleHoster): def handleFree(self): action, inputs = self.parseHtmlForm('id="ifree_form"') if not action: - self.error("page 1 / ifree_form") + self.error("ifree_form") domain = "http://www." + self.HOSTER_NAME self.pyfile.size = float(inputs['sssize']) @@ -80,22 +80,6 @@ class LetitbitNet(SimpleHoster): self.html = self.load(domain + action, post=inputs, cookies=True) - # action, inputs = self.parseHtmlForm('id="d3_form"') - # if not action: - # self.error("page 2 / d3_form") - # self.logDebug(action, inputs) - # - # self.html = self.load(action, post = inputs, cookies = True) - # - # try: - # ajax_check_url, captcha_url = re.search(self.CHECK_URL_PATTERN, self.html).groups() - # m = re.search(self.SECONDS_PATTERN, self.html) - # seconds = int(m.group(1)) if m else 60 - # self.wait(seconds+1) - # except Exception, e: - # self.logError(e) - # self.error("page 3 / js") - m = re.search(self.SECONDS_PATTERN, self.html) seconds = int(m.group(1)) if m else 60 self.logDebug("Seconds found", seconds) @@ -106,7 +90,7 @@ class LetitbitNet(SimpleHoster): response = self.load("%s/ajax/download3.php" % domain, post=" ", cookies=True) if response != '1': - self.error('Unknown response - ajax_check_url') + self.error("Unknown response - ajax_check_url") self.logDebug(response) recaptcha = ReCaptcha(self) @@ -123,7 +107,6 @@ class LetitbitNet(SimpleHoster): self.logWarning("Daily limit reached") self.wait(secondsToMidnight(gmt=2), True) if response == "error_wrong_captcha": - self.logError("Wrong Captcha") self.invalidCaptcha() self.retry() elif response.startswith('['): @@ -137,7 +120,6 @@ class LetitbitNet(SimpleHoster): for download_url in urls: try: - self.logDebug("Download URL", download_url) self.download(download_url) break except Exception, e: diff --git a/module/plugins/hoster/LoadTo.py b/module/plugins/hoster/LoadTo.py index a28428b73..53227baf1 100644 --- a/module/plugins/hoster/LoadTo.py +++ b/module/plugins/hoster/LoadTo.py @@ -62,7 +62,6 @@ class LoadTo(SimpleHoster): self.download(download_url, post={"adcopy_challenge": captcha_challenge, "adcopy_response": captcha_response}) check = self.checkDownload({'404': re.compile("\A<h1>404 Not Found</h1>"), 'html': re.compile("html")}) if check == "404": - self.logWarning("The captcha you entered was incorrect. Please try again.") self.invalidCaptcha() self.retry() elif check == "html": diff --git a/module/plugins/hoster/LuckyShareNet.py b/module/plugins/hoster/LuckyShareNet.py index 5e1b6bf60..e76105944 100644 --- a/module/plugins/hoster/LuckyShareNet.py +++ b/module/plugins/hoster/LuckyShareNet.py @@ -62,7 +62,6 @@ class LuckyShareNet(SimpleHoster): self.correctCaptcha() break elif 'Verification failed' in rep: - self.logInfo("Wrong captcha") self.invalidCaptcha() else: self.error('Unable to get downlaod link') diff --git a/module/plugins/hoster/MediafireCom.py b/module/plugins/hoster/MediafireCom.py index 20ca6753d..9f30b5761 100644 --- a/module/plugins/hoster/MediafireCom.py +++ b/module/plugins/hoster/MediafireCom.py @@ -108,9 +108,8 @@ class MediafireCom(SimpleHoster): m = re.search(r'kNO = r"(http://.*?)";', self.html) if m is None: self.error("Download URL") - download_url = m.group(1) - self.logDebug("DOWNLOAD LINK:", download_url) + download_url = m.group(1) self.download(download_url) diff --git a/module/plugins/hoster/NarodRu.py b/module/plugins/hoster/NarodRu.py index f70ff9622..0a99526f4 100644 --- a/module/plugins/hoster/NarodRu.py +++ b/module/plugins/hoster/NarodRu.py @@ -54,7 +54,6 @@ class NarodRu(SimpleHoster): else: self.fail("No valid captcha code entered") - self.logDebug("Download link: " + url) self.download(url) diff --git a/module/plugins/hoster/NetloadIn.py b/module/plugins/hoster/NetloadIn.py index 800de3068..ffacc9c66 100644 --- a/module/plugins/hoster/NetloadIn.py +++ b/module/plugins/hoster/NetloadIn.py @@ -161,7 +161,7 @@ class NetloadIn(Hoster): if "* The file was deleted" in page: self.offline() - name = re.search(r'class="dl_first_filename">([^<]+)', page, re.MULTILINE) + name = re.search(r'class="dl_first_filename">([^<]+)', page, re.M) # the found filename is not truncated if name: name = name.group(1).strip() diff --git a/module/plugins/hoster/NosuploadCom.py b/module/plugins/hoster/NosuploadCom.py index 19d851b0a..7416f82bc 100644 --- a/module/plugins/hoster/NosuploadCom.py +++ b/module/plugins/hoster/NosuploadCom.py @@ -31,7 +31,7 @@ class NosuploadCom(XFSPHoster): # stage2: wait some time and press the "Download File" button data = self.getPostParameters() - wait_time = re.search(self.WAIT_PATTERN, self.html, re.MULTILINE | re.DOTALL).group(1) + wait_time = re.search(self.WAIT_PATTERN, self.html, re.M | re.S).group(1) self.logDebug("Hoster told us to wait %s seconds" % wait_time) self.wait(wait_time) self.html = self.load(self.pyfile.url, post=data, ref=True, decode=True) diff --git a/module/plugins/hoster/NowDownloadEu.py b/module/plugins/hoster/NowDownloadEu.py index 256b2c801..59ca68258 100644 --- a/module/plugins/hoster/NowDownloadEu.py +++ b/module/plugins/hoster/NowDownloadEu.py @@ -56,7 +56,7 @@ class NowDownloadEu(SimpleHoster): url = re.search(self.LINK_PATTERN, self.html) if url is None: self.error("Download link not found") - self.logDebug("Download link", url.group(1)) + self.download(str(url.group(1))) diff --git a/module/plugins/hoster/RemixshareCom.py b/module/plugins/hoster/RemixshareCom.py index 94be78b4f..38c55afc3 100644 --- a/module/plugins/hoster/RemixshareCom.py +++ b/module/plugins/hoster/RemixshareCom.py @@ -55,7 +55,6 @@ class RemixshareCom(SimpleHoster): self.wait(seconds.group(1)) # Finally start downloading... - self.logDebug("Download URL = r" + dl_url) self.download(dl_url, disposition=True) diff --git a/module/plugins/hoster/RyushareCom.py b/module/plugins/hoster/RyushareCom.py index 1acc1fd58..510229fe8 100644 --- a/module/plugins/hoster/RyushareCom.py +++ b/module/plugins/hoster/RyushareCom.py @@ -68,7 +68,6 @@ class RyushareCom(XFSPHoster): self.html = self.load(self.pyfile.url, post=inputs) if "WRONG CAPTCHA" in self.html: self.invalidCaptcha() - self.logInfo("Invalid Captcha") else: self.correctCaptcha() break diff --git a/module/plugins/hoster/SendspaceCom.py b/module/plugins/hoster/SendspaceCom.py index 85fa196a3..f8e720070 100644 --- a/module/plugins/hoster/SendspaceCom.py +++ b/module/plugins/hoster/SendspaceCom.py @@ -54,7 +54,6 @@ class SendspaceCom(SimpleHoster): else: self.fail("Download link not found") - self.logDebug("Download URL: %s" % download_url) self.download(download_url) diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py index 565e0364a..4d3697a09 100644 --- a/module/plugins/hoster/ShareonlineBiz.py +++ b/module/plugins/hoster/ShareonlineBiz.py @@ -123,9 +123,8 @@ class ShareonlineBiz(Hoster): self.fail("No valid captcha solution received") download_url = response.decode("base64") - self.logDebug(download_url) if not download_url.startswith("http://"): - self.error("download url") + self.error("Wrong download url") self.wait() self.download(download_url) diff --git a/module/plugins/hoster/ShareplaceCom.py b/module/plugins/hoster/ShareplaceCom.py index bef14de0f..7f2a95dfe 100644 --- a/module/plugins/hoster/ShareplaceCom.py +++ b/module/plugins/hoster/ShareplaceCom.py @@ -68,7 +68,7 @@ class ShareplaceCom(Hoster): self.logDebug("URL: %s" % url) return url else: - self.fail("absolute filepath could not be found. offline? ") + self.error("Absolute filepath not found") def get_file_name(self): diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py index d0b441fa2..c1029ff70 100644 --- a/module/plugins/hoster/TurbobitNet.py +++ b/module/plugins/hoster/TurbobitNet.py @@ -67,7 +67,7 @@ class TurbobitNet(SimpleHoster): action, inputs = self.parseHtmlForm("action='#'") if not inputs: - self.error("captcha form") + self.error("Captcha form not found") self.logDebug(inputs) if inputs['captcha_type'] == 'recaptcha': @@ -84,7 +84,6 @@ class TurbobitNet(SimpleHoster): self.html = self.load(self.url, post=inputs) if '<div class="captcha-error">Incorrect, try again!<' in self.html: - self.logInfo("Invalid captcha") self.invalidCaptcha() else: self.correctCaptcha() @@ -106,7 +105,6 @@ class TurbobitNet(SimpleHoster): r'zza=\2;for(var zzi=0;zzi<zza.length;zzi++){\1=zza[zzi];', rtUpdate) rtUpdate = re.sub(r"for\((\w+)=", r"for(var \1=", rtUpdate) - self.logDebug("rtUpdate") self.setStorage("rtUpdate", rtUpdate) self.setStorage("timestamp", timestamp()) self.setStorage("version", self.__version__) diff --git a/module/plugins/hoster/TwoSharedCom.py b/module/plugins/hoster/TwoSharedCom.py index e1cdead9b..ee48556d4 100644 --- a/module/plugins/hoster/TwoSharedCom.py +++ b/module/plugins/hoster/TwoSharedCom.py @@ -32,9 +32,8 @@ class TwoSharedCom(SimpleHoster): m = re.search(self.LINK_PATTERN, self.html) if m is None: self.error('Download link') - link = m.group(1) - self.logDebug("Download URL %s" % link) + link = m.group(1) self.download(link) diff --git a/module/plugins/hoster/UlozTo.py b/module/plugins/hoster/UlozTo.py index 9b70c8efa..7b57a0d02 100644 --- a/module/plugins/hoster/UlozTo.py +++ b/module/plugins/hoster/UlozTo.py @@ -86,7 +86,7 @@ class UlozTo(SimpleHoster): def handleFree(self): action, inputs = self.parseHtmlForm('id="frm-downloadDialog-freeDownloadForm"') if not action or not inputs: - self.error("free download form") + self.error("Free download form not found") self.logDebug("inputs.keys = " + str(inputs.keys())) # get and decrypt captcha diff --git a/module/plugins/hoster/UnibytesCom.py b/module/plugins/hoster/UnibytesCom.py index 8e732d1fd..d2588b95f 100644 --- a/module/plugins/hoster/UnibytesCom.py +++ b/module/plugins/hoster/UnibytesCom.py @@ -64,7 +64,6 @@ class UnibytesCom(SimpleHoster): else: self.fail("No valid captcha code entered") - self.logDebug("Download link: " + url) self.req.http.c.setopt(FOLLOWLOCATION, 1) self.download(url) diff --git a/module/plugins/hoster/UploadedTo.py b/module/plugins/hoster/UploadedTo.py index 055047859..69148efbf 100644 --- a/module/plugins/hoster/UploadedTo.py +++ b/module/plugins/hoster/UploadedTo.py @@ -226,7 +226,6 @@ class UploadedTo(Hoster): self.wait() self.retry() elif '"err":"captcha"' in result: - self.logError("captcha is disabled") self.invalidCaptcha() elif "type:'download'" in result: self.correctCaptcha() diff --git a/module/plugins/hoster/UploadheroCom.py b/module/plugins/hoster/UploadheroCom.py index f2bcaea6a..2ae3cb992 100644 --- a/module/plugins/hoster/UploadheroCom.py +++ b/module/plugins/hoster/UploadheroCom.py @@ -62,7 +62,6 @@ class UploadheroCom(SimpleHoster): def handlePremium(self): self.logDebug("%s: Use Premium Account" % self.__name__) link = re.search(self.PREMIUM_URL_PATTERN, self.html).group(1) - self.logDebug("Downloading link : '%s'" % link) self.download(link) diff --git a/module/plugins/hoster/UpstoreNet.py b/module/plugins/hoster/UpstoreNet.py index 2e500dc01..3695f0c6d 100644 --- a/module/plugins/hoster/UpstoreNet.py +++ b/module/plugins/hoster/UpstoreNet.py @@ -30,7 +30,7 @@ class UpstoreNet(SimpleHoster): # STAGE 1: get link to continue m = re.search(self.CHASH_PATTERN, self.html) if m is None: - self.error("could not detect hash") + self.error("Unable to detect hash") chash = m.group(1) self.logDebug("Read hash " + chash) # continue to stage2 @@ -45,7 +45,7 @@ class UpstoreNet(SimpleHoster): for i in xrange(5): m = re.search(self.WAIT_PATTERN, self.html) if m is None: - self.error("could not find wait pattern") + self.error("Wait pattern not found") wait_time = m.group(1) # then, do the waiting @@ -59,15 +59,14 @@ class UpstoreNet(SimpleHoster): self.html = self.load(self.pyfile.url, post=post_data, decode=True) # STAGE 3: get direct link - m = re.search(self.LINK_PATTERN, self.html, re.DOTALL) + m = re.search(self.LINK_PATTERN, self.html, re.S) if m: break if m is None: - self.error("could not detect direct link") + self.error("Download link not found") direct = m.group(1) - self.logDebug("Found direct link: " + direct) self.download(direct, disposition=True) diff --git a/module/plugins/hoster/VeehdCom.py b/module/plugins/hoster/VeehdCom.py index 47f95ed41..0283674d1 100644 --- a/module/plugins/hoster/VeehdCom.py +++ b/module/plugins/hoster/VeehdCom.py @@ -58,7 +58,7 @@ class VeehdCom(Hoster): m = re.search(r'<title[^>]*>([^<]+) on Veehd</title>', self.html) if m is None: - self.fail("video title not found") + self.error("Video title not found") name = m.group(1) @@ -80,6 +80,6 @@ class VeehdCom(Hoster): m = re.search(r'<embed type="video/divx" src="(http://([^/]*\.)?veehd\.com/dl/[^"]+)"', self.html) if m is None: - self.fail("embedded video url not found") + self.error("Embedded video url not found") return m.group(1) diff --git a/module/plugins/hoster/VeohCom.py b/module/plugins/hoster/VeohCom.py index f35ed2510..8863750e0 100644 --- a/module/plugins/hoster/VeohCom.py +++ b/module/plugins/hoster/VeohCom.py @@ -41,7 +41,6 @@ class VeohCom(SimpleHoster): if m: self.pyfile.name += ".mp4" link = m.group(1).replace("\\", "") - self.logDebug("Download link: " + link) self.download(link) return else: diff --git a/module/plugins/hoster/WrzucTo.py b/module/plugins/hoster/WrzucTo.py index 896da1c1b..b3b917018 100644 --- a/module/plugins/hoster/WrzucTo.py +++ b/module/plugins/hoster/WrzucTo.py @@ -46,7 +46,6 @@ class WrzucTo(SimpleHoster): self.error('Download URL') download_url = "http://%s.wrzuc.to/pobierz/%s" % (data['server_id'], data['download_link']) - self.logDebug("Download URL: %s" % download_url) self.download(download_url) diff --git a/module/plugins/hoster/XHamsterCom.py b/module/plugins/hoster/XHamsterCom.py index 7257b2988..9b97b5e94 100644 --- a/module/plugins/hoster/XHamsterCom.py +++ b/module/plugins/hoster/XHamsterCom.py @@ -53,7 +53,7 @@ class XHamsterCom(Hoster): if not self.html: self.download_html() - flashvar_pattern = re.compile('flashvars = ({.*?});', re.DOTALL) + flashvar_pattern = re.compile('flashvars = ({.*?});', re.S) json_flashvar = flashvar_pattern.search(self.html) if not json_flashvar: @@ -80,7 +80,7 @@ class XHamsterCom(Hoster): self.fail("Parse error (file_url)") file_url = file_url.group(1) long_url = srv_url + file_url - self.logDebug("long_url: %s" % long_url) + self.logDebug("long_url = " + long_url) else: if flashvars['file']: file_url = unquote(flashvars['file']) @@ -89,10 +89,10 @@ class XHamsterCom(Hoster): if url_mode == '3': long_url = file_url - self.logDebug("long_url: %s" % long_url) + self.logDebug("long_url = " + long_url) else: long_url = srv_url + "key=" + file_url - self.logDebug("long_url: %s" % long_url) + self.logDebug("long_url = " + long_url) return long_url diff --git a/module/plugins/hoster/YourfilesTo.py b/module/plugins/hoster/YourfilesTo.py index 9de5929ff..38cae4deb 100644 --- a/module/plugins/hoster/YourfilesTo.py +++ b/module/plugins/hoster/YourfilesTo.py @@ -66,7 +66,7 @@ class YourfilesTo(Hoster): url = unquote(url.replace("http://http:/http://", "http://").replace("dumdidum", "")) return url else: - self.fail("absolute filepath could not be found. offline? ") + self.error("Absolute filepath not found") def get_file_name(self): diff --git a/module/plugins/hoster/ZippyshareCom.py b/module/plugins/hoster/ZippyshareCom.py index 3cc52744f..b73113040 100644 --- a/module/plugins/hoster/ZippyshareCom.py +++ b/module/plugins/hoster/ZippyshareCom.py @@ -36,7 +36,6 @@ class ZippyshareCom(SimpleHoster): def handleFree(self): url = self.get_link() - self.logDebug("Download URL: %s" % url) self.download(url) diff --git a/module/plugins/internal/UnRar.py b/module/plugins/internal/UnRar.py index 7478d68db..d8bb6f251 100644 --- a/module/plugins/internal/UnRar.py +++ b/module/plugins/internal/UnRar.py @@ -168,9 +168,9 @@ class UnRar(AbtractExtractor): def getDeleteFiles(self): if ".part" in basename(self.file): - return glob(re.sub("(?<=\.part)([01]+)", "*", self.file, re.IGNORECASE)) + return glob(re.sub("(?<=\.part)([01]+)", "*", self.file, re.I)) # get files which matches .r* and filter unsuited files out - parts = glob(re.sub(r"(?<=\.r)ar$", "*", self.file, re.IGNORECASE)) + parts = glob(re.sub(r"(?<=\.r)ar$", "*", self.file, re.I)) return filter(lambda x: self.re_partfiles.match(x), parts) |