summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/DlFreeFr.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-10-05 01:55:44 +0200
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-10-05 02:27:38 +0200
commitdf10dce103716acc293f51572650b3dbb7264bf2 (patch)
treeb4523f52f57ff81672a8bb7395c98784cb515c26 /module/plugins/hoster/DlFreeFr.py
parentUse load instead req.load in all crypters and CaptchaService (diff)
downloadpyload-df10dce103716acc293f51572650b3dbb7264bf2.tar.xz
Spare code fixes about COOKIES
Diffstat (limited to 'module/plugins/hoster/DlFreeFr.py')
-rw-r--r--module/plugins/hoster/DlFreeFr.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/module/plugins/hoster/DlFreeFr.py b/module/plugins/hoster/DlFreeFr.py
index e25de18b4..de282d443 100644
--- a/module/plugins/hoster/DlFreeFr.py
+++ b/module/plugins/hoster/DlFreeFr.py
@@ -40,10 +40,12 @@ class AdYouLike:
ADYOULIKE_CALLBACK = r'Adyoulike.g._jsonp_5579316662423138'
ADYOULIKE_CHALLENGE_PATTERN = ADYOULIKE_CALLBACK + r'\((.*?)\)'
+
def __init__(self, plugin, engine="adyoulike"):
self.plugin = plugin
self.engine = engine
+
def challenge(self, html):
adyoulike_data_string = None
m = re.search(self.ADYOULIKE_INPUT_PATTERN, html)
@@ -71,6 +73,7 @@ class AdYouLike:
return ayl_data, challenge_data
+
def result(self, ayl, challenge):
"""
Adyoulike.g._jsonp_5579316662423138
@@ -117,6 +120,7 @@ class DlFreeFr(SimpleHoster):
__author_name__ = ("the-razer", "zoidberg", "Toilal")
__author_mail__ = ("daniel_ AT gmx DOT net", "zoidberg@mujmail.cz", "toilal.dev@gmail.com")
+
FILE_NAME_PATTERN = r'Fichier:</td>\s*<td[^>]*>(?P<N>[^>]*)</td>'
FILE_SIZE_PATTERN = r'Taille:</td>\s*<td[^>]*>(?P<S>[\d.]+[KMG])o'
OFFLINE_PATTERN = r"Erreur 404 - Document non trouv|Fichier inexistant|Le fichier demand&eacute; n'a pas &eacute;t&eacute; trouv&eacute;"
@@ -127,13 +131,13 @@ class DlFreeFr(SimpleHoster):
self.limitDL = 5
self.chunkLimit = 1
+
def init(self):
factory = self.core.requestFactory
self.req = CustomBrowser(factory.bucket, factory.getOptions())
- def process(self, pyfile):
- self.req.setCookieJar(None)
+ def process(self, pyfile):
pyfile.url = replace_patterns(pyfile.url, self.FILE_URL_REPLACEMENTS)
valid_url = pyfile.url
headers = self.load(valid_url, just_header=True)
@@ -157,6 +161,7 @@ class DlFreeFr(SimpleHoster):
else:
self.fail("Invalid return code: " + str(headers.get('code')))
+
def handleFree(self):
action, inputs = self.parseHtmlForm('action="getfile.pl"')
@@ -180,6 +185,7 @@ class DlFreeFr(SimpleHoster):
else:
self.fail("Invalid response")
+
def getLastHeaders(self):
#parse header
header = {"code": self.req.code}