summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar zoidberg10 <zoidberg@mujmail.cz> 2012-01-04 17:59:06 +0100
committerGravatar zoidberg10 <zoidberg@mujmail.cz> 2012-01-04 17:59:06 +0100
commited6c202ebc5ddcee6d1eee7f6d303c5e1c229399 (patch)
treed66241a9a08a94172a17b56b8b8a6a47de4cfa4f
parentsome fixes (diff)
parentfilesonic pattern fix (thanx Lino24), fix mu life account, closed #463 easybytez (diff)
downloadpyload-ed6c202ebc5ddcee6d1eee7f6d303c5e1c229399.tar.xz
Merge
-rw-r--r--module/plugins/accounts/MegauploadCom.py6
-rw-r--r--module/plugins/hooks/EasybytezCom.py32
-rw-r--r--module/plugins/hoster/CrockoCom.py5
-rw-r--r--module/plugins/hoster/EasybytezCom.py45
-rw-r--r--module/plugins/hoster/FilesonicCom.py6
5 files changed, 78 insertions, 16 deletions
diff --git a/module/plugins/accounts/MegauploadCom.py b/module/plugins/accounts/MegauploadCom.py
index 12e510fcf..ff4f5971c 100644
--- a/module/plugins/accounts/MegauploadCom.py
+++ b/module/plugins/accounts/MegauploadCom.py
@@ -24,16 +24,16 @@ from module.plugins.Account import Account
class MegauploadCom(Account):
__name__ = "MegauploadCom"
- __version__ = "0.11"
+ __version__ = "0.12"
__type__ = "account"
__description__ = """megaupload account plugin"""
__author_name__ = ("RaNaN")
__author_mail__ = ("RaNaN@pyload.org")
def loadAccountInfo(self, user, req):
- page = req.load("http://www.megaupload.com/?c=account")
+ page = req.load("http://www.megaupload.com/?c=account&setlang=en", decode = True)
- premium = True if r'<div class="account_txt">Premium' in page else False
+ premium = False if r'<div class="account_txt">Regular' in page else True
validuntil = -1
if premium:
diff --git a/module/plugins/hooks/EasybytezCom.py b/module/plugins/hooks/EasybytezCom.py
new file mode 100644
index 000000000..4dd39cca6
--- /dev/null
+++ b/module/plugins/hooks/EasybytezCom.py
@@ -0,0 +1,32 @@
+# -*- coding: utf-8 -*-
+
+from module.network.RequestFactory import getURL
+from module.plugins.internal.MultiHoster import MultiHoster
+import re
+
+def getConfigSet(option):
+ s = set(option.lower().replace(',','|').split('|'))
+ s.discard(u'')
+ return s
+
+class EasybytezCom(MultiHoster):
+ __name__ = "EasybytezCom"
+ __version__ = "0.01"
+ __type__ = "hook"
+ __config__ = [("activated", "bool", "Activated", "False"),
+ ("includeHoster", "str", "Use only for downloads from (comma-separated hosters)", ""),
+ ("excludeHoster", "str", "Do not use for downloads from (comma-separated hosters)", "")]
+ __description__ = """EasyBytez.com hook plugin"""
+ __author_name__ = ("zoidberg")
+ __author_mail__ = ("zoidberg@mujmail.cz")
+
+ def getHoster(self):
+
+ hoster = set(['2shared.com', 'easy-share.com', 'filefactory.com', 'fileserve.com', 'filesonic.com', 'hotfile.com', 'mediafire.com', 'megaupload.com', 'netload.in', 'rapidshare.com', 'uploading.com', 'wupload.com', 'oron.com', 'uploadstation.com', 'ul.to', 'uploaded.to'])
+
+ option = self.getConfig('includeHoster').strip()
+ if option: hoster &= getConfigSet(option)
+ option = self.getConfig('excludeHoster').strip()
+ if option: hoster -= getConfigSet(option)
+
+ return list(hoster) \ No newline at end of file
diff --git a/module/plugins/hoster/CrockoCom.py b/module/plugins/hoster/CrockoCom.py
index 9598025ec..bf058b613 100644
--- a/module/plugins/hoster/CrockoCom.py
+++ b/module/plugins/hoster/CrockoCom.py
@@ -9,12 +9,13 @@ class CrockoCom(SimpleHoster):
__name__ = "CrockoCom"
__type__ = "hoster"
__pattern__ = r"http://(www\.)?(crocko|easy-share).com/.*"
- __version__ = "0.11"
+ __version__ = "0.12"
__description__ = """Crocko Download Hoster"""
__author_name__ = ("zoidberg")
__author_mail__ = ("zoidberg@mujmail.cz")
- FILE_INFO_PATTERN = r'<strong>(?P<N>.*)\s*<span class="tip1"><span class="inner">(?P<S>[0-9,.]+) (?P<U>[kKMG])i?B</span></span>'
+ FILE_NAME_PATTERN = r'<span class="fz24">Download:\s*<strong>(?P<N>.*)'
+ FILE_NAME_PATTERN = r'<span class="tip1"><span class="inner">(?P<S>[^<]+)</span></span>'
FILE_OFFLINE_PATTERN = r"<h1>Sorry,<br />the page you're looking for <br />isn't here.</h1>"
DOWNLOAD_URL_PATTERN = r"window.location ='([^']+)';"
CAPTCHA_URL_PATTERN = re.compile(r"u='(/file_contents/captcha/\w+)';\s*w='(\d+)';")
diff --git a/module/plugins/hoster/EasybytezCom.py b/module/plugins/hoster/EasybytezCom.py
index dac35b1d3..3ee2e9ba5 100644
--- a/module/plugins/hoster/EasybytezCom.py
+++ b/module/plugins/hoster/EasybytezCom.py
@@ -24,7 +24,7 @@ class EasybytezCom(SimpleHoster):
__name__ = "EasybytezCom"
__type__ = "hoster"
__pattern__ = r"http://(?:\w*\.)?easybytez.com/(\w+).*"
- __version__ = "0.03"
+ __version__ = "0.04"
__description__ = """easybytez.com"""
__author_name__ = ("zoidberg")
__author_mail__ = ("zoidberg@mujmail.cz")
@@ -33,22 +33,26 @@ class EasybytezCom(SimpleHoster):
FILE_NAME_PATTERN = r'<input type="hidden" name="fname" value="(?P<N>[^"]+)"'
FILE_SIZE_PATTERN = r'You have requested <font color="red">[^<]+</font> \((?P<S>[^<]+)\)</font>'
+ FILE_INFO_PATTERN = r'<tr><td align=right><b>Filename:</b></td><td nowrap>(?P<N>[^<]+)</td></tr>\s*.*?<small>\((?P<S>[^<]+)\)</small>'
FILE_OFFLINE_PATTERN = r'<h2>File Not Found</h2>'
- FORM_INPUT_PATTERN = r'<input[^>]* name="([^"]+)" value="([^"]*)">'
+ FORM_INPUT_PATTERN = r'<input[^>]* name="([^"]+)"[^>]*value="([^"]*)"'
WAIT_PATTERN = r'<span id="countdown_str">[^>]*>(\d+)</span> seconds</span>'
DIRECT_LINK_PATTERN = r'(http://\w+\.easybytez\.com/files/\d+/\w+/[^"<]+)'
- URL_FORM_PATTERN = r'<form name="url"[^>]*action="([^"]+)(.*?)</form>'
+ FORM_PATTERN = r'<form name=["\']?%s[^>]*action=["\']?([^"\' ]+)(.*?)</form>'
OVR_DOWNLOAD_LINK_PATTERN = r'<h2>Download Link</h2>\s*<textarea[^>]*>([^<]+)'
OVR_KILL_LINK_PATTERN = r'<h2>Delete Link</h2>\s*<textarea[^>]*>([^<]+)'
+ TEXTAREA_PATTERN = r"<textarea name='([^']+)'>([^<]+)</textarea>"
+
+ HOSTER_URL = "www.easybytez.com"
def process(self, pyfile):
if not re.match(self.__pattern__, self.pyfile.url):
if self.premium:
self.handleOverriden()
else:
- self.fail("Only premium users can download from other hosters with EasyBytes")
+ self.fail("Only premium users can download from other hosters with %s" % self.HOSTER_URL)
else:
self.html = self.load(pyfile.url, cookies = False, decode = True)
self.file_info = self.getFileInfo()
@@ -73,17 +77,36 @@ class EasybytezCom(SimpleHoster):
self.downloadLink(found.group(1))
def handleOverriden(self):
- self.html = self.load('http://www.easybytez.com/')
- action, form = re.search(self.URL_FORM_PATTERN, self.html, re.DOTALL).groups()
+ self.html = self.load(self.HOSTER_URL)
+ action, form = re.search(self.FORM_PATTERN % "url", self.html, re.DOTALL).groups()
inputs = dict(re.findall(self.FORM_INPUT_PATTERN, form))
- action += "%d&js_on=1&utype=prem&upload_type=url" % int(random()*10**12)
+ upload_id = "%012d" % int(random()*10**12)
+ action += upload_id + "&js_on=1&utype=prem&upload_type=url"
inputs['tos'] = '1'
inputs['url_mass'] = self.pyfile.url
+ inputs['up1oad_type'] = 'url'
+ self.logDebug(action, inputs)
self.html = self.load(action, post = inputs)
+
+ found = re.search(self.FORM_PATTERN % "F1", self.html, re.S | re.I)
+ if not found:
+ self.logDebug(self.html)
+ self.fail("upload failed")
+ action, form = found.groups()
+
+ inputs = dict(re.findall(self.TEXTAREA_PATTERN, form))
+ if not inputs: parseError('TEXTAREA')
+ self.logDebug(inputs)
+ if inputs['st'] == 'OK':
+ self.html = self.load(action, post = inputs)
+ else:
+ self.fail(inputs['st'])
+
found = re.search(self.OVR_DOWNLOAD_LINK_PATTERN, self.html)
if not found: self.parseError('DIRECT LINK (OVR)')
- self.downloadLink(found.group(1))
+ self.pyfile.url = found.group(1)
+ self.retry()
def downloadLink(self, link):
self.logDebug('DIRECT LINK: %s' % link)
@@ -92,6 +115,9 @@ class EasybytezCom(SimpleHoster):
def getPostParameters(self, premium=False):
inputs = dict(re.findall(self.FORM_INPUT_PATTERN, self.html))
self.logDebug(inputs)
+
+ if 'op' in inputs and inputs['op'] == 'download2': return inputs
+
inputs['referer'] = self.pyfile.url
if premium:
@@ -111,5 +137,8 @@ class EasybytezCom(SimpleHoster):
self.wait()
return inputs
+
+ def urlParseFileName(self):
+ return html_unescape(urlparse(self.pyfile.url).path.split("/")[-1])
getInfo = create_getInfo(EasybytezCom) \ No newline at end of file
diff --git a/module/plugins/hoster/FilesonicCom.py b/module/plugins/hoster/FilesonicCom.py
index 813333acb..6094859ef 100644
--- a/module/plugins/hoster/FilesonicCom.py
+++ b/module/plugins/hoster/FilesonicCom.py
@@ -45,15 +45,15 @@ def getId(url):
class FilesonicCom(Hoster):
__name__ = "FilesonicCom"
__type__ = "hoster"
- __pattern__ = r"http://[\w\.]*?(sharingmatrix|filesonic)\..*?/file/(([a-z][0-9]+/)?[0-9]+)(/.*)?"
- __version__ = "0.33"
+ __pattern__ = r"http://[\w\.]*?(sharingmatrix|filesonic)\..*?/file/(([a-z][0-9]+/)?[a-zA-Z0-9\-._+]+)(/.*)?"
+ __version__ = "0.34"
__description__ = """FilesonicCom und Sharingmatrix Download Hoster"""
__author_name__ = ("jeix", "paulking")
__author_mail__ = ("jeix@hasnomail.de", "")
API_ADDRESS = "http://api.filesonic.com"
URL_DOMAIN_PATTERN = r'(?P<prefix>.*?)(?P<domain>.(filesonic|sharingmatrix)\..+?)(?P<suffix>/.*)'
- FILE_ID_PATTERN = r'/file/(?P<id>([a-z][0-9]+/)?[0-9]+)(/.*)?' #change may break wupload - be careful
+ FILE_ID_PATTERN = r'/file/(?P<id>([a-z][0-9]+/)?[a-zA-Z0-9\-._+]+)(/.*)?' #change may break wupload - be careful
FILE_LINK_PATTERN = r'<p><a href="(http://.+?\.(filesonic|sharingmatrix)\..+?)"><span>Start download'
WAIT_TIME_PATTERN = r'countDownDelay = (?P<wait>\d+)'
WAIT_TM_PATTERN = r"name='tm' value='(.*?)' />"