diff options
author | Christopher <4Christopher@gmx.de> | 2013-02-27 13:21:13 +0100 |
---|---|---|
committer | Christopher <4Christopher@gmx.de> | 2013-02-27 14:35:46 +0100 |
commit | 7b1889af3caf854a2b4aaed32d27816402a8ef97 (patch) | |
tree | 9b6de9f3668291ec20d4c17a17e551b559da484e | |
parent | fixed support for films (diff) | |
download | pyload-7b1889af3caf854a2b4aaed32d27816402a8ef97.tar.xz |
little fixes
-rw-r--r-- | module/plugins/crypter/Movie2kTo.py | 30 | ||||
-rw-r--r-- | module/plugins/hoster/XvidstageCom.py | 7 |
2 files changed, 20 insertions, 17 deletions
diff --git a/module/plugins/crypter/Movie2kTo.py b/module/plugins/crypter/Movie2kTo.py index 7f30d1649..a9cdb188b 100644 --- a/module/plugins/crypter/Movie2kTo.py +++ b/module/plugins/crypter/Movie2kTo.py @@ -8,7 +8,7 @@ class Movie2kTo(Crypter): __name__ = "Movie2kTo" __type__ = "container" __pattern__ = r"http://(?:www\.)?movie2k\.to/(.*)\.html" - __version__ = "0.1.1" + __version__ = "0.2" __config__ = [("accepted_hosters", "str", "List of accepted hosters", "Xvidstage, "), ("whole_season", "bool", "Download whole season", "False"), ("everything", "bool", "Download everything", "False")] @@ -41,9 +41,8 @@ class Movie2kTo(Crypter): self.logDebug('%s selected (in the start URL: %s)' % (season_name, pyfile.url)) season_links += self.getInfoAndLinks('%s/%s' % (self.BASE_URL, url_path)) elif (whole_season and (season_sel == 'inline')) or everything: - url = '%s/%s' % (self.BASE_URL, url_path) season_links += self.getInfoAndLinks('%s/%s' % (self.BASE_URL, url_path)) - self.packages.append(('Season %s' % season, season_links, 'Season %s' % season)) + self.packages.append(('%s: Season %s' % (self.name, season), season_links, 'Season %s' % season)) else: self.packages.append((self.package.name, self.getLinks(), self.package.folder)) @@ -53,13 +52,13 @@ class Movie2kTo(Crypter): return '0%s' % number else: return number + def name_tvshow(self, season, ep): return '%s S%sE%s' % (self.name, self.tvshow_number(season), self.tvshow_number(ep)) def getInfo(self, url): self.html = self.load(url) self.url_path = re.match(self.__pattern__, url).group(1) - self.logDebug('URL Path: %s' % self.url_path) self.format = pattern_re = None if re.match(r'tvshows', self.url_path): self.format = 'tvshow' @@ -68,13 +67,12 @@ class Movie2kTo(Crypter): self.format = 'film' pattern_re = re.search(self.FILM_URL_PATH_PATTERN, self.url_path) - self.logDebug('Format: %s' % self.format) self.name = pattern_re.group('name') - self.logDebug('Name: %s' % self.name) self.id = pattern_re.group('id') - self.logDebug('ID: %s' % self.id) - + self.logDebug('URL Path: %s (ID: %s, Name: %s, Format: %s)' + % (self.url_path, self.id, self.name, self.format)) + def getInfoAndLinks(self, url): self.getInfo(url) return self.getLinks() @@ -83,11 +81,13 @@ class Movie2kTo(Crypter): accepted_hosters = re.findall(r'\b(\w+?)\b', self.getConfig('accepted_hosters')) links = [] ## h_id: hoster_id of a possible hoster - if self.format == 'tvshow': - re_hoster_id = re.compile(r'links\[(\d+?)\].+ (.+?)</a>') - else: - re_hoster_id = re.compile(r'<a href=".*?(\d{7}).*?".+? (.+?)</a>') - ## I assume that the ID is 7 digits longs + re_hoster_id_js = re.compile(r'links\[(\d+?)\].+ (.+?)</a>') + re_hoster_id_html = re.compile(r'<a href=".*?(\d{7}).*?".+? (.+?)</a>') + ## I assume that the ID is 7 digits longs + if re_hoster_id_js.search(self.html): + re_hoster_id = re_hoster_id_js + elif re_hoster_id_html.search(self.html): + re_hoster_id = re_hoster_id_html for h_id, hoster in re_hoster_id.findall(self.html): if hoster in accepted_hosters: if h_id != self.id: @@ -101,5 +101,9 @@ class Movie2kTo(Crypter): except: self.logDebug('Failed to find the URL') + # self.logDebug(links[-1]) ## Last link, this is probably everything + ## you will need + # links.append('http://localhost/IfTheProcessFunctionReturnsOnlyOneLinkItWillFail') self.logDebug(links) + # return links[-1] return links diff --git a/module/plugins/hoster/XvidstageCom.py b/module/plugins/hoster/XvidstageCom.py index 1994e40ed..38c54efec 100644 --- a/module/plugins/hoster/XvidstageCom.py +++ b/module/plugins/hoster/XvidstageCom.py @@ -37,8 +37,8 @@ def getInfo(urls): def parseFileInfo(url, getInfoMode = False): html = getURL(url) info = {"name" : url, "size" : 0, "status" : 3} - info['name'] = re.search(r'Filename:</b></td><td nowrap>(.*?)<', html).group(1) - info['size'] = re.search(r'Size:</b></td><td>.*? <small>\((\d+?) bytes\)', html).group(1) + info['name'] = re.search(r'(?:Filename|Dateiname):</b></td><td nowrap[^>]*?>(.*?)<', html).group(1) + info['size'] = re.search(r'(?:Size|Größe):</b></td><td>.*? <small>\((\d+?) bytes\)', html).group(1) if info['size'] == 0: info['status'] = 1 else: @@ -49,10 +49,9 @@ def parseFileInfo(url, getInfoMode = False): else: return info['name'], info['size'], info['status'], html - class XvidstageCom(Hoster): __name__ = 'XvidstageCom' - __version__ = '0.1.1' + __version__ = '0.2' __pattern__ = r'http://(?:www.)?xvidstage.com/(?P<id>[0-9A-Za-z]+)' __type__ = 'hoster' __description__ = """A Plugin that allows you to download files from http://xvidstage.com""" |