From 9378237ddc39f8ee96e7a3ddb9cc37ce487c5f4d Mon Sep 17 00:00:00 2001 From: zoidberg10 Date: Tue, 22 Nov 2011 00:26:08 +0100 Subject: fix filepost (#431), hellspy, ifolder, letitbit, change SimpleHoster patterns --- module/plugins/accounts/HellspyCz.py | 19 ++------ module/plugins/hoster/BezvadataCz.py | 20 +++----- module/plugins/hoster/CzshareCom.py | 6 +-- module/plugins/hoster/DataportCz.py | 22 +++------ module/plugins/hoster/DepositfilesCom.py | 4 +- module/plugins/hoster/EdiskCz.py | 46 ++++--------------- module/plugins/hoster/FilejungleCom.py | 19 +++----- module/plugins/hoster/FilepostCom.py | 28 +++++------- module/plugins/hoster/FlyshareCz.py | 78 -------------------------------- module/plugins/hoster/FourSharedCom.py | 8 ++-- module/plugins/hoster/HellshareCz.py | 22 ++++----- module/plugins/hoster/HellspyCz.py | 47 ++++++------------- module/plugins/hoster/IfileIt.py | 19 +++----- module/plugins/hoster/IfolderRu.py | 25 ++++------ module/plugins/hoster/LetitbitNet.py | 42 +++++------------ module/plugins/hoster/MediafireCom.py | 7 ++- module/plugins/hoster/MegasharesCom.py | 21 +++------ module/plugins/hoster/MultishareCz.py | 20 +++----- module/plugins/hoster/QuickshareCz.py | 27 ++++------- module/plugins/hoster/SendspaceCom.py | 20 +++----- module/plugins/hoster/ShareRapidCom.py | 6 +-- module/plugins/hoster/SpeedfileCz.py | 29 +++--------- module/plugins/hoster/StahnuTo.py | 6 +-- module/plugins/hoster/UlozTo.py | 4 +- module/plugins/hoster/UloziskoSk.py | 20 +++----- module/plugins/hoster/UploadhereCom.py | 9 ++-- module/plugins/hoster/UploadkingCom.py | 21 +++------ module/plugins/internal/SimpleHoster.py | 12 ++--- 28 files changed, 173 insertions(+), 434 deletions(-) delete mode 100644 module/plugins/hoster/FlyshareCz.py diff --git a/module/plugins/accounts/HellspyCz.py b/module/plugins/accounts/HellspyCz.py index c07fd748a..5f14a093e 100644 --- a/module/plugins/accounts/HellspyCz.py +++ b/module/plugins/accounts/HellspyCz.py @@ -29,8 +29,7 @@ class HellspyCz(Account): __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") - ACTION_PATTERN = r'
]*action="([^"]+user_hash=([^"]+))">' - CREDIT_LEFT_PATTERN = r'(\d+)' + CREDIT_LEFT_PATTERN = r'Credits: \s*(\d+)' WRONG_PASSWORD_PATTERN = r'

\s*Wrong user or password was entered
' phpsessid = '' @@ -50,16 +49,13 @@ class HellspyCz(Account): return {"validuntil": -1, "trafficleft": credits} def login(self, user, data,req): - html = req.load('http://www.hellspy.com/') - found = re.search(self.ACTION_PATTERN, html) - if found is None: - self.logError('Parse error (FORM)') - action, self.phpsessid = found.group(1).replace('&','&'), found.group(2) - + header = req.load('http://www.hellspy.com/', just_header = True) + self.phpsessid = re.search(r'PHPSESSID=(\w+)', header).group(1) self.logDebug("PHPSESSID:" + self.phpsessid) + html = req.load("http://www.hellspy.com/--%s-" % self.phpsessid) - html = req.load(action, post={ + html = req.load("http://www.hell-share.com/user/login/?do=apiLoginForm-submit&api_hash=hellspy_iq&user_hash=%s" % self.phpsessid, post={ "login": "1", "password": data["password"], "username": user, @@ -70,10 +66,5 @@ class HellspyCz(Account): cj = self.getAccountCookies(user) cj.setCookie(".hellspy.com", "PHPSESSID", self.phpsessid) - self.logDebug(req.lastURL) - self.logDebug(req.lastEffectiveURL) - - html = req.load("http://www.hellspy.com/", get = {"do":"loginBox-login"}) - if not re.search(self.CREDIT_LEFT_PATTERN, html): self.wrongPassword() \ No newline at end of file diff --git a/module/plugins/hoster/BezvadataCz.py b/module/plugins/hoster/BezvadataCz.py index 4c198d95f..f061fa2b5 100644 --- a/module/plugins/hoster/BezvadataCz.py +++ b/module/plugins/hoster/BezvadataCz.py @@ -17,29 +17,19 @@ """ import re -from module.plugins.internal.SimpleHoster import SimpleHoster, parseFileInfo -from module.network.RequestFactory import getURL - -def getInfo(urls): - result = [] - - for url in urls: - file_info = parseFileInfo(BezvadataCz, url, getURL(url, decode=True)) - result.append(file_info) - - yield result +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class BezvadataCz(SimpleHoster): __name__ = "BezvadataCz" __type__ = "hoster" __pattern__ = r"http://(\w*\.)*bezvadata.cz/stahnout/.*" - __version__ = "0.21" + __version__ = "0.22" __description__ = """BezvaData.cz""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") - FILE_NAME_PATTERN = r'

Soubor: ([^<]+)

' - FILE_SIZE_PATTERN = r'
  • Velikost: ([0-9.]+) ([kKMG]i?B)
  • ' + FILE_NAME_PATTERN = r'

    Soubor: (?P[^<]+)

    ' + FILE_SIZE_PATTERN = r'
  • Velikost: (?P[0-9.]+) (?P[kKMG])i?)
  • ' FILE_OFFLINE_PATTERN = r'BezvaData \| Soubor nenalezen' DOWNLOAD_FORM_PATTERN = r'
    ' @@ -50,4 +40,6 @@ class BezvadataCz(SimpleHoster): self.logDebug("Download form: %s" % url) self.download(url, post = {"stahnoutSoubor": "St%C3%A1hnout"}, cookies = True) + +getInfo = create_getInfo(BezvadataCz) \ No newline at end of file diff --git a/module/plugins/hoster/CzshareCom.py b/module/plugins/hoster/CzshareCom.py index 3684e5f53..1a705e302 100644 --- a/module/plugins/hoster/CzshareCom.py +++ b/module/plugins/hoster/CzshareCom.py @@ -45,7 +45,7 @@ class CzshareCom(SimpleHoster): __name__ = "CzshareCom" __type__ = "hoster" __pattern__ = r"http://(\w*\.)*czshare\.(com|cz)/(\d+/|download.php\?).*" - __version__ = "0.83" + __version__ = "0.84" __description__ = """CZshare.com""" __author_name__ = ("zoidberg") @@ -58,8 +58,8 @@ class CzshareCom(SimpleHoster): FILE_OFFLINE_PATTERN = r'
    \s*

    ' MULTIDL_PATTERN = r"

    Z[^<]*PROFI.

    " #FILE_NAME_PATTERN = r'

    ([^<]+) 

    ' - FILE_NAME_PATTERN = r'
    \s*

    \s*Cel. n.zev: ]*>([^<]+)' - FILE_SIZE_PATTERN = r'

    (?:\s*

    [^\n]*

    )*\s*Velikost:\s*([0-9., ]+)([kKMG]i?B)\s*
    ' + FILE_NAME_PATTERN = r'
    \s*

    \s*Cel. n.zev: ]*>(?P[^<]+)' + FILE_SIZE_PATTERN = r'

    (?:\s*

    [^\n]*

    )*\s*Velikost:\s*(?P[0-9., ]+)(?P[kKMG])i?B\s*
    ' USER_CREDIT_PATTERN = r'
    \s*kredit: ([0-9., ]+)([kKMG]i?B)\s*
    ' def setup(self): diff --git a/module/plugins/hoster/DataportCz.py b/module/plugins/hoster/DataportCz.py index ed4ffa07c..487766201 100644 --- a/module/plugins/hoster/DataportCz.py +++ b/module/plugins/hoster/DataportCz.py @@ -17,28 +17,18 @@ """ import re -from module.plugins.internal.SimpleHoster import SimpleHoster, parseFileInfo -from module.network.RequestFactory import getURL - -def getInfo(urls): - result = [] - - for url in urls: - file_info = parseFileInfo(DataportCz, url, getURL(url, decode=True)) - result.append(file_info) - - yield result +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class DataportCz(SimpleHoster): __name__ = "DataportCz" __type__ = "hoster" __pattern__ = r"http://.*dataport.cz/file/.*" - __version__ = "0.32" + __version__ = "0.33" __description__ = """Dataport.cz plugin - free only""" __author_name__ = ("zoidberg") - FILE_NAME_PATTERN = r'

    ([^<]+)

    ' - FILE_SIZE_PATTERN = r'Velikost souboru:\s*([0-9.]+)([kKMG]i?B)' + FILE_NAME_PATTERN = r'

    (?P[^<]+)

    ' + FILE_SIZE_PATTERN = r'Velikost souboru:\s*(?P[0-9.]+)(?P[kKMG])i?B' URL_PATTERN = r']*class="ui-state-default button hover ui-corner-all ">' NO_SLOTS_PATTERN = r']*class="ui-state-default button hover ui-corner-all ui-state-disabled">' FILE_OFFLINE_PATTERN = r'

    Soubor nebyl nalezen

    ' @@ -54,4 +44,6 @@ class DataportCz(SimpleHoster): self.fail("Parse error (URL)") download_url = found.group(1) - self.download(download_url) \ No newline at end of file + self.download(download_url) + +create_getInfo(DataportCz) \ No newline at end of file diff --git a/module/plugins/hoster/DepositfilesCom.py b/module/plugins/hoster/DepositfilesCom.py index 13a8abe03..87e5e7254 100644 --- a/module/plugins/hoster/DepositfilesCom.py +++ b/module/plugins/hoster/DepositfilesCom.py @@ -20,12 +20,12 @@ class DepositfilesCom(SimpleHoster): __name__ = "DepositfilesCom" __type__ = "hoster" __pattern__ = r"http://[\w\.]*?depositfiles\.com(/\w{1,3})?/files/[\w]+" - __version__ = "0.35" + __version__ = "0.36" __description__ = """Depositfiles.com Download Hoster""" __author_name__ = ("spoob", "zoidberg") __author_mail__ = ("spoob@pyload.org", "zoidberg@mujmail.cz") - FILE_INFO_PATTERN = r'File name: .*\s*File size: ([0-9.]+) ([kKMG]i?B)' + FILE_INFO_PATTERN = r'File name: .*\s*File size: (?P[0-9.]+) (?P[kKMG])i?B' FILE_OFFLINE_PATTERN = r'' RECAPTCHA_PATTERN = r"Recaptcha.create\('([^']+)', this\);" DOWNLOAD_LINK_PATTERN = r'' - FILE_NAME_PATTERN = r'' + FILE_INFO_PATTERN = r'\s*.*?\((?P[0-9.]*) (?P[kKMG])i?B\)' ACTION_PATTERN = r'/en/download/(\d+/.*\.html)' DLLINK_PATTERN = r'http://.*edisk.cz.*\.html' FILE_OFFLINE_PATTERN = r'

    This file does not exist due to one of the following:

    • ' @@ -60,21 +42,11 @@ class EdiskCz(Hoster): self.logDebug('URL:' + url) found = re.search(self.ACTION_PATTERN, url) - if found is None: - self.fail("Parse error (ACTION)") + if found is None: self.parseError("ACTION") action = found.group(1) self.html = self.load(url, decode=True) - - if re.search(self.FILE_OFFLINE_PATTERN, self.html) is not None: - self.offline() - - found = re.search(self.FILE_NAME_PATTERN, self.html) - if found is None: - self.fail("Parse error (FILENAME)") - pyfile.name = found.group(1) - - self.logDebug('NAME:' + pyfile.name) + self.getFileInfo() self.html = self.load(re.sub("/en/download/", "/en/download-slow/", url)) @@ -85,4 +57,6 @@ class EdiskCz(Hoster): if not re.match(self.DLLINK_PATTERN, url): self.fail("Unexpected server response") - self.download(url) \ No newline at end of file + self.download(url) + +getInfo = create_getInfo(EdiskCz) \ No newline at end of file diff --git a/module/plugins/hoster/FilejungleCom.py b/module/plugins/hoster/FilejungleCom.py index 597d1aa3f..b880086a6 100644 --- a/module/plugins/hoster/FilejungleCom.py +++ b/module/plugins/hoster/FilejungleCom.py @@ -17,29 +17,20 @@ """ import re -from module.plugins.internal.SimpleHoster import SimpleHoster, parseFileInfo +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo from module.network.RequestFactory import getURL from module.plugins.ReCaptcha import ReCaptcha -def getInfo(urls): - result = [] - - for url in urls: - file_info = parseFileInfo(FilejungleCom, url, getURL(url, decode=True)) - result.append(file_info) - - yield result - class FilejungleCom(SimpleHoster): __name__ = "FilejungleCom" __type__ = "hoster" __pattern__ = r"http://(?:www\.)?filejungle\.com/f/([^/]+).*" - __version__ = "0.22" + __version__ = "0.23" __description__ = """Filejungle.com plugin - free only""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") - FILE_INFO_PATTERN = r'
      ([^<]+) \(([0-9.]+) (KB|MB|GB)\)
      ' + FILE_INFO_PATTERN = r'
      (?P[^<]+) \((?P[0-9.]+) (?P[kKMG])i?B\)
      ' FILE_OFFLINE_PATTERN = r'class="error_msg_title"> Invalid or Deleted File.
    ' RECAPTCHA_KEY_PATTERN = r"var reCAPTCHA_publickey='([^']+)'" WAIT_TIME_PATTERN = r'

    Please wait for (\d+) seconds to download the next file\.

    ' @@ -89,4 +80,6 @@ class FilejungleCom(SimpleHoster): self.wait() response = self.load(url, post = {"downloadLink" : "show"}) - self.download(url, post = {"download" : "normal"}) \ No newline at end of file + self.download(url, post = {"download" : "normal"}) + +getInfo = create_getInfo(FilejungleCom) \ No newline at end of file diff --git a/module/plugins/hoster/FilepostCom.py b/module/plugins/hoster/FilepostCom.py index 779eef1d2..42ec0788b 100644 --- a/module/plugins/hoster/FilepostCom.py +++ b/module/plugins/hoster/FilepostCom.py @@ -17,44 +17,36 @@ """ import re -from module.plugins.internal.SimpleHoster import SimpleHoster, parseFileInfo +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo from module.network.RequestFactory import getURL from module.plugins.ReCaptcha import ReCaptcha from module.common.json_layer import json_loads from time import time -def getInfo(urls): - result = [] - - for url in urls: - file_info = parseFileInfo(FilepostCom, url, getURL(url, decode=True)) - result.append(file_info) - - yield result - class FilepostCom(SimpleHoster): __name__ = "FilepostCom" __type__ = "hoster" __pattern__ = r"https?://(?:www\.)?filepost\.com/files/([^/]+).*" - __version__ = "0.22" + __version__ = "0.23" __description__ = """Filepost.com plugin - free only""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") - FILE_INFO_PATTERN = r'

    ([^<]+)

    \s*
    \s*