summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/NarodRu.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hoster/NarodRu.py')
-rw-r--r--module/plugins/hoster/NarodRu.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/module/plugins/hoster/NarodRu.py b/module/plugins/hoster/NarodRu.py
index c201ac250..b0d4a4960 100644
--- a/module/plugins/hoster/NarodRu.py
+++ b/module/plugins/hoster/NarodRu.py
@@ -10,7 +10,8 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class NarodRu(SimpleHoster):
__name__ = "NarodRu"
__type__ = "hoster"
- __version__ = "0.12"
+ __version__ = "0.13"
+ __status__ = "testing"
__pattern__ = r'http://(?:www\.)?narod(\.yandex)?\.ru/(disk|start/\d+\.\w+-narod\.yandex\.ru)/(?P<ID>\d+)/.+'
__config__ = [("use_premium", "bool", "Use premium account if available", True)]
@@ -32,7 +33,7 @@ class NarodRu(SimpleHoster):
LINK_FREE_PATTERN = r'<a class="h-link" rel="yandex_bar" href="(.+?)">'
- def handleFree(self, pyfile):
+ def handle_free(self, pyfile):
for _i in xrange(5):
self.html = self.load('http://narod.ru/disk/getcapchaxml/?rnd=%d' % int(random.random() * 777))
@@ -40,20 +41,20 @@ class NarodRu(SimpleHoster):
if m is None:
self.error(_("Captcha"))
- post_data = {"action": "sendcapcha"}
+ post_data = {'action': "sendcapcha"}
captcha_url, post_data['key'] = m.groups()
- post_data['rep'] = self.decryptCaptcha(captcha_url)
+ post_data['rep'] = self.captcha.decrypt(captcha_url)
- self.html = self.load(pyfile.url, post=post_data, decode=True)
+ self.html = self.load(pyfile.url, post=post_data)
m = re.search(self.LINK_FREE_PATTERN, self.html)
if m:
self.link = urlparse.urljoin("http://narod.ru", m.group(1))
- self.correctCaptcha()
+ self.captcha.correct()
break
elif u'<b class="error-msg"><strong>Ошиблись?</strong>' in self.html:
- self.invalidCaptcha()
+ self.captcha.invalid()
else:
self.error(_("Download link"))