From 121024ca7ee705e2fed5e8705d25484288922b41 Mon Sep 17 00:00:00 2001
From: Christopher <4Christopher@gmx.de>
Date: Tue, 12 Mar 2013 12:55:55 +0100
Subject: Movie2kTo: fixed hoster recognition
It appeared to me that the hoster and the id of a video can be present in
either a JavaScript section or in a HTML section on *one* page.
I first assumed that all hosters on one page can be found ether in a JavaScript
section or in a HTML section.
---
module/plugins/crypter/Movie2kTo.py | 15 ++++++---------
1 file changed, 6 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 c32f6f930..3be3be73c 100644
--- a/module/plugins/crypter/Movie2kTo.py
+++ b/module/plugins/crypter/Movie2kTo.py
@@ -89,17 +89,12 @@ class Movie2kTo(Crypter):
re_hoster_id_js = re.compile(r'links\[(\d+?)\].+ (.+?)')
re_hoster_id_html = re.compile(r'
')
## I assume that the ID is 7 digits longs
- if re_hoster_id_js.search(self.html):
- re_hoster_id = re_hoster_id_js
- self.logDebug('Assuming that the ID can be found in a JavaScript section.')
- elif re_hoster_id_html.search(self.html):
- re_hoster_id = re_hoster_id_html
- self.logDebug('Assuming that the ID can be found in a HTML section.')
count = defaultdict(int)
- for h_id, hoster in re_hoster_id.findall(self.html):
- # self.logDebug('Hoster %s' % hoster)
+ matches = re_hoster_id_js.findall(self.html)
+ matches += re_hoster_id_html.findall(self.html)
+ for h_id, hoster in matches:
if hoster in accepted_hosters:
- # self.logDebug('Accepted %s' % hoster)
+ self.logDebug('Accepted: %s, ID: %s' % (hoster, h_id))
count[hoster] += 1
if count[hoster] <= firstN:
if h_id != self.id:
@@ -112,6 +107,8 @@ class Movie2kTo(Crypter):
links.append(url)
except:
self.logDebug('Failed to find the URL')
+ else:
+ self.logDebug('Not accepted: %s, ID: %s' % (hoster, h_id))
self.logDebug(links)
return links
--
cgit v1.2.3