diff options
Diffstat (limited to 'module/plugins')
54 files changed, 314 insertions, 143 deletions
| diff --git a/module/plugins/Plugin.py b/module/plugins/Plugin.py index fa1d2c3b1..d17776485 100644 --- a/module/plugins/Plugin.py +++ b/module/plugins/Plugin.py @@ -335,9 +335,9 @@ class Plugin(Base):          img = self.load(url, get=get, post=post, cookies=cookies)          id = ("%.2f" % time())[-6:].replace(".", "") -        temp_file = open(join("tmp", "tmpCaptcha_%s_%s.%s" % (self.__name__, id, imgtype)), "wb") -        temp_file.write(img) -        temp_file.close() +        tmpCaptcha = open(join("tmp", "tmpCaptcha_%s_%s.%s" % (self.__name__, id, imgtype)), "wb") +        tmpCaptcha.write(img) +        tmpCaptcha.close()          has_plugin = self.__name__ in self.core.pluginManager.captchaPlugins @@ -351,10 +351,10 @@ class Plugin(Base):              if self.pyfile.abort: raise Abort              ocr = Ocr() -            result = ocr.get_captcha(temp_file.name) +            result = ocr.get_captcha(tmpCaptcha.name)          else:              captchaManager = self.core.captchaManager -            task = captchaManager.newTask(img, imgtype, temp_file.name, result_type) +            task = captchaManager.newTask(img, imgtype, tmpCaptcha.name, result_type)              self.cTask = task              captchaManager.handleCaptcha(task) @@ -378,7 +378,7 @@ class Plugin(Base):          if not self.core.debug:              try: -                remove(temp_file.name) +                remove(tmpCaptcha.name)              except:                  pass diff --git a/module/plugins/accounts/BillionuploadsCom.py b/module/plugins/accounts/BillionuploadsCom.py index 54f0db1c6..3e8fd35c2 100644 --- a/module/plugins/accounts/BillionuploadsCom.py +++ b/module/plugins/accounts/BillionuploadsCom.py @@ -13,4 +13,4 @@ class BillionuploadsCom(XFSPAccount):      __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] -    HOSTER_URL = "http://www.billionuploads.com/" +    HOSTER_NAME = "billionuploads.com" diff --git a/module/plugins/accounts/CramitIn.py b/module/plugins/accounts/CramitIn.py index 5edc2dac0..98e14bb3a 100644 --- a/module/plugins/accounts/CramitIn.py +++ b/module/plugins/accounts/CramitIn.py @@ -13,4 +13,4 @@ class CramitIn(XFSPAccount):      __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] -    HOSTER_URL = "http://www.cramit.in/" +    HOSTER_NAME = "cramit.in" diff --git a/module/plugins/accounts/EasybytezCom.py b/module/plugins/accounts/EasybytezCom.py index 00732c12d..f88e9ed4c 100644 --- a/module/plugins/accounts/EasybytezCom.py +++ b/module/plugins/accounts/EasybytezCom.py @@ -19,7 +19,7 @@ class EasybytezCom(XFSPAccount):                     ("guidobelix", "guidobelix@hotmail.it")] -    HOSTER_URL = "http://www.easybytez.com/" +    HOSTER_NAME = "easybytez.com"      def loadAccountInfo(self, user, req): @@ -52,6 +52,6 @@ class EasybytezCom(XFSPAccount):              if "Unlimited" in trafficleft:                  trafficleft = -1              else: -                trafficleft = parseFileSize(trafficleft) / 1024 +                trafficleft = parseFileSize(trafficleft)          return {"validuntil": validuntil, "trafficleft": trafficleft, "premium": premium} diff --git a/module/plugins/accounts/FastshareCz.py b/module/plugins/accounts/FastshareCz.py index a199ad36c..1f74ea2f9 100644 --- a/module/plugins/accounts/FastshareCz.py +++ b/module/plugins/accounts/FastshareCz.py @@ -24,7 +24,7 @@ class FastshareCz(Account):          m = re.search(self.CREDIT_PATTERN, html)          if m: -            trafficleft = parseFileSize(m.group(1)) / 1024 +            trafficleft = parseFileSize(m.group(1))              premium = True if trafficleft else False          else:              trafficleft = None diff --git a/module/plugins/accounts/File4safeCom.py b/module/plugins/accounts/File4safeCom.py index 0a930ed77..a301f70bc 100644 --- a/module/plugins/accounts/File4safeCom.py +++ b/module/plugins/accounts/File4safeCom.py @@ -13,7 +13,7 @@ class File4safeCom(XFSPAccount):      __authors__ = [("stickell", "l.stickell@yahoo.it")] -    HOSTER_URL = "http://www.file4safe.com/" +    HOSTER_NAME = "file4safe.com"      LOGIN_FAIL_PATTERN = r'input_login'      PREMIUM_PATTERN = r'Extend Premium' diff --git a/module/plugins/accounts/FileParadoxIn.py b/module/plugins/accounts/FileParadoxIn.py index 6a10e213f..6d55f254e 100644 --- a/module/plugins/accounts/FileParadoxIn.py +++ b/module/plugins/accounts/FileParadoxIn.py @@ -13,4 +13,4 @@ class FileParadoxIn(XFSPAccount):      __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] -    HOSTER_URL = "http://www.fileparadox.in/" +    HOSTER_NAME = "fileparadox.in" diff --git a/module/plugins/accounts/FileomCom.py b/module/plugins/accounts/FileomCom.py index 45bff8f92..565acf6ab 100644 --- a/module/plugins/accounts/FileomCom.py +++ b/module/plugins/accounts/FileomCom.py @@ -13,4 +13,4 @@ class FileomCom(XFSPAccount):      __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] -    HOSTER_URL = "http://www.fileom.com/" +    HOSTER_NAME = "fileom.com" diff --git a/module/plugins/accounts/FilerNet.py b/module/plugins/accounts/FilerNet.py index 8bd66221f..82f78ed0c 100644 --- a/module/plugins/accounts/FilerNet.py +++ b/module/plugins/accounts/FilerNet.py @@ -34,7 +34,7 @@ class FilerNet(Account):          traffic = re.search(self.TRAFFIC_PATTERN, html)          if until and traffic:              validuntil = int(time.mktime(time.strptime(until.group(1), "%d.%m.%Y %H:%M:%S"))) -            trafficleft = parseFileSize(traffic.group(1)) / 1024 +            trafficleft = parseFileSize(traffic.group(1))              return {"premium": True, "validuntil": validuntil, "trafficleft": trafficleft}          else:              self.logError("Unable to retrieve account information - Plugin may be out of date") diff --git a/module/plugins/accounts/FilerioCom.py b/module/plugins/accounts/FilerioCom.py index 51bf106ed..d50b70a57 100644 --- a/module/plugins/accounts/FilerioCom.py +++ b/module/plugins/accounts/FilerioCom.py @@ -13,4 +13,4 @@ class FilerioCom(XFSPAccount):      __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] -    HOSTER_URL = "http://www.filerio.in/" +    HOSTER_NAME = "filerio.in" diff --git a/module/plugins/accounts/HugefilesNet.py b/module/plugins/accounts/HugefilesNet.py index 0adc1e511..11e0beab9 100644 --- a/module/plugins/accounts/HugefilesNet.py +++ b/module/plugins/accounts/HugefilesNet.py @@ -13,4 +13,4 @@ class HugefilesNet(XFSPAccount):      __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] -    HOSTER_URL = "http://www.hugefiles.net/" +    HOSTER_NAME = "hugefiles.net" diff --git a/module/plugins/accounts/HundredEightyUploadCom.py b/module/plugins/accounts/HundredEightyUploadCom.py index 1c78edfa4..3bee13ef9 100644 --- a/module/plugins/accounts/HundredEightyUploadCom.py +++ b/module/plugins/accounts/HundredEightyUploadCom.py @@ -13,4 +13,4 @@ class HundredEightyUploadCom(XFSPAccount):      __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] -    HOSTER_URL = "http://www.180upload.com/" +    HOSTER_NAME = "180upload.com" diff --git a/module/plugins/accounts/JunocloudMe.py b/module/plugins/accounts/JunocloudMe.py index 8cd7e8dde..4fae6c510 100644 --- a/module/plugins/accounts/JunocloudMe.py +++ b/module/plugins/accounts/JunocloudMe.py @@ -13,4 +13,4 @@ class JunocloudMe(XFSPAccount):      __authors__ = [("guidobelix", "guidobelix@hotmail.it")] -    HOSTER_URL = "http://www.junocloud.me/" +    HOSTER_NAME = "junocloud.me" diff --git a/module/plugins/accounts/LinestorageCom.py b/module/plugins/accounts/LinestorageCom.py new file mode 100644 index 000000000..656248e88 --- /dev/null +++ b/module/plugins/accounts/LinestorageCom.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- + +from module.plugins.internal.XFSPAccount import XFSPAccount + + +class LinestorageCom(XFSPAccount): +    __name__ = "LinestorageCom" +    __type__ = "account" +    __version__ = "0.01" + +    __description__ = """Linestorage.com account plugin""" +    __license__ = "GPLv3" +    __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] + + +    HOSTER_NAME = "linestorage.com" diff --git a/module/plugins/accounts/LomafileCom.py b/module/plugins/accounts/LomafileCom.py index c3e75b1d9..f9b99eb3a 100644 --- a/module/plugins/accounts/LomafileCom.py +++ b/module/plugins/accounts/LomafileCom.py @@ -13,4 +13,4 @@ class LomafileCom(XFSPAccount):      __authors__ = [("guidobelix", "guidobelix@hotmail.it")] -    HOSTER_URL = "http://www.lomafile.com/" +    HOSTER_NAME = "lomafile.com" diff --git a/module/plugins/accounts/MovReelCom.py b/module/plugins/accounts/MovReelCom.py index 3f641cf72..764dc2c66 100644 --- a/module/plugins/accounts/MovReelCom.py +++ b/module/plugins/accounts/MovReelCom.py @@ -16,4 +16,4 @@ class MovReelCom(XFSPAccount):      login_timeout = 60      info_threshold = 30 -    HOSTER_URL = "http://www.movreel.com/" +    HOSTER_NAME = "movreel.com" diff --git a/module/plugins/accounts/MultishareCz.py b/module/plugins/accounts/MultishareCz.py index ae32b8806..813f36496 100644 --- a/module/plugins/accounts/MultishareCz.py +++ b/module/plugins/accounts/MultishareCz.py @@ -26,7 +26,7 @@ class MultishareCz(Account):          html = req.load("http://www.multishare.cz/profil/", decode=True)          m = re.search(self.TRAFFIC_LEFT_PATTERN, html) -        trafficleft = parseFileSize(m.group('S'), m.group('U')) / 1024 if m else 0 +        trafficleft = parseFileSize(m.group('S'), m.group('U')) if m else 0          self.premium = True if trafficleft else False          html = req.load("http://www.multishare.cz/", decode=True) diff --git a/module/plugins/accounts/NosuploadCom.py b/module/plugins/accounts/NosuploadCom.py index 3be5f110d..f8561d25f 100644 --- a/module/plugins/accounts/NosuploadCom.py +++ b/module/plugins/accounts/NosuploadCom.py @@ -13,4 +13,4 @@ class NosuploadCom(XFSPAccount):      __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] -    HOSTER_URL = "http://www.nosupload.com/" +    HOSTER_NAME = "nosupload.com" diff --git a/module/plugins/accounts/NovafileCom.py b/module/plugins/accounts/NovafileCom.py index 823f486c7..5b85445e7 100644 --- a/module/plugins/accounts/NovafileCom.py +++ b/module/plugins/accounts/NovafileCom.py @@ -13,4 +13,4 @@ class NovafileCom(XFSPAccount):      __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] -    HOSTER_URL = "http://www.novafile.com/" +    HOSTER_NAME = "novafile.com" diff --git a/module/plugins/accounts/OboomCom.py b/module/plugins/accounts/OboomCom.py index ba71fcbbd..a0d945342 100644 --- a/module/plugins/accounts/OboomCom.py +++ b/module/plugins/accounts/OboomCom.py @@ -53,8 +53,8 @@ class OboomCom(Account):          return {'premium': premium,                  'validuntil': validUntil, -                'trafficleft': trafficLeft / 1024, -                'maxtraffic': maxTraffic / 1024, +                'trafficleft': trafficLeft, +                'maxtraffic': maxTraffic,                  'session': session} diff --git a/module/plugins/accounts/PremiumTo.py b/module/plugins/accounts/PremiumTo.py index d13d9b866..7875e5021 100644 --- a/module/plugins/accounts/PremiumTo.py +++ b/module/plugins/accounts/PremiumTo.py @@ -20,7 +20,7 @@ class PremiumTo(Account):                           get={'username': self.username, 'password': self.password})          traffic = sum(map(int, api_r.split(';'))) -        return {"trafficleft": int(traffic) / 1024, "validuntil": -1} +        return {"trafficleft": int(traffic), "validuntil": -1}      def login(self, user, data, req): diff --git a/module/plugins/accounts/PremiumizeMe.py b/module/plugins/accounts/PremiumizeMe.py index a234a8d93..e65b9ec4b 100644 --- a/module/plugins/accounts/PremiumizeMe.py +++ b/module/plugins/accounts/PremiumizeMe.py @@ -22,7 +22,7 @@ class PremiumizeMe(Account):          # Parse account info          account_info = {"validuntil": float(status['result']['expires']), -                        "trafficleft": max(0, status['result']['trafficleft_bytes'] / 1024)} +                        "trafficleft": max(0, status['result']['trafficleft_bytes'])}          if status['result']['type'] == 'free':              account_info['premium'] = False diff --git a/module/plugins/accounts/QuickshareCz.py b/module/plugins/accounts/QuickshareCz.py index fa0acd06d..e83f7308d 100644 --- a/module/plugins/accounts/QuickshareCz.py +++ b/module/plugins/accounts/QuickshareCz.py @@ -20,7 +20,7 @@ class QuickshareCz(Account):          m = re.search(r'Stav kreditu: <strong>(.+?)</strong>', html)          if m: -            trafficleft = parseFileSize(m.group(1)) / 1024 +            trafficleft = parseFileSize(m.group(1))              premium = True if trafficleft else False          else:              trafficleft = None diff --git a/module/plugins/accounts/RapidfileshareNet.py b/module/plugins/accounts/RapidfileshareNet.py index 0b021aea7..63207acbb 100644 --- a/module/plugins/accounts/RapidfileshareNet.py +++ b/module/plugins/accounts/RapidfileshareNet.py @@ -6,14 +6,13 @@ from module.plugins.internal.XFSPAccount import XFSPAccount  class RapidfileshareNet(XFSPAccount):      __name__ = "RapidfileshareNet"      __type__ = "account" -    __version__ = "0.02" +    __version__ = "0.03"      __description__ = """Rapidfileshare.net account plugin"""      __license__ = "GPLv3"      __authors__ = [("guidobelix", "guidobelix@hotmail.it")] -    HOSTER_URL = "http://www.rapidfileshare.net/" +    HOSTER_NAME = "rapidfileshare.net" -    TRAFFIC_LEFT_PATTERN = r'>Traffic available today:</TD><TD><label for="name">\s*(?P<S>[\d.,]+)\s*(?:(?P<U>[\w^_]+)\s*)?</label></TD></TR>' -     +    TRAFFIC_LEFT_PATTERN = r'>Traffic available today:</TD><TD><label for="name">\s*(?P<S>[\d.,]+)\s*(?P<U>[\w^_]+)\s*</label></TD></TR>' diff --git a/module/plugins/accounts/RapidgatorNet.py b/module/plugins/accounts/RapidgatorNet.py index 981f2f90f..c6833a0f3 100644 --- a/module/plugins/accounts/RapidgatorNet.py +++ b/module/plugins/accounts/RapidgatorNet.py @@ -31,7 +31,7 @@ class RapidgatorNet(Account):                      self.scheduleRefresh(user, json['response']['reset_in'])                  return {"validuntil": json['response']['expire_date'], -                        "trafficleft": int(json['response']['traffic_left']) / 1024, +                        "trafficleft": int(json['response']['traffic_left']),                          "premium": True}              else:                  self.logError(json['response_details']) diff --git a/module/plugins/accounts/RarefileNet.py b/module/plugins/accounts/RarefileNet.py index 303c38396..0bb1920de 100644 --- a/module/plugins/accounts/RarefileNet.py +++ b/module/plugins/accounts/RarefileNet.py @@ -13,4 +13,4 @@ class RarefileNet(XFSPAccount):      __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] -    HOSTER_URL = "http://www.rarefile.net/" +    HOSTER_NAME = "rarefile.net" diff --git a/module/plugins/accounts/RyushareCom.py b/module/plugins/accounts/RyushareCom.py index e2635277a..8eec508a3 100644 --- a/module/plugins/accounts/RyushareCom.py +++ b/module/plugins/accounts/RyushareCom.py @@ -14,7 +14,7 @@ class RyushareCom(XFSPAccount):                     ("trance4us", None)] -    HOSTER_URL = "http://www.ryushare.com/" +    HOSTER_NAME = "ryushare.com"      def login(self, user, data, req): diff --git a/module/plugins/accounts/SecureUploadEu.py b/module/plugins/accounts/SecureUploadEu.py index 11a13f383..a7d86523c 100644 --- a/module/plugins/accounts/SecureUploadEu.py +++ b/module/plugins/accounts/SecureUploadEu.py @@ -13,4 +13,4 @@ class SecureUploadEu(XFSPAccount):      __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] -    HOSTER_URL = "http://www.secureupload.eu/" +    HOSTER_NAME = "secureupload.eu" diff --git a/module/plugins/accounts/SendmywayCom.py b/module/plugins/accounts/SendmywayCom.py index fdc8b85d9..674f5b183 100644 --- a/module/plugins/accounts/SendmywayCom.py +++ b/module/plugins/accounts/SendmywayCom.py @@ -13,4 +13,4 @@ class SendmywayCom(XFSPAccount):      __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] -    HOSTER_URL = "http://www.sendmyway.com/" +    HOSTER_NAME = "sendmyway.com" diff --git a/module/plugins/accounts/SimplyPremiumCom.py b/module/plugins/accounts/SimplyPremiumCom.py index 442aaa9f3..2fe41abef 100644 --- a/module/plugins/accounts/SimplyPremiumCom.py +++ b/module/plugins/accounts/SimplyPremiumCom.py @@ -25,8 +25,8 @@ class SimplyPremiumCom(Account):          #Time package          validuntil = float(json_data['result']['timeend'])          #Traffic package -        # {"trafficleft": int(traffic) / 1024, "validuntil": -1} -        #trafficleft = int(json_data['result']['traffic'] / 1024) +        # {"trafficleft": int(traffic), "validuntil": -1} +        #trafficleft = int(json_data['result']['traffic'])          #return {"premium": True, "validuntil": validuntil, "trafficleft": trafficleft}          return {"premium": True, "validuntil": validuntil} diff --git a/module/plugins/accounts/StreamcloudEu.py b/module/plugins/accounts/StreamcloudEu.py index 9e69a7ae4..6cdb5efe0 100644 --- a/module/plugins/accounts/StreamcloudEu.py +++ b/module/plugins/accounts/StreamcloudEu.py @@ -13,4 +13,4 @@ class StreamcloudEu(XFSPAccount):      __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] -    HOSTER_URL = "http://www.streamcloud.eu/" +    HOSTER_NAME = "streamcloud.eu" diff --git a/module/plugins/accounts/TusfilesNet.py b/module/plugins/accounts/TusfilesNet.py index 775aab9c0..dcb9fa104 100644 --- a/module/plugins/accounts/TusfilesNet.py +++ b/module/plugins/accounts/TusfilesNet.py @@ -11,14 +11,14 @@ from module.utils import parseFileSize  class TusfilesNet(XFSPAccount):      __name__ = "TusfilesNet"      __type__ = "account" -    __version__ = "0.03" +    __version__ = "0.04"      __description__ = """ Tusfile.net account plugin """      __license__ = "GPLv3"      __authors__ = [("guidobelix", "guidobelix@hotmail.it")] -    HOSTER_URL = "http://www.tusfiles.net/" +    HOSTER_NAME = "tusfiles.net"      VALID_UNTIL_PATTERN = r'<span class="label label-default">([^<]+)</span>' -    TRAFFIC_LEFT_PATTERN = r'<td><img src="//www\.tusfiles\.net/i/icon/meter\.png" alt=""/></td>\n<td> (?P<S>[^<]+)</td>' +    TRAFFIC_LEFT_PATTERN = r'<td><img src="//www\.tusfiles\.net/i/icon/meter\.png" alt=""/></td>\n<td> (?P<S>[\d.,]+)\s*(?P<U>[\w^_]+)\s*</td>' diff --git a/module/plugins/accounts/UnrestrictLi.py b/module/plugins/accounts/UnrestrictLi.py index 5a02e04a2..f89eab473 100644 --- a/module/plugins/accounts/UnrestrictLi.py +++ b/module/plugins/accounts/UnrestrictLi.py @@ -23,7 +23,7 @@ class UnrestrictLi(Account):              return {"premium": False}          validuntil = json_data['result']['expires'] -        trafficleft = int(json_data['result']['traffic'] / 1024) +        trafficleft = int(json_data['result']['traffic'])          return {"premium": True, "validuntil": validuntil, "trafficleft": trafficleft} diff --git a/module/plugins/accounts/UploadcCom.py b/module/plugins/accounts/UploadcCom.py new file mode 100644 index 000000000..58ca6c985 --- /dev/null +++ b/module/plugins/accounts/UploadcCom.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- + +from module.plugins.internal.XFSPAccount import XFSPAccount + + +class UploadcCom(XFSPAccount): +    __name__ = "UploadcCom" +    __type__ = "account" +    __version__ = "0.01" + +    __description__ = """Uploadc.com account plugin""" +    __license__ = "GPLv3" +    __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] + + +    HOSTER_NAME = "uploadc.com" diff --git a/module/plugins/accounts/UptoboxCom.py b/module/plugins/accounts/UptoboxCom.py index 090cc85df..aed769f7d 100644 --- a/module/plugins/accounts/UptoboxCom.py +++ b/module/plugins/accounts/UptoboxCom.py @@ -13,6 +13,6 @@ class UptoboxCom(XFSPAccount):      __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] -    HOSTER_URL = "http://www.uptobox.com/" +    HOSTER_NAME = "uptobox.com"      VALID_UNTIL_PATTERN = r'>Premium.[Aa]ccount expire: ([^<]+)</strong>' diff --git a/module/plugins/accounts/VidPlayNet.py b/module/plugins/accounts/VidPlayNet.py index 904041939..286adfc13 100644 --- a/module/plugins/accounts/VidPlayNet.py +++ b/module/plugins/accounts/VidPlayNet.py @@ -13,4 +13,4 @@ class VidPlayNet(XFSPAccount):      __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] -    HOSTER_URL = "http://www.vidplay.net/" +    HOSTER_NAME = "vidplay.net" diff --git a/module/plugins/accounts/XFileSharingPro.py b/module/plugins/accounts/XFileSharingPro.py new file mode 100644 index 000000000..5be377c40 --- /dev/null +++ b/module/plugins/accounts/XFileSharingPro.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- + +import re + +from module.plugins.internal.XFSPAccount import XFSPAccount + + +class XFileSharingPro(XFSPAccount): +    __name__ = "XFileSharingPro" +    __type__ = "account" +    __version__ = "0.02" + +    __description__ = """XFileSharingPro dummy account plugin""" +    __license__ = "GPLv3" +    __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] + + +    HOSTER_NAME = None + + +    def loadAccountInfo(self, user, req): +        if self.HOSTER_NAME: +            return super(XFileSharingPro, self).loadAccountInfo(user, req) +        else: +            return {'validuntil': None, 'trafficleft': None, 'premium': None} + + +    def login(self, user, data, req): +        if self.HOSTER_NAME: +            return super(XFileSharingPro, self).login(user, data, req) diff --git a/module/plugins/captcha/captcha.py b/module/plugins/captcha/captcha.py index b3d4bd57e..fb85d8996 100644 --- a/module/plugins/captcha/captcha.py +++ b/module/plugins/captcha/captcha.py @@ -51,28 +51,25 @@ class OCR(object):          self.logger.debug("Tesseract ReturnCode %s Output: %s" % (popen.returncode, output))      def run_tesser(self, subset=False, digits=True, lowercase=True, uppercase=True): -        #self.logger.debug("create tmp tif") +        #tmpTif = tempfile.NamedTemporaryFile(suffix=".tif") +        tmpTif = open(join("tmp", "tmpTif_%s.tif" % self.__name__), "wb") +        tmpTif.close() -        #tmp = tempfile.NamedTemporaryFile(suffix=".tif") -        tmp = open(join("tmp", "tmpTif_%s.tif" % self.__name__), "wb") -        tmp.close() -        #self.logger.debug("create tmp txt")          #tmpTxt = tempfile.NamedTemporaryFile(suffix=".txt")          tmpTxt = open(join("tmp", "tmpTxt_%s.txt" % self.__name__), "wb")          tmpTxt.close()          self.logger.debug("save tiff") -        self.image.save(tmp.name, 'TIFF') +        self.image.save(tmpTif.name, 'TIFF')          if os.name == "nt":              tessparams = [join(pypath, "tesseract", "tesseract.exe")]          else:              tessparams = ["tesseract"] -        tessparams.extend( [abspath(tmp.name), abspath(tmpTxt.name).replace(".txt", "")] ) +        tessparams.extend( [abspath(tmpTif.name), abspath(tmpTxt.name).replace(".txt", "")] )          if subset and (digits or lowercase or uppercase): -            #self.logger.debug("create temp subset config")              #tmpSub = tempfile.NamedTemporaryFile(suffix=".subset")              tmpSub = open(join("tmp", "tmpSub_%s.subset" % self.__name__), "wb")              tmpSub.write("tessedit_char_whitelist ") @@ -99,7 +96,7 @@ class OCR(object):          self.logger.debug(self.result_captcha)          try: -            os.remove(tmp.name) +            os.remove(tmpTif.name)              os.remove(tmpTxt.name)              if subset and (digits or lowercase or uppercase):                  os.remove(tmpSub.name) diff --git a/module/plugins/crypter/EasybytezComFolder.py b/module/plugins/crypter/EasybytezComFolder.py index 0b73a10ae..4ced45355 100644 --- a/module/plugins/crypter/EasybytezComFolder.py +++ b/module/plugins/crypter/EasybytezComFolder.py @@ -1,12 +1,12 @@  # -*- coding: utf-8 -*- -from module.plugins.internal.SimpleCrypter import SimpleCrypter +from module.plugins.internal.XFSPCrypter import XFSPCrypter -class EasybytezComFolder(SimpleCrypter): +class EasybytezComFolder(XFSPCrypter):      __name__ = "EasybytezComFolder"      __type__ = "crypter" -    __version__ = "0.08" +    __version__ = "0.09"      __pattern__ = r'http://(?:www\.)?easybytez\.com/users/(?P<ID>\d+/\d+)' @@ -15,9 +15,6 @@ class EasybytezComFolder(SimpleCrypter):      __authors__ = [("stickell", "l.stickell@yahoo.it")] -    URL_REPLACEMENTS = [(__pattern__, r"http://www.easybytez.com/users/\g<ID>?per_page=10000")] - -    LINK_PATTERN = r'<td><a href="(http://www\.easybytez\.com/\w+)" target="_blank">.+(?:</a>)?</td>' -    TITLE_PATTERN = r'<Title>Files of \d+: (.+) folder</Title>' +    HOSTER_NAME = "easybytez.com"      LOGIN_ACCOUNT = True diff --git a/module/plugins/crypter/HotfileFolderCom.py b/module/plugins/crypter/HotfileComFolder.py index d9e4e4c39..c2c999275 100644 --- a/module/plugins/crypter/HotfileFolderCom.py +++ b/module/plugins/crypter/HotfileComFolder.py @@ -3,8 +3,8 @@  from module.plugins.internal.DeadCrypter import DeadCrypter -class HotfileFolderCom(DeadCrypter): -    __name__ = "HotfileFolderCom" +class HotfileComFolder(DeadCrypter): +    __name__ = "HotfileComFolder"      __type__ = "crypter"      __version__ = "0.3" diff --git a/module/plugins/crypter/JunocloudMeFolder.py b/module/plugins/crypter/JunocloudMeFolder.py index 9e5fa1cbf..32c68e191 100644 --- a/module/plugins/crypter/JunocloudMeFolder.py +++ b/module/plugins/crypter/JunocloudMeFolder.py @@ -1,12 +1,12 @@  # -*- coding: utf-8 -*- -from module.plugins.internal.SimpleCrypter import SimpleCrypter +from module.plugins.internal.XFSPCrypter import XFSPCrypter -class JunocloudMeFolder(SimpleCrypter): +class JunocloudMeFolder(XFSPCrypter):      __name__ = "JunocloudMeFolder"      __type__ = "crypter" -    __version__ = "0.01" +    __version__ = "0.02"      __pattern__ = r'http://(?:www\.)?junocloud\.me/folders/(?P<ID>\d+/\w+)' @@ -15,6 +15,4 @@ class JunocloudMeFolder(SimpleCrypter):      __authors__ = [("guidobelix", "guidobelix@hotmail.it")] -    URL_REPLACEMENTS = [(__pattern__, r'http://www.junocloud.me/folders/\g<ID>?per_page=10000')] - -    LINK_PATTERN = r'<a href="(.+?)" target="_blank">.+?</a>' +    HOSTER_NAME = "junocloud.me" diff --git a/module/plugins/crypter/RapidfileshareNetFolder.py b/module/plugins/crypter/RapidfileshareNetFolder.py index 7f7f85cbd..cca52db20 100644 --- a/module/plugins/crypter/RapidfileshareNetFolder.py +++ b/module/plugins/crypter/RapidfileshareNetFolder.py @@ -1,12 +1,12 @@  # -*- coding: utf-8 -*- -from module.plugins.internal.SimpleCrypter import SimpleCrypter +from module.plugins.internal.XFSPCrypter import XFSPCrypter -class RapidfileshareNetFolder(SimpleCrypter): +class RapidfileshareNetFolder(XFSPCrypter):      __name__ = "RapidfileshareNetFolder"      __type__ = "crypter" -    __version__ = "0.01" +    __version__ = "0.02"      __pattern__ = r'http://(?:www\.)?rapidfileshare\.net/users/\w+/\d+/\w+' @@ -15,5 +15,4 @@ class RapidfileshareNetFolder(SimpleCrypter):      __authors__ = [("guidobelix", "guidobelix@hotmail.it")] -    LINK_PATTERN = r'<a href="(.+?)" target="_blank">.+?</a>' -    TITLE_PATTERN = r'<Title>Files of \w+: ([^<]+) folder<' +    HOSTER_NAME = "rapidfileshare.net" diff --git a/module/plugins/crypter/TusfilesNetFolder.py b/module/plugins/crypter/TusfilesNetFolder.py index a6e76adb8..fb0842b63 100644 --- a/module/plugins/crypter/TusfilesNetFolder.py +++ b/module/plugins/crypter/TusfilesNetFolder.py @@ -4,15 +4,15 @@ import math  import re  from urlparse import urljoin -from module.plugins.internal.SimpleCrypter import SimpleCrypter +from module.plugins.internal.XFSPCrypter import XFSPCrypter -class TusfilesNetFolder(SimpleCrypter): +class TusfilesNetFolder(XFSPCrypter):      __name__ = "TusfilesNetFolder"      __type__ = "crypter" -    __version__ = "0.03" +    __version__ = "0.04" -    __pattern__ = r'https?://(?:www\.)?tusfiles\.net/go/(?P<ID>\w+)/?' +    __pattern__ = r'https?://(?:www\.)?tusfiles\.net/go/(?P<ID>\w+)'      __description__ = """Tusfiles.net folder decrypter plugin"""      __license__ = "GPLv3" @@ -20,8 +20,8 @@ class TusfilesNetFolder(SimpleCrypter):                     ("stickell", "l.stickell@yahoo.it")] -    LINK_PATTERN = r'<TD align=left><a href="(.*?)">' -    TITLE_PATTERN = r'<Title>.*?\: (.+) folder</Title>' +    HOSTER_NAME = "tusfiles.net" +      PAGES_PATTERN = r'>\((\d+) \w+\)<'      URL_REPLACEMENTS = [(__pattern__, r'https://www.tusfiles.net/go/\g<ID>/')] @@ -30,6 +30,7 @@ class TusfilesNetFolder(SimpleCrypter):      def loadPage(self, page_n):          return self.load(urljoin(self.pyfile.url, str(page_n)), decode=True) +      def handleMultiPages(self):          pages = re.search(self.PAGES_PATTERN, self.html)          if pages: diff --git a/module/plugins/crypter/XFileSharingProFolder.py b/module/plugins/crypter/XFileSharingProFolder.py new file mode 100644 index 000000000..e6fb2a7a5 --- /dev/null +++ b/module/plugins/crypter/XFileSharingProFolder.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- + +import re + +from module.plugins.internal.XFSPCrypter import XFSPCrypter + + +class XFileSharingProFolder(XFSPCrypter): +    __name__ = "XFileSharingProFolder" +    __type__ = "crypter" +    __version__ = "0.02" + +    __pattern__ = r'^unmatchable$' + +    __description__ = """XFileSharingPro dummy folder decrypter plugin for hook""" +    __license__ = "GPLv3" +    __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] + + +    def init(self): +        self.__pattern__ = self.core.pluginManager.crypterPlugins[self.__name__]['pattern'] +        self.HOSTER_NAME = re.match(self.__pattern__, self.pyfile.url).group(1).lower() + +        account_name = "".join([str.capitalize() for str in self.HOSTER_NAME.split('.')]) +        account = self.core.accountManager.getAccountPlugin(account_name) + +        if account and account.canUse(): +            self.user, data = account.selectAccount() +            self.req = account.getAccountRequest(self.user) +            self.premium = account.isPremium(self.user) + +            self.account = account +        else: +            self.account.HOSTER_NAME = self.HOSTER_NAME diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index f5d40dd62..1782456e1 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -8,15 +8,18 @@ from module.plugins.Hook import Hook  class XFileSharingPro(Hook):      __name__ = "XFileSharingPro"      __type__ = "hook" -    __version__ = "0.15" +    __version__ = "0.17"      __config__ = [("activated", "bool", "Activated", True), -                  ("match", "Always;Always except excluded;Listed only", "Hoster match", "Always except excluded"), -                  ("load_default", "bool", "Include built-in hoster list", True), +                  ("match_hoster", "Always;Always except excluded;Listed only", "Hoster match", "Always except excluded"), +                  ("match_crypter", "Always;Always except excluded;Listed only", "Crypter match", "Always except excluded"), +                  ("load_default", "bool", "Include built-in lists", True),                    ("include_hosters", "str", "Include hosters (comma separated)", ""), -                  ("exclude_hosters", "str", "Exclude hosters (comma separated)", "")] +                  ("exclude_hosters", "str", "Exclude hosters (comma separated)", ""), +                  ("include_crypters", "str", "Include crypters (comma separated)", ""), +                  ("exclude_crypters", "str", "Exclude crypters (comma separated)", "")] -    __description__ = """Load XFileSharingPro based hosters which don't need a own plugin to work fine""" +    __description__ = """Load hosters and crypter, based upon XFileSharingPro, which don't need a own plugin to work fine"""      __license__ = "GPLv3"      __authors__ = [("zoidberg", "zoidberg@mujmail.cz"),                     ("Walter Purcaro", "vuolter@gmail.com")] @@ -25,7 +28,7 @@ class XFileSharingPro(Hook):      event_list = ["pluginConfigChanged"]      HOSTER_LIST = [#WORKING HOSTERS: -                   "eyesfile.co", "eyesfile.com", "fileband.com", "filedwon.com", "hostingbulk.com", "linestorage.com", +                   "eyesfile.ca", "fileband.com", "filedwon.com", "hostingbulk.com", "linestorage.com",                     "ravishare.com", "sharesix.com", "thefile.me", "verzend.be", "xvidstage.com",                     #NOT TESTED:                     "101shared.com", "4upfiles.com", "filemaze.ws", "filenuke.com", "linkzhost.com", "mightyupload.com", @@ -33,6 +36,7 @@ class XFileSharingPro(Hook):                     "vidbull.com", "zalaa.com", "zomgupload.com",                     #NOT WORKING:                     "amonshare.com", "banicrazy.info", "boosterking.com", "host4desi.com", "laoupload.com", "rd-fs.com"] +    CRYPTER_LIST = []      def pluginConfigChanged(self, plugin, name, value): @@ -45,41 +49,48 @@ class XFileSharingPro(Hook):      def loadPattern(self): -        include_hosters = self.getConfigSet('include_hosters') -        exclude_hosters = self.getConfigSet('exclude_hosters') +        regex = {'hoster'  = (r'https?://(?!(?:www\.)?(?:%s))(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:embed-)?\w{12}', +                              r'https?://(?:[^/]+\.)?(%s)/(?:embed-)?\w{12}\W?'), +                 'crypter' = (r'https?://(?!(?:www\.)?(?:%s))(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:user|folder)s?/\w+', +                              r'https?://(?:[^/]+\.)?(%s)/(?:user|folder)s?/\w+')} + +        for type, plugin in (("hoster", "XFileSharingPro"), ("crypter", "XFileSharingProFolder")): +            match = self.getConfig('match_%ss' % type) +            include_set = self.getConfigSet('include_%ss' % type) +            exclude_set = self.getConfigSet('exclude_%ss' % type) + +            if match != "Listed only": +                if match == "Always": +                    match_list = "" +                else: +                    hoster_list = exclude_set - set(('', u'')) +                    match_list = '|'.join(sorted(hoster_list)) +                    self.logDebug("Excluding %d %ss" % (len(hoster_list), type), match_list.replace('|', ', ')) + +                regexp = regex[type][0] % match_list.replace('.', '\.') -        if self.getConfig("match") != "Listed only": -            if self.getConfig("match") == "Always": -                match_list = ""              else: -                hoster_list = exclude_hosters - set(('', u'')) -                match_list = '|'.join(sorted(hoster_list)) -                self.logDebug("Excluding %d hosters" % len(hoster_list), match_list.replace('|', ', ')) - -            regexp = r'https?://(?!(?:www\.)?(?:%s))(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:embed-)?\w{12}' % match_list.replace('.', '\.') +                hoster_list = include_set -        else: -            hoster_list = include_hosters +                if self.getConfig('load_default'): +                    hoster_list |= set(getattr(self, "%s_LIST" % type.upper())) -            if self.getConfig('load_default'): -                hoster_list |= set(self.HOSTER_LIST) +                hoster_list -= exclude_set +                hoster_list -= set(('', u'')) -            hoster_list -= exclude_hosters -            hoster_list -= set(('', u'')) +                if not hoster_list: +                    self.unload() +                    return -            if not hoster_list: -                self.unload() -                return - -            match_list = '|'.join(sorted(hoster_list)) -            self.logDebug("Handling %d hosters" % len(hoster_list), match_list.replace('|', ', ')) +                match_list = '|'.join(sorted(hoster_list)) +                self.logDebug("Handling %d %ss" % (len(hoster_list), type), match_list.replace('|', ', ')) -            regexp = r'https?://(?:[^/]*\.)?(%s)/(?:embed-)?\w{12}' % match_list.replace('.', '\.') +                regexp = regex[type][1] % match_list.replace('.', '\.') -        dict = self.core.pluginManager.hosterPlugins['XFileSharingPro'] -        dict['pattern'] = regexp -        dict['re'] = re.compile(regexp) -        self.logDebug("Pattern loaded") +            dict = self.core.pluginManager.plugins[type][plugin] +            dict['pattern'] = regexp +            dict['re'] = re.compile(regexp) +            self.logDebug("Pattern loaded for %ss" % type)      def getConfigSet(self, option): @@ -89,6 +100,7 @@ class XFileSharingPro(Hook):      def unload(self):          regexp = r'^unmatchable$' -        dict = self.core.pluginManager.hosterPlugins['XFileSharingPro'] -        dict['pattern'] = regexp -        dict['re'] = re.compile(regexp) +        for type, plugin in (("hoster", "XFileSharingPro"), ("crypter", "XFileSharingProFolder")): +            dict = self.core.pluginManager.plugins[type][plugin] +            dict['pattern'] = regexp +            dict['re'] = re.compile(regexp) diff --git a/module/plugins/hoster/FilerNet.py b/module/plugins/hoster/FilerNet.py index c8211b435..7534c669d 100644 --- a/module/plugins/hoster/FilerNet.py +++ b/module/plugins/hoster/FilerNet.py @@ -16,7 +16,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo  class FilerNet(SimpleHoster):      __name__ = "FilerNet"      __type__ = "hoster" -    __version__ = "0.04" +    __version__ = "0.05"      __pattern__ = r'https?://(?:www\.)?filer\.net/get/(\w+)' @@ -27,8 +27,11 @@ class FilerNet(SimpleHoster):      FILE_INFO_PATTERN = r'<h1 class="page-header">Free Download (?P<N>\S+) <small>(?P<S>[\w.]+) (?P<U>[\w^_]+)</small></h1>'      OFFLINE_PATTERN = r'Nicht gefunden' +      LINK_PATTERN = r'href="([^"]+)">Get download</a>' +    RECAPTCHA_KEY = "6LcFctISAAAAAAgaeHgyqhNecGJJRnxV1m_vAz3V" +      def process(self, pyfile):          if self.premium and (not self.FORCE_CHECK_TRAFFIC or self.checkTrafficLeft()): @@ -36,6 +39,7 @@ class FilerNet(SimpleHoster):          else:              self.handleFree() +      def handleFree(self):          self.req.setOption("timeout", 120)          self.html = self.load(self.pyfile.url, decode=not self.TEXT_ENCODING, cookies=self.COOKIES) @@ -68,12 +72,8 @@ class FilerNet(SimpleHoster):          recaptcha = ReCaptcha(self) -        captcha_key = recaptcha.detect_key() -        if captcha_key is None: -            self.parseError("ReCaptcha key not found") -          for _ in xrange(5): -            challenge, response = recaptcha.challenge(captcha_key) +            challenge, response = recaptcha.challenge(self.RECAPTCHA_KEY)              post_data = {'recaptcha_challenge_field': challenge,                           'recaptcha_response_field': response,                           'hash': hash_data} @@ -97,6 +97,7 @@ class FilerNet(SimpleHoster):          self.download(downloadURL, disposition=True) +      def handlePremium(self):          header = self.load(self.pyfile.url, just_header=True)          if 'location' in header:  # Direct Download ON diff --git a/module/plugins/hoster/UploadedTo.py b/module/plugins/hoster/UploadedTo.py index 0affffbb9..73a903902 100644 --- a/module/plugins/hoster/UploadedTo.py +++ b/module/plugins/hoster/UploadedTo.py @@ -94,7 +94,7 @@ def getInfo(urls):  class UploadedTo(Hoster):      __name__ = "UploadedTo"      __type__ = "hoster" -    __version__ = "0.73" +    __version__ = "0.74"      __pattern__ = r'https?://(?:www\.)?(uploaded\.(to|net)|ul\.to)(/file/|/?\?id=|.*?&id=|/)(?P<ID>\w+)' @@ -219,7 +219,7 @@ class UploadedTo(Hoster):                  self.retry()              elif "limit-parallel" in result:                  self.fail("Cannot download in parallel") -            elif self.DL_LIMIT_PATTERN in result:  # limit-dl +            elif "limit-dl" in result or self.DL_LIMIT_PATTERN in result:  # limit-dl                  self.setWait(3 * 60 * 60, True)                  self.wait()                  self.retry() diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py index e670dc5af..fc348c90f 100644 --- a/module/plugins/hoster/XFileSharingPro.py +++ b/module/plugins/hoster/XFileSharingPro.py @@ -8,7 +8,7 @@ from module.plugins.internal.XFSPHoster import XFSPHoster, create_getInfo  class XFileSharingPro(XFSPHoster):      __name__ = "XFileSharingPro"      __type__ = "hoster" -    __version__ = "0.38" +    __version__ = "0.39"      __pattern__ = r'^unmatchable$' @@ -20,12 +20,27 @@ class XFileSharingPro(XFSPHoster):      FILE_URL_REPLACEMENTS = [(r'/embed-(\w{12}).*', r'/\1')]  #: support embedded files +    def init(self): +        self.__pattern__ = self.core.pluginManager.hosterPlugins[self.__name__]['pattern'] +        self.HOSTER_NAME = re.match(self.__pattern__, self.pyfile.url).group(1).lower() + +        account_name = "".join([str.capitalize() for str in self.HOSTER_NAME.split('.')]) +        account = self.core.accountManager.getAccountPlugin(account_name) + +        if account and account.canUse(): +            self.user, data = account.selectAccount() +            self.req = account.getAccountRequest(self.user) +            self.premium = account.isPremium(self.user) + +            self.account = account +        else: +            self.account.HOSTER_NAME = self.HOSTER_NAME + +      def setup(self):          self.chunkLimit = 1 +        self.resumeDownload = self.premium          self.multiDL = True -        self.__pattern__ = self.core.pluginManager.hosterPlugins[self.__name__]['pattern'] -        self.HOSTER_NAME = re.match(self.__pattern__, self.pyfile.url).group(1).lower() -  getInfo = create_getInfo(XFileSharingPro) diff --git a/module/plugins/hoster/ZippyshareCom.py b/module/plugins/hoster/ZippyshareCom.py index 29a23353f..6144132f9 100644 --- a/module/plugins/hoster/ZippyshareCom.py +++ b/module/plugins/hoster/ZippyshareCom.py @@ -11,7 +11,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo  class ZippyshareCom(SimpleHoster):      __name__ = "ZippyshareCom"      __type__ = "hoster" -    __version__ = "0.51" +    __version__ = "0.52"      __pattern__ = r'(?P<HOST>http://www\d{0,2}\.zippyshare\.com)/v(?:/|iew\.jsp.*key=)(?P<KEY>\d+)' @@ -20,7 +20,7 @@ class ZippyshareCom(SimpleHoster):      __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] -    FILE_NAME_PATTERN = r'>Name:.+?">(?P<N>.+?)<' +    FILE_NAME_PATTERN = r'var exam1x = .+ \+ "/(?P<N>.+)";'      FILE_SIZE_PATTERN = r'>Size:.+?">(?P<S>[\d.,]+) (?P<U>[\w^_]+)'      OFFLINE_PATTERN = r'>File does not exist on this server<' diff --git a/module/plugins/internal/SimpleCrypter.py b/module/plugins/internal/SimpleCrypter.py index 8139d661d..3c1dc3244 100644 --- a/module/plugins/internal/SimpleCrypter.py +++ b/module/plugins/internal/SimpleCrypter.py @@ -10,7 +10,7 @@ from module.utils import fixup, html_unescape  class SimpleCrypter(Crypter):      __name__ = "SimpleCrypter"      __type__ = "crypter" -    __version__ = "0.13" +    __version__ = "0.15"      __pattern__ = None @@ -51,6 +51,8 @@ class SimpleCrypter(Crypter):            return the html of the page number page_n      """ +    LINK_PATTERN = None +      TITLE_REPLACEMENTS = [("&#?\w+;", fixup)]      URL_REPLACEMENTS = [] @@ -61,6 +63,18 @@ class SimpleCrypter(Crypter):      LOGIN_PREMIUM = False +    def init(self): +        account_name = (self.__name__ + ".py").replace("Folder.py", "").replace(".py", "") +        account = self.core.accountManager.getAccountPlugin(account_name) + +        if account and account.canUse(): +            self.user, data = account.selectAccount() +            self.req = account.getAccountRequest(self.user) +            self.premium = account.isPremium(self.user) + +            self.account = account + +      def prepare(self):          if self.LOGIN_ACCOUNT and not self.account:              self.fail('Required account not found!') diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py index 895584af6..c2bc4909e 100644 --- a/module/plugins/internal/SimpleHoster.py +++ b/module/plugins/internal/SimpleHoster.py @@ -166,18 +166,18 @@ class SimpleHoster(Hoster):      """      Following patterns should be defined by each hoster: -      FILE_INFO_PATTERN: Name and Size of the file +      FILE_INFO_PATTERN: (optional) Name and Size of the file          example: FILE_INFO_PATTERN = r'(?P<N>file_name) (?P<S>file_size) (?P<U>size_unit)'        or -        FILE_NAME_PATTERN: Name that will be set for the file +        FILE_NAME_PATTERN: (optional) Name that will be set for the file            example: FILE_NAME_PATTERN = r'(?P<N>file_name)' -        FILE_SIZE_PATTERN: Size that will be checked for the file +        FILE_SIZE_PATTERN: (optional) Size that will be checked for the file            example: FILE_SIZE_PATTERN = r'(?P<S>file_size) (?P<U>size_unit)' -      OFFLINE_PATTERN: Checks if the file is yet available online +      OFFLINE_PATTERN: (optional) Checks if the file is yet available online          example: OFFLINE_PATTERN = r'File (deleted|not found)' -      TEMP_OFFLINE_PATTERN: Checks if the file is temporarily offline +      TEMP_OFFLINE_PATTERN: (optional) Checks if the file is temporarily offline          example: TEMP_OFFLINE_PATTERN = r'Server (maintenance|maintainance)'        PREMIUM_ONLY_PATTERN: (optional) Checks if the file can be downloaded only with a premium account diff --git a/module/plugins/internal/XFSPAccount.py b/module/plugins/internal/XFSPAccount.py index f75422ca1..713bf827d 100644 --- a/module/plugins/internal/XFSPAccount.py +++ b/module/plugins/internal/XFSPAccount.py @@ -13,7 +13,7 @@ from module.utils import parseFileSize  class XFSPAccount(Account):      __name__ = "XFSPAccount"      __type__ = "account" -    __version__ = "0.12" +    __version__ = "0.13"      __description__ = """XFileSharingPro account plugin"""      __license__ = "GPLv3" @@ -21,9 +21,19 @@ class XFSPAccount(Account):                     ("Walter Purcaro", "vuolter@gmail.com")] -    HOSTER_URL = None +    """ +    Following patterns should be defined by each hoster: -    COOKIES = None  #: or list of tuples [(domain, name, value)] +      HOSTER_URL: (optional) +        example: HOSTER_URL = r'linestorage.com' + +      PREMIUM_PATTERN: (optional) Checks if the account is premium +        example: PREMIUM_PATTERN = r'>Renew premium<' +    """ + +    HOSTER_NAME = None + +    COOKIES = [(HOSTER_NAME, "lang", "english")]  #: or list of tuples [(domain, name, value)]      VALID_UNTIL_PATTERN = r'>Premium.[Aa]ccount expire:.*?<b>(.+?)</b>' @@ -32,7 +42,10 @@ class XFSPAccount(Account):      LOGIN_FAIL_PATTERN = r'>(Incorrect Login or Password|Error<)' -    # PREMIUM_PATTERN = r'>Renew premium<' + +    def init(self): +        if not hasattr(self, "HOSTER_URL"): +            self.HOSTER_URL = "http://%s/" % self.HOSTER_NAME      def loadAccountInfo(self, user, req): diff --git a/module/plugins/internal/XFSPCrypter.py b/module/plugins/internal/XFSPCrypter.py new file mode 100644 index 000000000..372657d2d --- /dev/null +++ b/module/plugins/internal/XFSPCrypter.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- + +from module.plugins.internal.SimpleCrypter import SimpleCrypter + + +class XFSPCrypter(SimpleCrypter): +    __name__ = "XFSPCrypter" +    __type__ = "crypter" +    __version__ = "0.02" + +    __pattern__ = None + +    __description__ = """XFileSharingPro decrypter plugin""" +    __license__ = "GPLv3" +    __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] + + +    HOSTER_NAME = None + +    URL_REPLACEMENTS = [(r'[?/&]+$', r''), (r'(.+/[^?]*)$', r'\1?'), (r'$', r'&per_page=10000')] + +    COOKIES = [(HOSTER_NAME, "lang", "english")] + +    LINK_PATTERN = r'<(?:td|TD) [^>]*>\s*<a href="(.+?)"[^>]*>.+?(?:</a>)?\s*</(?:td|TD)>' +    TITLE_PATTERN = r'<[tT]itle>.*?\: (.+) folder</[tT]itle>' + +    OFFLINE_PATTERN = r'>\s*\w+ (Not Found|file (was|has been) removed)' +    TEMP_OFFLINE_PATTERN = r'>\s*\w+ server (is in )?(maintenance|maintainance)' diff --git a/module/plugins/internal/XFSPHoster.py b/module/plugins/internal/XFSPHoster.py index f1a250f85..abf71b033 100644 --- a/module/plugins/internal/XFSPHoster.py +++ b/module/plugins/internal/XFSPHoster.py @@ -330,7 +330,7 @@ class XFSPHoster(SimpleHoster):              captcha_key = recaptcha.detect_key()          if captcha_key: -            self.logDebug("RECAPTCHA KEY: %s" % captcha_key) +            self.logDebug("ReCaptcha key: %s" % captcha_key)              inputs['recaptcha_challenge_field'], inputs['recaptcha_response_field'] = recaptcha.challenge(captcha_key)              return 3 @@ -341,6 +341,7 @@ class XFSPHoster(SimpleHoster):              captcha_key = solvemedia.detect_key()          if captcha_key: +            self.logDebug("SolveMedia key: %s" % captcha_key)              inputs['adcopy_challenge'], inputs['adcopy_response'] = solvemedia.challenge(captcha_key)              return 4 | 
