From 50607322e6b15a4a406faf38da1e12793f46c3a3 Mon Sep 17 00:00:00 2001 From: Christopher <4Christopher@gmx.de> Date: Wed, 13 Mar 2013 20:52:46 +0100 Subject: Movie2kTo: Corrected package name this plugin returns. --- module/plugins/crypter/Movie2kTo.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'module/plugins/crypter/Movie2kTo.py') diff --git a/module/plugins/crypter/Movie2kTo.py b/module/plugins/crypter/Movie2kTo.py index f5800b498..47257f2dc 100644 --- a/module/plugins/crypter/Movie2kTo.py +++ b/module/plugins/crypter/Movie2kTo.py @@ -47,13 +47,14 @@ 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 '' -- cgit v1.2.3 From ed22eec779531674fb5f770c5fa2a8b632f552c4 Mon Sep 17 00:00:00 2001 From: Christopher <4Christopher@gmx.de> Date: Mon, 18 Mar 2013 10:36:52 +0100 Subject: Movie2kTo: Added setting for quality in the folder name. You set if you want the quality output be part of the folder name. --- module/plugins/crypter/Movie2kTo.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'module/plugins/crypter/Movie2kTo.py') diff --git a/module/plugins/crypter/Movie2kTo.py b/module/plugins/crypter/Movie2kTo.py index 47257f2dc..e0e923abb 100644 --- a/module/plugins/crypter/Movie2kTo.py +++ b/module/plugins/crypter/Movie2kTo.py @@ -9,8 +9,9 @@ class Movie2kTo(Crypter): __name__ = 'Movie2kTo' __type__ = 'container' __pattern__ = r'http://(?:www\.)?movie2k\.to/(.*)\.html' - __version__ = '0.3' + __version__ = '0.4' __config__ = [('accepted_hosters', 'str', 'List of accepted hosters', 'Xvidstage, '), + ('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')] @@ -58,6 +59,7 @@ class Movie2kTo(Crypter): def qStat(self): if len(self.q) == 0: return '' + if not self.getConfig('dir_quality'): return '' 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): -- cgit v1.2.3 From 6c77bea330e4e71c52017d108dd23528ca081d10 Mon Sep 17 00:00:00 2001 From: Christopher <4Christopher@gmx.de> Date: Sat, 13 Apr 2013 20:52:10 +0200 Subject: Fixed regular expression and optimized quality report. --- module/plugins/crypter/Movie2kTo.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'module/plugins/crypter/Movie2kTo.py') diff --git a/module/plugins/crypter/Movie2kTo.py b/module/plugins/crypter/Movie2kTo.py index e0e923abb..4a8d21615 100644 --- a/module/plugins/crypter/Movie2kTo.py +++ b/module/plugins/crypter/Movie2kTo.py @@ -14,7 +14,7 @@ class Movie2kTo(Crypter): ('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') @@ -60,6 +60,7 @@ class Movie2kTo(Crypter): 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): @@ -132,7 +133,7 @@ class Movie2kTo(Crypter): else: self.logDebug('This is already the right ID') try: - url = re.search(r' Date: Sat, 13 Apr 2013 21:05:54 +0200 Subject: Cleanup. --- module/plugins/crypter/Movie2kTo.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'module/plugins/crypter/Movie2kTo.py') diff --git a/module/plugins/crypter/Movie2kTo.py b/module/plugins/crypter/Movie2kTo.py index 4a8d21615..b0b4085a2 100644 --- a/module/plugins/crypter/Movie2kTo.py +++ b/module/plugins/crypter/Movie2kTo.py @@ -63,9 +63,11 @@ class Movie2kTo(Crypter): 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 @@ -85,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)' @@ -104,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'(?: