diff options
Diffstat (limited to 'module/plugins')
-rw-r--r-- | module/plugins/crypter/Movie2kTo.py | 37 | ||||
-rw-r--r-- | module/plugins/crypter/SerienjunkiesOrg.py | 4 | ||||
-rw-r--r-- | module/plugins/hoster/ExtabitCom.py | 33 | ||||
-rw-r--r-- | module/plugins/hoster/UploadedTo.py | 6 |
4 files changed, 43 insertions, 37 deletions
diff --git a/module/plugins/crypter/Movie2kTo.py b/module/plugins/crypter/Movie2kTo.py index f5800b498..f2c5ece55 100644 --- a/module/plugins/crypter/Movie2kTo.py +++ b/module/plugins/crypter/Movie2kTo.py @@ -9,11 +9,12 @@ class Movie2kTo(Crypter): __name__ = 'Movie2kTo' __type__ = 'container' __pattern__ = r'http://(?:www\.)?movie2k\.to/(.*)\.html' - __version__ = '0.3' - __config__ = [('accepted_hosters', 'str', 'List of accepted hosters', 'Xvidstage, '), + __version__ = '0.4' + __config__ = [('accepted_hosters', 'str', 'List of accepted hosters', 'Xvidstage, Putlocker, '), + ('dir_quality', 'bool', 'Show the quality of the footage in the folder name', 'True'), ('whole_season', 'bool', 'Download whole season', 'False'), ('everything', 'bool', 'Download everything', 'False'), - ('firstN', 'int', 'Download the first N files for each episode. The first file is probably all you will need.', '1')] + ('firstN', 'int', 'Download the first N files for each episode (the first file is probably all you will need)', '1')] __description__ = """Movie2k.to Container Plugin""" __author_name__ = ('4Christopher') __author_mail__ = ('4Christopher@gmx.de') @@ -47,21 +48,26 @@ class Movie2kTo(Crypter): season_links += self.getInfoAndLinks('%s/%s' % (self.BASE_URL, url_path)) self.logDebug(season_links) - self.packages.append(('%s: Season %s (%s)' - % (self.name, season, self.qStat()), season_links, 'Season %s' % season)) + folder = '%s: Season %s' % (self.name, season) + name = '%s%s' % (folder, self.qStat()) + self.packages.append((name, season_links, folder)) self.qStatReset() else: links = self.getLinks() - self.package.name = '%s%s' % (self.package.name, self.qStat()) - self.packages.append((self.package.name, links , self.package.folder)) + name = '%s%s' % (self.package.name, self.qStat()) + self.packages.append((name, links , self.package.folder)) def qStat(self): if len(self.q) == 0: return '' + if not self.getConfig('dir_quality'): return '' + if len(self.q) == 1: return (' (Quality: %d, max (all hosters): %d)' % (self.q[0], self.max_q)) return (' (Average quality: %d, min: %d, max: %d, %s, max (all hosters): %d)' % (sum(self.q) / float(len(self.q)), min(self.q), max(self.q), self.q, self.max_q)) + def qStatReset(self): - self.q = [] ## to calculate the average, min and max of the quality - self.max_q = None + self.q = [] ## to calculate the average, min and max of the quality + self.max_q = None ## maximum quality of all hosters + def tvshow_number(self, number): if int(number) < 10: return '0%s' % number @@ -81,8 +87,6 @@ class Movie2kTo(Crypter): elif re.search(self.FILM_URL_PATH_PATTERN, self.url_path): self.format = 'film' pattern_re = re.search(self.FILM_URL_PATH_PATTERN, self.url_path) - - self.name = pattern_re.group('name') self.id = pattern_re.group('id') self.logDebug('URL Path: %s (ID: %s, Name: %s, Format: %s)' @@ -100,8 +104,8 @@ class Movie2kTo(Crypter): re_quality = re.compile(r'.+?Quality:.+?smileys/(\d)\.gif') ## The quality is one digit. 0 is the worst and 5 is the best. ## Is not always there … - re_hoster_id_html = re.compile(r'(?:<td height|<tr id).+?<a href=".*?(\d{7}).*?".+? ([^<>]+?)</a>(.+?)</tr>') re_hoster_id_js = re.compile(r'links\[(\d+?)\].+ (.+?)</a>(.+?)</tr>') + re_hoster_id_html = re.compile(r'(?:<td height|<tr id).+?<a href=".*?(\d{7}).*?".+? ([^<>]+?)</a>(.+?)</tr>') ## I assume that the ID is 7 digits longs count = defaultdict(int) matches = re_hoster_id_html.findall(self.html) @@ -112,10 +116,10 @@ class Movie2kTo(Crypter): match_q = re_quality.search(q_html) if match_q: quality = int(match_q.group(1)) - if self.max_q: - if self.max_q < quality: self.max_q = quality - else: ## was None before + if self.max_q == None: self.max_q = quality + else: + if self.max_q < quality: self.max_q = quality q_s = ', Quality: %d' % quality else: q_s = ', unknown quality' @@ -129,13 +133,12 @@ class Movie2kTo(Crypter): else: self.logDebug('This is already the right ID') try: - url = re.search(r'<a target="_blank" href="(http://.*?)"', self.html).group(1) + url = re.search(r'<a target="_blank" href="(http://[^"]*?)"', self.html).group(1) self.logDebug('id: %s, %s: %s' % (h_id, hoster, url)) links.append(url) except: self.logDebug('Failed to find the URL') else: self.logDebug('Not accepted: %s, ID: %s%s' % (hoster, h_id, q_s)) - # self.logDebug(links) return links diff --git a/module/plugins/crypter/SerienjunkiesOrg.py b/module/plugins/crypter/SerienjunkiesOrg.py index dfe34ff6e..0506d90fb 100644 --- a/module/plugins/crypter/SerienjunkiesOrg.py +++ b/module/plugins/crypter/SerienjunkiesOrg.py @@ -11,13 +11,13 @@ class SerienjunkiesOrg(Crypter): __name__ = "SerienjunkiesOrg" __type__ = "container" __pattern__ = r"http://.*?(serienjunkies.org|dokujunkies.org)/.*?" - __version__ = "0.36" + __version__ = "0.37" __config__ = [ ("changeNameSJ", "Packagename;Show;Season;Format;Episode", "Take SJ.org name", "Show"), ("changeNameDJ", "Packagename;Show;Format;Episode", "Take DJ.org name", "Show"), ("randomPreferred", "bool", "Randomize Preferred-List", False), ("hosterListMode", "OnlyOne;OnlyPreferred(One);OnlyPreferred(All);All", "Use for hosters (if supported)", "All"), - ("hosterList", "str", "Preferred Hoster list (comma separated)", "RapidshareCom,UploadedTo,NetloadIn,FilefactoryCom,FreakshareNet,FilebaseTo,MegauploadCom,HotfileCom,DepositfilesCom,EasyshareCom,KickloadCom"), + ("hosterList", "str", "Preferred Hoster list (comma separated)", "RapidshareCom,UploadedTo,NetloadIn,FilefactoryCom,FreakshareNet,FilebaseTo,HotfileCom,DepositfilesCom,EasyshareCom,KickloadCom"), ("ignoreList", "str", "Ignored Hoster list (comma separated)", "MegauploadCom") ] __description__ = """serienjunkies.org Container Plugin""" diff --git a/module/plugins/hoster/ExtabitCom.py b/module/plugins/hoster/ExtabitCom.py index 718423986..fd91bb023 100644 --- a/module/plugins/hoster/ExtabitCom.py +++ b/module/plugins/hoster/ExtabitCom.py @@ -17,15 +17,17 @@ """ import re + from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo from module.plugins.ReCaptcha import ReCaptcha from module.common.json_layer import json_loads + class ExtabitCom(SimpleHoster): __name__ = "ExtabitCom" __type__ = "hoster" - __pattern__ = r"http://(\w+\.)*extabit\.com/(file|go)/(?P<ID>\w+)" - __version__ = "0.2" + __pattern__ = r"http://(\w+\.)*extabit\.com/(file|go|fid)/(?P<ID>\w+)" + __version__ = "0.3" __description__ = """Extabit.com""" __author_name__ = ("zoidberg") @@ -33,34 +35,34 @@ class ExtabitCom(SimpleHoster): FILE_SIZE_PATTERN = r'<th>Size:</th>\s*<td class="col-fileinfo">(?P<S>[^<]+)</td>' FILE_OFFLINE_PATTERN = r'<h1>File not found</h1>' TEMP_OFFLINE_PATTERN = r">(File is temporary unavailable|No download mirror)<" - + DOWNLOAD_LINK_PATTERN = r'"(http://guest\d+\.extabit\.com/[a-z0-9]+/.*?)"' - def handleFree(self): + def handleFree(self): if r">Only premium users can download this file" in self.html: self.fail("Only premium users can download this file") - + m = re.search(r"Next free download from your ip will be available in <b>(\d+)\s*minutes", self.html) if m: self.setWait(int(m.group(1)) * 60, True) - self.wait() + self.wait() elif "The daily downloads limit from your IP is exceeded" in self.html: self.setWait(3600, True) self.wait() - + self.logDebug("URL: " + self.req.http.lastEffectiveURL) m = re.match(self.__pattern__, self.req.http.lastEffectiveURL) - fileID = m.group('ID') if m else self.file_info('ID') - + fileID = m.group('ID') if m else self.file_info('ID') + m = re.search(r'recaptcha/api/challenge\?k=(\w+)', self.html) if m: recaptcha = ReCaptcha(self) captcha_key = m.group(1) - + for i in range(5): get_data = {"type": "recaptcha"} get_data["challenge"], get_data["capture"] = recaptcha.challenge(captcha_key) - response = json_loads(self.load("http://extabit.com/file/%s/" % fileID, get = get_data)) + response = json_loads(self.load("http://extabit.com/file/%s/" % fileID, get=get_data)) if "ok" in response: self.correctCaptcha() break @@ -70,15 +72,16 @@ class ExtabitCom(SimpleHoster): self.fail("Invalid captcha") else: self.parseError('Captcha') - + if not "href" in response: self.parseError('JSON') - + self.html = self.load("http://extabit.com/file/%s%s" % (fileID, response['href'])) m = re.search(self.DOWNLOAD_LINK_PATTERN, self.html) if not m: self.parseError('Download URL') url = m.group(1) self.logDebug("Download URL: " + url) - self.download(url) + self.download(url) + -getInfo = create_getInfo(ExtabitCom)
\ No newline at end of file +getInfo = create_getInfo(ExtabitCom) diff --git a/module/plugins/hoster/UploadedTo.py b/module/plugins/hoster/UploadedTo.py index c7ce5846e..5855f118c 100644 --- a/module/plugins/hoster/UploadedTo.py +++ b/module/plugins/hoster/UploadedTo.py @@ -82,7 +82,7 @@ class UploadedTo(Hoster): __name__ = "UploadedTo" __type__ = "hoster" __pattern__ = r"https?://[\w\.-]*?(uploaded\.(to|net)|ul\.to)(/file/|/?\?id=|.*?&id=|/)(?P<ID>\w+)" - __version__ = "0.67" + __version__ = "0.68" __description__ = """Uploaded.net Download Hoster""" __author_name__ = ("spoob", "mkaay", "zoidberg", "netpok", "stickell") __author_mail__ = ("spoob@pyload.org", "mkaay@mkaay.de", "zoidberg@mujmail.cz", "netpok@gmail.com", "l.stickell@yahoo.it") @@ -209,7 +209,7 @@ class UploadedTo(Hoster): elif "limit-parallel" in result: self.fail("Cannot download in parallel") elif self.DL_LIMIT_PATTERN in result: # limit-dl - self.setWait(60 * 60, True) + self.setWait(3 * 60 * 60, True) self.wait() self.retry() elif 'err:"captcha"' in result: @@ -228,6 +228,6 @@ class UploadedTo(Hoster): self.download(downloadURL, disposition=True) check = self.checkDownload({"limit-dl": self.DL_LIMIT_PATTERN}) if check == "limit-dl": - self.setWait(60 * 60, True) + self.setWait(3 * 60 * 60, True) self.wait() self.retry() |