summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/Vipleech4uCom.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-09-07 23:40:50 +0200
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-09-14 10:58:42 +0200
commit887ad58e4c6c20b992311bbdf931bcd18e73d384 (patch)
treef31beb241bacca0bfea4c1acc4e9ace813755cef /module/plugins/hoster/Vipleech4uCom.py
parent[AccountManager] Fixed #733 (diff)
parent[File4safe] distributing LINK_PATTERN (diff)
downloadpyload-887ad58e4c6c20b992311bbdf931bcd18e73d384.tar.xz
Merge branch 'stable' into 0.4.10
Conflicts: module/plugins/Account.py module/plugins/AccountManager.py module/plugins/Hook.py module/plugins/OCR.py module/plugins/Plugin.py module/plugins/PluginManager.py module/plugins/ReCaptcha.py module/plugins/accounts/Ftp.py module/plugins/accounts/Http.py module/plugins/internal/MultiHoster.py module/plugins/ocr/GigasizeCom.py module/plugins/ocr/LinksaveIn.py module/plugins/ocr/NetloadIn.py module/plugins/ocr/ShareonlineBiz.py
Diffstat (limited to 'module/plugins/hoster/Vipleech4uCom.py')
-rw-r--r--module/plugins/hoster/Vipleech4uCom.py82
1 files changed, 8 insertions, 74 deletions
diff --git a/module/plugins/hoster/Vipleech4uCom.py b/module/plugins/hoster/Vipleech4uCom.py
index 53768a430..da7131d39 100644
--- a/module/plugins/hoster/Vipleech4uCom.py
+++ b/module/plugins/hoster/Vipleech4uCom.py
@@ -1,84 +1,18 @@
# -*- coding: utf-8 -*-
-import re
+from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo
-from module.plugins.Hoster import Hoster
-
-class Vipleech4uCom(Hoster):
+class Vipleech4uCom(DeadHoster):
__name__ = "Vipleech4uCom"
- __version__ = "0.1"
__type__ = "hoster"
- __pattern__ = r"http://vipleech4u.com/manager.php"
- __description__ = """Vipleech4u.com hoster plugin"""
- __author_name__ = ("Kagenoshin")
- __author_mail__ = ("kagenoshin@gmx.ch")
-
- FILENAME_PATTERN = re.compile(r'name\s*?=\s*?["\']filename["\'][^>]*?value\s*?=\s*?["\'](.*?)["\']', re.I)
- HOST_PATTERN = re.compile(r'name\s*?=\s*?["\']host["\'][^>]*?value\s*?=\s*?["\'](.*?)["\']', re.I)
- PATH_PATTERN = re.compile(r'name\s*?=\s*?["\']path["\'][^>]*?value\s*?=\s*?["\'](.*?)["\']', re.I)
- REFERER_PATTERN = re.compile(r'name\s*?=\s*?["\']referer["\'][^>]*?value\s*?=\s*?["\'](.*?)["\']', re.I)
- LINK_PATTERN = re.compile(r'name\s*?=\s*?["\']link["\'][^>]*?value\s*?=\s*?["\'](.*?)["\']', re.I)
- COOKIE_PATTERN = re.compile(r'name\s*?=\s*?["\']cookie["\'][^>]*?value\s*?=\s*?["\'](.*?)["\']', re.I)
-
- def setup(self):
- self.resumeDownload = self.multiDL = True
- self.chunkLimit = 1
-
- def process(self, pyfile):
- if not self.account:
- self.logError(_("Please enter your %s account or deactivate this plugin") % "vipleech4u.com")
- self.fail("No vipleech4u.com account provided")
-
- self.logDebug("Old URL: %s" % pyfile.url)
-
- new_url = pyfile.url
-
- if re.match(self.__pattern__, new_url):
- self.fail("Can't handle vipleech4u links.")
+ __version__ = "0.2"
- #upload the link which has to be loaded
- page = self.load('http://vipleech4u.com/generator.php', post={'links': new_url, 'ddl': 'no'})
+ __pattern__ = r'http://(?:www\.)?vipleech4u\.com/manager\.php'
- #switch to the manager and see what's happening
- page = self.load('http://vipleech4u.com/unrestrict.php', get={'link': new_url, 'premium_acc': 'on'})
-
- if re.search(r'You have generated maximum links available to you today', page, re.I):
- self.fail('Daily limit reached.')
-
- filename = self.FILENAME_PATTERN.search(page)
- host = self.HOST_PATTERN.search(page)
- path = self.PATH_PATTERN.search(page)
- referer = self.REFERER_PATTERN.search(page)
- link = self.LINK_PATTERN.search(page)
- cookie = self.COOKIE_PATTERN.search(page)
-
- #build the post-dictionary
- post_dict = {}
-
- if filename:
- post_dict.update({'filename': filename.group(1)})
- if host:
- post_dict.update({'host': host.group(1)})
- if path:
- post_dict.update({'path': path.group(1)})
- if referer:
- post_dict.update({'referer': referer.group(1)})
- if link:
- post_dict.update({'link': link.group(1)})
- if cookie:
- post_dict.update({'cookie': cookie.group(1)})
-
- if not post_dict:
- self.logDebug('Get an empty post_dict. Strange.')
-
- self.setWait(5)
- self.wait()
- self.logDebug("Unrestricted URL: " + str(post_dict))
-
- self.download('http://vipleech4u.com/unrestrict.php', post=post_dict, disposition=True)
+ __description__ = """Vipleech4u.com hoster plugin"""
+ __author_name__ = "Kagenoshin"
+ __author_mail__ = "kagenoshin@gmx.ch"
- check = self.checkDownload({"bad": "<html"})
- if check == "bad":
- self.retry(24, 150, 'Bad file downloaded')
+getInfo = create_getInfo(Vipleech4uCom)