diff options
author | Christopher <4Christopher@gmx.de> | 2013-05-12 15:10:14 +0200 |
---|---|---|
committer | Christopher <4Christopher@gmx.de> | 2013-05-12 15:15:19 +0200 |
commit | d4d25d89abdfa814ff843adc73f7816c9c584761 (patch) | |
tree | b9ed916e1cf8aef9512445f5efa226904edcee39 /module/plugins | |
parent | Movie2kTo.py: Added regular expression for matching the hoster URL. (diff) | |
download | pyload-d4d25d89abdfa814ff843adc73f7816c9c584761.tar.xz |
Movie2kTo.py: Removed redundant code. Thanks to stickell.
https://github.com/pyload/pyload/pull/115#issuecomment-17777585
Diffstat (limited to 'module/plugins')
-rw-r--r-- | module/plugins/crypter/Movie2kTo.py | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/module/plugins/crypter/Movie2kTo.py b/module/plugins/crypter/Movie2kTo.py index 81f700e8c..097cb702e 100644 --- a/module/plugins/crypter/Movie2kTo.py +++ b/module/plugins/crypter/Movie2kTo.py @@ -132,23 +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 (possibility 1)') + # 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(r'<iframe src="(http://[^"]*?)" width', self.html).group(1) - # 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. + 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) - except: - self.logDebug('Failed to find the URL (possibility 2)') + break else: self.logDebug('Not accepted: %s, ID: %s%s' % (hoster, h_id, q_s)) # self.logDebug(links) |