summaryrefslogtreecommitdiffstats
path: root/module/plugins
diff options
context:
space:
mode:
authorGravatar Stefano <l.stickell@yahoo.it> 2013-05-13 22:06:24 +0200
committerGravatar Stefano <l.stickell@yahoo.it> 2013-05-13 22:06:24 +0200
commitc1d6495f2aba731c208ddfe7d6523662cd4bf314 (patch)
treeba02f720262fabbbaf6bdc44d370aa2f219bf084 /module/plugins
parentRyushareCom: two simultaneous downloads and resume are allowed even in free m... (diff)
parentMovie2kTo.py: Removed redundant code. Thanks to stickell. (diff)
downloadpyload-c1d6495f2aba731c208ddfe7d6523662cd4bf314.tar.xz
Merge pull request #115 from 4Christopher/Movie2kTo
Movie2kTo: Added regular expression for matching the hoster URL
Diffstat (limited to 'module/plugins')
-rw-r--r--module/plugins/crypter/Movie2kTo.py21
1 files changed, 14 insertions, 7 deletions
diff --git a/module/plugins/crypter/Movie2kTo.py b/module/plugins/crypter/Movie2kTo.py
index f2c5ece55..097cb702e 100644
--- a/module/plugins/crypter/Movie2kTo.py
+++ b/module/plugins/crypter/Movie2kTo.py
@@ -9,7 +9,7 @@ class Movie2kTo(Crypter):
__name__ = 'Movie2kTo'
__type__ = 'container'
__pattern__ = r'http://(?:www\.)?movie2k\.to/(.*)\.html'
- __version__ = '0.4'
+ __version__ = '0.5'
__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'),
@@ -132,12 +132,19 @@ class Movie2kTo(Crypter):
self.html = self.load('%s/tvshows-%s-%s.html' % (self.BASE_URL, h_id, self.name))
else:
self.logDebug('This is already the right ID')
- try:
- 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')
+ # The iframe tag must continue with a width. There where
+ # two iframes in the site and I try to make sure that it
+ # matches the right one. This is not (yet) nessesary
+ # because the right iframe happens to be the first iframe.
+ for pattern in (r'<a target="_blank" href="(http://[^"]*?)"', r'<iframe src="(http://[^"]*?)" width'):
+ try:
+ url = re.search(pattern, self.html).group(1)
+ except:
+ self.logDebug('Failed to find the URL (pattern %s)' % pattern)
+ else:
+ self.logDebug('id: %s, %s: %s' % (h_id, hoster, url))
+ links.append(url)
+ break
else:
self.logDebug('Not accepted: %s, ID: %s%s' % (hoster, h_id, q_s))
# self.logDebug(links)