From 48cfb042a9b75b7928d39ee2fd1190fd39e0db4b Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 4 Oct 2014 15:56:53 +0200 Subject: [OboomCom] Fix account login --- module/plugins/Account.py | 4 +++- module/plugins/accounts/OboomCom.py | 47 ++++++++++++++++++++++--------------- module/plugins/hoster/OboomCom.py | 6 ++--- 3 files changed, 34 insertions(+), 23 deletions(-) diff --git a/module/plugins/Account.py b/module/plugins/Account.py index 15e75b965..291ebf1f5 100644 --- a/module/plugins/Account.py +++ b/module/plugins/Account.py @@ -147,8 +147,10 @@ class Account(Base): raise Exception("Wrong return format") except Exception, e: infos = {"error": str(e)} + print_exc() - if req: req.close() + if req: + req.close() self.logDebug("Account Info: %s" % infos) diff --git a/module/plugins/accounts/OboomCom.py b/module/plugins/accounts/OboomCom.py index a37759f9a..84e0791e4 100644 --- a/module/plugins/accounts/OboomCom.py +++ b/module/plugins/accounts/OboomCom.py @@ -2,7 +2,7 @@ import time -from module.lib.beaker.crypto.pbkdf2 import PBKDF2 +from beaker.crypto.pbkdf2 import PBKDF2 from module.common.json_layer import json_loads from module.plugins.Account import Account @@ -11,7 +11,7 @@ from module.plugins.Account import Account class OboomCom(Account): __name__ = "OboomCom" __type__ = "account" - __version__ = "0.1" + __version__ = "0.2" __description__ = """Oboom.com account plugin""" __author_name__ = "stanley" @@ -22,32 +22,41 @@ class OboomCom(Account): passwd = self.getAccountData(user)['password'] salt = passwd[::-1] pbkdf2 = PBKDF2(passwd, salt, 1000).hexread(16) - result = json_loads(req.load("https://www.oboom.com/1.0/login", get={"auth": user, "pass": pbkdf2})) + result = json_loads(req.load("https://www.oboom.com/1/login", get={"auth": user, "pass": pbkdf2})) if not result[0] == 200: self.logWarning("Failed to log in: %s" % result[1]) self.wrongPassword() return result[1] + def loadAccountInfo(self, name, req): accountData = self.loadAccountData(name, req) + userData = accountData['user'] - if "premium_unix" in userData: - validUntilUtc = int(userData['premium_unix']) - if validUntilUtc > int(time.time()): - premium = True - validUntil = validUntilUtc - traffic = userData['traffic'] - trafficLeft = traffic['current'] - maxTraffic = traffic['max'] - session = accountData['session'] - return {"premium": premium, - "validuntil": validUntil, - "trafficleft": trafficLeft / 1024, - "maxtraffic": maxTraffic / 1024, - "session": session - } - return {"premium": False, "validuntil": -1} + if userData['premium'] == "null": + premium = False + else: + premium = True + + if userData['premium_unix'] == "null": + validUntil = -1 + else: + validUntil = int(userData['premium_unix']) + + traffic = userData['traffic'] + + trafficLeft = traffic['current'] + maxTraffic = traffic['max'] + + session = accountData['session'] + + return {'premium': premium, + 'validuntil': validUntil, + 'trafficleft': trafficLeft / 1024, + 'maxtraffic': maxTraffic / 1024, + 'session': session} + def login(self, user, data, req): self.loadAccountData(user, req) diff --git a/module/plugins/hoster/OboomCom.py b/module/plugins/hoster/OboomCom.py index 378e4c219..23084bafe 100644 --- a/module/plugins/hoster/OboomCom.py +++ b/module/plugins/hoster/OboomCom.py @@ -13,9 +13,9 @@ from module.plugins.internal.CaptchaService import ReCaptcha class OboomCom(Hoster): __name__ = "OboomCom" __type__ = "hoster" - __version__ = "0.1" + __version__ = "0.2" - __pattern__ = r'https?://(?:www\.)?oboom\.com/(#(id=|/)?)?(?P[A-Z0-9]{8})' + __pattern__ = r'https?://(?:www\.)?oboom\.com/(#(id=|/)?)?(?P\w{8})' __description__ = """oboom.com hoster plugin""" __author_name__ = "stanley" @@ -27,7 +27,7 @@ class OboomCom(Hoster): def setup(self): self.chunkLimit = 1 - self.multiDL = self.premium + self.multiDL = self.resumeDownload = self.premium def process(self, pyfile): -- cgit v1.2.3 From e460158ca521afe0540c9c53b91806b31f307217 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 4 Oct 2014 22:46:13 +0200 Subject: Fix broken plugins after SH_COOKIES -> COOKIES --- module/plugins/hoster/DepositfilesCom.py | 2 +- module/plugins/hoster/DropboxCom.py | 4 ++-- module/plugins/hoster/FilerNet.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/module/plugins/hoster/DepositfilesCom.py b/module/plugins/hoster/DepositfilesCom.py index 459096f96..765a3ef50 100644 --- a/module/plugins/hoster/DepositfilesCom.py +++ b/module/plugins/hoster/DepositfilesCom.py @@ -11,7 +11,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class DepositfilesCom(SimpleHoster): __name__ = "DepositfilesCom" __type__ = "hoster" - __version__ = "0.48" + __version__ = "0.49" __pattern__ = r'https?://(?:www\.)?(depositfiles\.com|dfiles\.(eu|ru))(/\w{1,3})?/files/(?P\w+)' diff --git a/module/plugins/hoster/DropboxCom.py b/module/plugins/hoster/DropboxCom.py index ab63fc801..07e251946 100644 --- a/module/plugins/hoster/DropboxCom.py +++ b/module/plugins/hoster/DropboxCom.py @@ -8,7 +8,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class DropboxCom(SimpleHoster): __name__ = "DropboxCom" __type__ = "hoster" - __version__ = "0.01" + __version__ = "0.02" __pattern__ = r'https?://(?:www\.)?dropbox\.com/.+' @@ -22,7 +22,7 @@ class DropboxCom(SimpleHoster): OFFLINE_PATTERN = r'Dropbox - (404|Shared link error)<' - SH_COOKIES = [(".dropbox.com", "lang", "en")] + COOKIES = [(".dropbox.com", "lang", "en")] def setup(self): diff --git a/module/plugins/hoster/FilerNet.py b/module/plugins/hoster/FilerNet.py index 3082c790b..076b609dd 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.03" + __version__ = "0.04" __pattern__ = r'https?://(?:www\.)?filer\.net/get/(\w+)' -- cgit v1.2.3 From 8ddad37bf72ad371a0dbb571fa63ed73e2724cd3 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Sat, 4 Oct 2014 23:29:53 +0200 Subject: [EgoFilesCom] Mark dead --- module/plugins/hoster/EgoFilesCom.py | 84 ++---------------------------------- 1 file changed, 4 insertions(+), 80 deletions(-) diff --git a/module/plugins/hoster/EgoFilesCom.py b/module/plugins/hoster/EgoFilesCom.py index 49667a722..2da71c46b 100644 --- a/module/plugins/hoster/EgoFilesCom.py +++ b/module/plugins/hoster/EgoFilesCom.py @@ -1,94 +1,18 @@ # -*- coding: utf-8 -*- -# -# Test links: -# http://egofiles.com/mOZfMI1WLZ6HBkGG/random.bin -import re +from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo -from module.plugins.internal.CaptchaService import ReCaptcha -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo - -class EgoFilesCom(SimpleHoster): +class EgoFilesCom(DeadHoster): __name__ = "EgoFilesCom" __type__ = "hoster" - __version__ = "0.15" + __version__ = "0.16" - __pattern__ = r'https?://(?:www\.)?egofiles.com/(\w+)' + __pattern__ = r'https?://(?:www\.)?egofiles\.com/\w+' __description__ = """Egofiles.com hoster plugin""" __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" - FILE_INFO_PATTERN = r'<div class="down-file">\s+(?P<N>[^\t]+)\s+<div class="file-properties">\s+(File size|Rozmiar): (?P<S>[\w.]+) (?P<U>\w+) \|' - OFFLINE_PATTERN = r'(File size|Rozmiar): 0 KB' - WAIT_TIME_PATTERN = r'For next free download you have to wait <strong>((?P<m>\d*)m)? ?((?P<s>\d+)s)?</strong>' - LINK_PATTERN = r'<a href="(?P<link>[^"]+)">Download ></a>' - - - def setup(self): - # Set English language - self.load("https://egofiles.com/ajax/lang.php?lang=en", just_header=True) - - def process(self, pyfile): - if self.premium and (not self.FORCE_CHECK_TRAFFIC or self.checkTrafficLeft()): - self.handlePremium() - else: - self.handleFree() - - def handleFree(self): - self.html = self.load(self.pyfile.url, decode=True) - self.getFileInfo() - - # Wait time between free downloads - if 'For next free download you have to wait' in self.html: - m = re.search(self.WAIT_TIME_PATTERN, self.html).groupdict('0') - waittime = int(m['m']) * 60 + int(m['s']) - self.wait(waittime, True) - - downloadURL = r'' - - 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) - post_data = {'recaptcha_challenge_field': challenge, - 'recaptcha_response_field': response} - self.html = self.load(self.pyfile.url, post=post_data, decode=True) - m = re.search(self.LINK_PATTERN, self.html) - if m is None: - self.logInfo("Wrong captcha") - self.invalidCaptcha() - elif hasattr(m, 'group'): - downloadURL = m.group('link') - self.correctCaptcha() - break - else: - self.fail('Unknown error - Plugin may be out of date') - - if not downloadURL: - self.fail("No Download url retrieved/all captcha attempts failed") - - self.download(downloadURL, disposition=True) - - def handlePremium(self): - header = self.load(self.pyfile.url, just_header=True) - if 'location' in header: - self.logDebug("DIRECT LINK from header: " + header['location']) - self.download(header['location']) - else: - self.html = self.load(self.pyfile.url, decode=True) - self.getFileInfo() - m = re.search(r'<a href="(?P<link>[^"]+)">Download ></a>', self.html) - if m is None: - self.parseError('Unable to detect direct download url') - else: - self.logDebug("DIRECT URL from html: " + m.group('link')) - self.download(m.group('link'), disposition=True) - getInfo = create_getInfo(EgoFilesCom) -- cgit v1.2.3 From 7e74afa16d11141e3c13fe05e37ee83bbe02421a Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Sat, 4 Oct 2014 23:34:12 +0200 Subject: [HotfileFolderCom] Mark dead --- module/plugins/crypter/HotfileFolderCom.py | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/module/plugins/crypter/HotfileFolderCom.py b/module/plugins/crypter/HotfileFolderCom.py index 3efd8fc87..733437ec2 100644 --- a/module/plugins/crypter/HotfileFolderCom.py +++ b/module/plugins/crypter/HotfileFolderCom.py @@ -1,30 +1,15 @@ # -*- coding: utf-8 -*- -import re +from module.plugins.internal.DeadCrypter import DeadCrypter -from module.plugins.Crypter import Crypter - -class HotfileFolderCom(Crypter): +class HotfileFolderCom(DeadCrypter): __name__ = "HotfileFolderCom" __type__ = "crypter" - __version__ = "0.1" + __version__ = "0.2" - __pattern__ = r'http://(?:www\.)?hotfile.com/list/\w+/\w+' + __pattern__ = r'https)://(?:www\.)?hotfile\.com/list/\w+/\w+' __description__ = """Hotfile.com folder decrypter plugin""" __author_name__ = "RaNaN" __author_mail__ = "RaNaN@pyload.org" - - - def decrypt(self, pyfile): - html = self.load(pyfile.url) - - name = re.findall( - r'<img src="/i/folder.gif" width="23" height="14" style="margin-bottom: -2px;" />([^<]+)', html, - re.MULTILINE)[0].replace("/", "") - new_links = re.findall(r'href="(http://(www.)?hotfile\.com/dl/\d+/[0-9a-zA-Z]+[^"]+)', html) - - new_links = [x[0] for x in new_links] - - self.packages = [(name, new_links, name)] -- cgit v1.2.3 From a4a2330adc70f9d0b3d2bc2e10386e2a5d8749ea Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Sat, 4 Oct 2014 23:35:49 +0200 Subject: Spare __pattern__ cosmetics --- module/plugins/crypter/LixIn.py | 4 ++-- module/plugins/hoster/HotfileCom.py | 2 +- module/plugins/hoster/SpeedyshareCom.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/module/plugins/crypter/LixIn.py b/module/plugins/crypter/LixIn.py index beba5ed04..dec2e02d3 100644 --- a/module/plugins/crypter/LixIn.py +++ b/module/plugins/crypter/LixIn.py @@ -10,7 +10,7 @@ class LixIn(Crypter): __type__ = "crypter" __version__ = "0.22" - __pattern__ = r'http://(www.)?lix.in/(?P<id>.*)' + __pattern__ = r'http://(?:www\.)?lix\.in/(?P<ID>.+)' __description__ = """Lix.in decrypter plugin""" __author_name__ = "spoob" @@ -28,7 +28,7 @@ class LixIn(Crypter): if m is None: self.fail("couldn't identify file id") - id = m.group("id") + id = m.group("ID") self.logDebug("File id is %s" % id) self.html = self.req.load(url, decode=True) diff --git a/module/plugins/hoster/HotfileCom.py b/module/plugins/hoster/HotfileCom.py index aac312a6b..d336c4790 100644 --- a/module/plugins/hoster/HotfileCom.py +++ b/module/plugins/hoster/HotfileCom.py @@ -8,7 +8,7 @@ class HotfileCom(DeadHoster): __type__ = "hoster" __version__ = "0.37" - __pattern__ = r'https?://(www.)?hotfile\.com/dl/\d+/[0-9a-zA-Z]+/' + __pattern__ = r'https?://(?:www\.)?hotfile\.com/dl/\d+/\w+' __description__ = """Hotfile.com hoster plugin""" __author_name__ = ("sitacuisses", "spoob", "mkaay", "JoKoT3") diff --git a/module/plugins/hoster/SpeedyshareCom.py b/module/plugins/hoster/SpeedyshareCom.py index 49d3a4dab..78b3b28c6 100644 --- a/module/plugins/hoster/SpeedyshareCom.py +++ b/module/plugins/hoster/SpeedyshareCom.py @@ -15,7 +15,7 @@ class SpeedyshareCom(SimpleHoster): __type__ = "hoster" __version__ = "0.02" - __pattern__ = r"https?://(www\.)?(speedyshare\.com|speedy\.sh)/\w+" + __pattern__ = r"https?://(?:www\.)?(speedyshare\.com|speedy\.sh)/\w+" __description__ = """Speedyshare.com hoster plugin""" __author_name__ = "zapp-brannigan" -- cgit v1.2.3 From a9117257f71984d553811a605150acb5d1b499ce Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Sun, 5 Oct 2014 02:27:07 +0200 Subject: Better import lib header --- module/plugins/container/CCF.py | 2 +- module/plugins/crypter/DuckCryptInfo.py | 9 ++------- module/plugins/crypter/HoerbuchIn.py | 4 ++-- module/plugins/crypter/SafelinkingNet.py | 2 +- module/plugins/hooks/Ev0InFetcher.py | 4 ++-- module/plugins/hoster/LuckyShareNet.py | 2 +- 6 files changed, 9 insertions(+), 14 deletions(-) diff --git a/module/plugins/container/CCF.py b/module/plugins/container/CCF.py index ee92beb9a..e6e8c4bb5 100644 --- a/module/plugins/container/CCF.py +++ b/module/plugins/container/CCF.py @@ -6,7 +6,7 @@ from os import makedirs from os.path import exists from urllib2 import build_opener -from module.lib.MultipartPostHandler import MultipartPostHandler +from MultipartPostHandler import MultipartPostHandler from module.plugins.Container import Container from module.utils import save_join diff --git a/module/plugins/crypter/DuckCryptInfo.py b/module/plugins/crypter/DuckCryptInfo.py index 26b06c1c7..b278f2248 100644 --- a/module/plugins/crypter/DuckCryptInfo.py +++ b/module/plugins/crypter/DuckCryptInfo.py @@ -2,7 +2,7 @@ import re -from module.lib.BeautifulSoup import BeautifulSoup +from BeautifulSoup import BeautifulSoup from module.plugins.Crypter import Crypter @@ -23,12 +23,7 @@ class DuckCryptInfo(Crypter): def decrypt(self, pyfile): url = pyfile.url - # seems we don't need to wait - #src = self.req.load(str(url)) - #m = re.search(self.TIMER_PATTERN, src) - #if m: - # self.logDebug("Sleeping for" % m.group(1)) - # self.setWait(int(m.group(1)) ,False) + m = re.match(self.__pattern__, url) if m is None: self.fail('Weird error in link') diff --git a/module/plugins/crypter/HoerbuchIn.py b/module/plugins/crypter/HoerbuchIn.py index 924ce5d3a..a283ff823 100644 --- a/module/plugins/crypter/HoerbuchIn.py +++ b/module/plugins/crypter/HoerbuchIn.py @@ -2,7 +2,7 @@ import re -from module.lib.BeautifulSoup import BeautifulSoup, BeautifulStoneSoup +from BeautifulSoup import BeautifulSoup, BeautifulStoneSoup from module.plugins.Crypter import Crypter @@ -45,7 +45,7 @@ class HoerbuchIn(Crypter): url = m.group(0) self.pyfile.url = url - src = self.req.load(url, post={"viewed": "adpg"}) + src = self.load(url, post={"viewed": "adpg"}) links = [] pattern = re.compile("http://www\.hoerbuch\.in/protection/(\w+)/(.*?)\"") diff --git a/module/plugins/crypter/SafelinkingNet.py b/module/plugins/crypter/SafelinkingNet.py index e0c165705..d548bdf89 100644 --- a/module/plugins/crypter/SafelinkingNet.py +++ b/module/plugins/crypter/SafelinkingNet.py @@ -4,7 +4,7 @@ import re from pycurl import FOLLOWLOCATION -from module.lib.BeautifulSoup import BeautifulSoup +from BeautifulSoup import BeautifulSoup from module.common.json_layer import json_loads from module.plugins.Crypter import Crypter diff --git a/module/plugins/hooks/Ev0InFetcher.py b/module/plugins/hooks/Ev0InFetcher.py index 881cb36ef..35a5c207c 100644 --- a/module/plugins/hooks/Ev0InFetcher.py +++ b/module/plugins/hooks/Ev0InFetcher.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- -from time import mktime, time +import feedparser -from module.lib import feedparser +from time import mktime, time from module.plugins.Hook import Hook diff --git a/module/plugins/hoster/LuckyShareNet.py b/module/plugins/hoster/LuckyShareNet.py index 4780c7108..11e27d357 100644 --- a/module/plugins/hoster/LuckyShareNet.py +++ b/module/plugins/hoster/LuckyShareNet.py @@ -2,7 +2,7 @@ import re -from module.lib.bottle import json_loads +from bottle import json_loads from module.plugins.internal.CaptchaService import ReCaptcha from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo -- cgit v1.2.3 From bcd90824766f98acbd8f59365829057560bc3353 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Sun, 5 Oct 2014 01:49:51 +0200 Subject: Remove some dead accounts --- module/plugins/accounts/CyberlockerCh.py | 35 --------------- module/plugins/accounts/EgoFilesCom.py | 44 ------------------- module/plugins/accounts/HotfileCom.py | 74 -------------------------------- 3 files changed, 153 deletions(-) delete mode 100644 module/plugins/accounts/CyberlockerCh.py delete mode 100644 module/plugins/accounts/EgoFilesCom.py delete mode 100644 module/plugins/accounts/HotfileCom.py diff --git a/module/plugins/accounts/CyberlockerCh.py b/module/plugins/accounts/CyberlockerCh.py deleted file mode 100644 index 729975fb0..000000000 --- a/module/plugins/accounts/CyberlockerCh.py +++ /dev/null @@ -1,35 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.internal.XFSPAccount import XFSPAccount -from module.plugins.internal.SimpleHoster import parseHtmlForm - - -class CyberlockerCh(XFSPAccount): - __name__ = "CyberlockerCh" - __type__ = "account" - __version__ = "0.01" - - __description__ = """Cyberlocker.ch account plugin""" - __author_name__ = "stickell" - __author_mail__ = "l.stickell@yahoo.it" - - MAIN_PAGE = "http://cyberlocker.ch/" - - - def login(self, user, data, req): - html = req.load(self.MAIN_PAGE + 'login.html', decode=True) - - action, inputs = parseHtmlForm('name="FL"', html) - if not inputs: - inputs = {"op": "login", - "redirect": self.MAIN_PAGE} - - inputs.update({"login": user, - "password": data['password']}) - - # Without this a 403 Forbidden is returned - req.http.lastURL = self.MAIN_PAGE + 'login.html' - html = req.load(self.MAIN_PAGE, post=inputs, decode=True) - - if 'Incorrect Login or Password' in html or '>Error<' in html: - self.wrongPassword() diff --git a/module/plugins/accounts/EgoFilesCom.py b/module/plugins/accounts/EgoFilesCom.py deleted file mode 100644 index fc263e776..000000000 --- a/module/plugins/accounts/EgoFilesCom.py +++ /dev/null @@ -1,44 +0,0 @@ -# -*- coding: utf-8 -*- - -import re -import time - -from module.plugins.Account import Account -from module.utils import parseFileSize - - -class EgoFilesCom(Account): - __name__ = "EgoFilesCom" - __type__ = "account" - __version__ = "0.2" - - __description__ = """Egofiles.com account plugin""" - __author_name__ = "stickell" - __author_mail__ = "l.stickell@yahoo.it" - - PREMIUM_ACCOUNT_PATTERN = '<br/>\s*Premium: (?P<P>[^/]*) / Traffic left: (?P<T>[\d.]*) (?P<U>\w*)\s*\\n\s*<br/>' - - - def loadAccountInfo(self, user, req): - html = req.load("http://egofiles.com") - if 'You are logged as a Free User' in html: - return {"premium": False, "validuntil": None, "trafficleft": None} - - m = re.search(self.PREMIUM_ACCOUNT_PATTERN, html) - if m: - validuntil = int(time.mktime(time.strptime(m.group('P'), "%Y-%m-%d %H:%M:%S"))) - trafficleft = parseFileSize(m.group('T'), m.group('U')) / 1024 - return {"premium": True, "validuntil": validuntil, "trafficleft": trafficleft} - else: - self.logError("Unable to retrieve account information - Plugin may be out of date") - - def login(self, user, data, req): - # Set English language - req.load("https://egofiles.com/ajax/lang.php?lang=en", just_header=True) - - html = req.load("http://egofiles.com/ajax/register.php", - post={"log": 1, - "loginV": user, - "passV": data['password']}) - if 'Login successful' not in html: - self.wrongPassword() diff --git a/module/plugins/accounts/HotfileCom.py b/module/plugins/accounts/HotfileCom.py deleted file mode 100644 index cffbbab8f..000000000 --- a/module/plugins/accounts/HotfileCom.py +++ /dev/null @@ -1,74 +0,0 @@ -# -*- coding: utf-8 -*- - -from time import strptime, mktime -import hashlib - -from module.plugins.Account import Account - - -class HotfileCom(Account): - __name__ = "HotfileCom" - __type__ = "account" - __version__ = "0.2" - - __description__ = """Hotfile.com account plugin""" - __author_name__ = ("mkaay", "JoKoT3") - __author_mail__ = ("mkaay@mkaay.de", "jokot3@gmail.com") - - - def loadAccountInfo(self, user, req): - resp = self.apiCall("getuserinfo", user=user) - if resp.startswith("."): - self.core.debug("HotfileCom API Error: %s" % resp) - raise Exception - info = {} - for p in resp.split("&"): - key, value = p.split("=") - info[key] = value - - if info['is_premium'] == '1': - info['premium_until'] = info['premium_until'].replace("T", " ") - zone = info['premium_until'][19:] - info['premium_until'] = info['premium_until'][:19] - zone = int(zone[:3]) - - validuntil = int(mktime(strptime(info['premium_until'], "%Y-%m-%d %H:%M:%S"))) + (zone * 60 * 60) - tmp = {"validuntil": validuntil, "trafficleft": -1, "premium": True} - - elif info['is_premium'] == '0': - tmp = {"premium": False} - - return tmp - - def apiCall(self, method, post={}, user=None): - if user: - data = self.getAccountData(user) - else: - user, data = self.selectAccount() - - req = self.getAccountRequest(user) - - digest = req.load("http://api.hotfile.com/", post={"action": "getdigest"}) - h = hashlib.md5() - h.update(data['password']) - hp = h.hexdigest() - h = hashlib.md5() - h.update(hp) - h.update(digest) - pwhash = h.hexdigest() - - post.update({"action": method}) - post.update({"username": user, "passwordmd5dig": pwhash, "digest": digest}) - resp = req.load("http://api.hotfile.com/", post=post) - req.close() - return resp - - def login(self, user, data, req): - cj = self.getAccountCookies(user) - cj.setCookie("hotfile.com", "lang", "en") - req.load("http://hotfile.com/", cookies=True) - page = req.load("http://hotfile.com/login.php", post={"returnto": "/", "user": user, "pass": data['password']}, - cookies=True) - - if "Bad username/password" in page: - self.wrongPassword() -- cgit v1.2.3 From 40c01be326e336cd582db935cf53bc06e8f17b3c Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Sun, 5 Oct 2014 01:51:08 +0200 Subject: [LinkSaveIn] Now SimpleCrypter based --- module/plugins/crypter/LinkSaveIn.py | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/module/plugins/crypter/LinkSaveIn.py b/module/plugins/crypter/LinkSaveIn.py index e80686c02..8b2b02ea6 100644 --- a/module/plugins/crypter/LinkSaveIn.py +++ b/module/plugins/crypter/LinkSaveIn.py @@ -8,14 +8,15 @@ import binascii import re from Crypto.Cipher import AES -from module.plugins.Crypter import Crypter + +from module.plugins.internal.SimpleCrypter import SimpleCrypter from module.unescape import unescape -class LinkSaveIn(Crypter): +class LinkSaveIn(SimpleCrypter): __name__ = "LinkSaveIn" __type__ = "crypter" - __version__ = "2.01" + __version__ = "2.02" __pattern__ = r'http://(?:www\.)?linksave.in/(?P<id>\w+)$' @@ -23,10 +24,12 @@ class LinkSaveIn(Crypter): __author_name__ = "fragonib" __author_mail__ = "fragonib[AT]yahoo[DOT]es" + + COOKIES = [(".linksave.in", "Linksave_Language", "english")] + # Constants _JK_KEY_ = "jk" _CRYPTED_KEY_ = "crypted" - HOSTER_NAME = "linksave.in" def setup(self): @@ -36,11 +39,11 @@ class LinkSaveIn(Crypter): self.package = None self.preferred_sources = ["cnl2", "rsdf", "ccf", "dlc", "web"] + def decrypt(self, pyfile): # Init self.package = pyfile.package() self.fileid = re.match(self.__pattern__, pyfile.url).group('id') - self.req.cj.setCookie(self.HOSTER_NAME, "Linksave_Language", "english") # Request package self.html = self.load(pyfile.url) @@ -74,41 +77,48 @@ class LinkSaveIn(Crypter): else: self.fail('Could not extract any links') + def isOnline(self): if "<big>Error 404 - Folder not found!</big>" in self.html: self.logDebug("File not found") return False return True + def isPasswordProtected(self): if re.search(r'''<input.*?type="password"''', self.html): self.logDebug("Links are password protected") return True + def isCaptchaProtected(self): if "<b>Captcha:</b>" in self.html: self.logDebug("Links are captcha protected") return True return False + def unlockPasswordProtection(self): password = self.getPassword() self.logDebug("Submitting password [%s] for protected links" % password) post = {"id": self.fileid, "besucherpasswort": password, 'login': 'submit'} self.html = self.load(self.pyfile.url, post=post) + def unlockCaptchaProtection(self): captcha_hash = re.search(r'name="hash" value="([^"]+)', self.html).group(1) captcha_url = re.search(r'src=".(/captcha/cap.php\?hsh=[^"]+)', self.html).group(1) captcha_code = self.decryptCaptcha("http://linksave.in" + captcha_url, forceUser=True) self.html = self.load(self.pyfile.url, post={"id": self.fileid, "hash": captcha_hash, "code": captcha_code}) + def getPackageInfo(self): name = self.pyfile.package().name folder = self.pyfile.package().folder self.logDebug("Defaulting to pyfile name [%s] and folder [%s] for package" % (name, folder)) return name, folder + def handleErrors(self): if "The visitorpassword you have entered is wrong" in self.html: self.logDebug("Incorrect password, please set right password on 'Edit package' form and retry") @@ -122,6 +132,7 @@ class LinkSaveIn(Crypter): else: self.correctCaptcha() + def handleLinkSource(self, type_): if type_ == "cnl2": return self.handleCNL2() @@ -132,6 +143,7 @@ class LinkSaveIn(Crypter): else: self.fail('unknown source type "%s" (this is probably a bug)' % type_) + def handleWebLinks(self): package_links = [] self.logDebug("Search for Web links") @@ -159,6 +171,7 @@ class LinkSaveIn(Crypter): self.logDebug("Error decrypting Web link %s, %s" % (webLink, detail)) return package_links + def handleContainer(self, type_): package_links = [] type_ = type_.lower() @@ -173,6 +186,7 @@ class LinkSaveIn(Crypter): package_links.append(link) return package_links + def handleCNL2(self): package_links = [] self.logDebug("Search for CNL2 links") @@ -187,6 +201,7 @@ class LinkSaveIn(Crypter): self.fail("Unable to decrypt CNL2 links") return package_links + def _getCipherParams(self): # Get jk jk_re = r'<INPUT.*?NAME="%s".*?VALUE="(.*?)"' % LinkSaveIn._JK_KEY_ @@ -200,6 +215,7 @@ class LinkSaveIn(Crypter): self.logDebug("Detected %d crypted blocks" % len(vcrypted)) return vcrypted, vjk + def _getLinks(self, crypted, jk): # Get key jreturn = self.js.eval("%s f()" % jk) -- cgit v1.2.3 From 1047c706d41dec4a49a747496c2ec01ed3bf7801 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Sun, 5 Oct 2014 01:54:58 +0200 Subject: Use load instead req.load in all crypters and CaptchaService --- module/plugins/crypter/DDLMusicOrg.py | 4 ++-- module/plugins/crypter/LixIn.py | 6 +++--- module/plugins/crypter/OneKhDe.py | 4 ++-- module/plugins/internal/CaptchaService.py | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/module/plugins/crypter/DDLMusicOrg.py b/module/plugins/crypter/DDLMusicOrg.py index f5e7203d3..9d76bf11a 100644 --- a/module/plugins/crypter/DDLMusicOrg.py +++ b/module/plugins/crypter/DDLMusicOrg.py @@ -23,7 +23,7 @@ class DDLMusicOrg(Crypter): self.multiDL = False def decrypt(self, pyfile): - html = self.req.load(pyfile.url, cookies=True) + html = self.load(pyfile.url, cookies=True) if re.search(r"Wer dies nicht rechnen kann", html) is not None: self.offline() @@ -38,7 +38,7 @@ class DDLMusicOrg(Crypter): else: solve = int(math.group(1)) - int(math.group(3)) sleep(3) - htmlwithlink = self.req.load(pyfile.url, cookies=True, + htmlwithlink = self.load(pyfile.url, cookies=True, post={"calc%s" % linknr: solve, "send%s" % linknr: "Send", "id": id, "linknr": linknr}) m = re.search(r"<form id=\"ff\" action=\"(.*?)\" method=\"post\">", htmlwithlink) diff --git a/module/plugins/crypter/LixIn.py b/module/plugins/crypter/LixIn.py index dec2e02d3..7aedda686 100644 --- a/module/plugins/crypter/LixIn.py +++ b/module/plugins/crypter/LixIn.py @@ -31,7 +31,7 @@ class LixIn(Crypter): id = m.group("ID") self.logDebug("File id is %s" % id) - self.html = self.req.load(url, decode=True) + self.html = self.load(url, decode=True) m = re.search(self.SUBMIT_PATTERN, self.html) if m is None: @@ -44,12 +44,12 @@ class LixIn(Crypter): if m: self.logDebug("Trying captcha") captcharesult = self.decryptCaptcha("http://lix.in/" + m.group("image")) - self.html = self.req.load(url, decode=True, + self.html = self.load(url, decode=True, post={"capt": captcharesult, "submit": "submit", "tiny": id}) else: self.logDebug("No captcha/captcha solved") else: - self.html = self.req.load(url, decode=True, post={"submit": "submit", "tiny": id}) + self.html = self.load(url, decode=True, post={"submit": "submit", "tiny": id}) m = re.search(self.LINK_PATTERN, self.html) if m is None: diff --git a/module/plugins/crypter/OneKhDe.py b/module/plugins/crypter/OneKhDe.py index ba93278d5..4b22432f8 100644 --- a/module/plugins/crypter/OneKhDe.py +++ b/module/plugins/crypter/OneKhDe.py @@ -30,9 +30,9 @@ class OneKhDe(Crypter): def proceed(self, url, location): url = self.parent.url - self.html = self.req.load(url) + self.html = self.load(url) link_ids = re.findall(r"<a id=\"DownloadLink_(\d*)\" href=\"http://1kh.de/", self.html) for id in link_ids: new_link = unescape( - re.search("width=\"100%\" src=\"(.*)\"></iframe>", self.req.load("http://1kh.de/l/" + id)).group(1)) + re.search("width=\"100%\" src=\"(.*)\"></iframe>", self.load("http://1kh.de/l/" + id)).group(1)) self.urls.append(new_link) diff --git a/module/plugins/internal/CaptchaService.py b/module/plugins/internal/CaptchaService.py index b2fba0652..35074bc63 100644 --- a/module/plugins/internal/CaptchaService.py +++ b/module/plugins/internal/CaptchaService.py @@ -92,7 +92,7 @@ class ReCaptcha(CaptchaService): self.plugin.fail(errmsg) raise TypeError(errmsg) - js = self.plugin.req.load("http://www.google.com/recaptcha/api/challenge", get={'k': key}, cookies=True) + js = self.plugin.load("http://www.google.com/recaptcha/api/challenge", get={'k': key}, cookies=True) try: challenge = re.search("challenge : '(.+?)',", js).group(1) @@ -154,7 +154,7 @@ class AdsCaptcha(CaptchaService): CaptchaId, PublicKey = key - js = self.plugin.req.load("http://api.adscaptcha.com/Get.aspx", get={'CaptchaId': CaptchaId, 'PublicKey': PublicKey}, cookies=True) + js = self.plugin.load("http://api.adscaptcha.com/Get.aspx", get={'CaptchaId': CaptchaId, 'PublicKey': PublicKey}, cookies=True) try: challenge = re.search("challenge: '(.+?)',", js).group(1) @@ -193,7 +193,7 @@ class SolveMedia(CaptchaService): self.plugin.fail(errmsg) raise TypeError(errmsg) - html = self.plugin.req.load("http://api.solvemedia.com/papi/challenge.noscript", get={'k': key}, cookies=True) + html = self.plugin.load("http://api.solvemedia.com/papi/challenge.noscript", get={'k': key}, cookies=True) try: challenge = re.search(r'<input type=hidden name="adcopy_challenge" id="adcopy_challenge" value="([^"]+)">', html).group(1) -- cgit v1.2.3 From df10dce103716acc293f51572650b3dbb7264bf2 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Sun, 5 Oct 2014 01:55:44 +0200 Subject: Spare code fixes about COOKIES --- module/plugins/hoster/BitshareCom.py | 7 ++++++- module/plugins/hoster/DlFreeFr.py | 10 ++++++++-- module/plugins/hoster/UploadingCom.py | 14 ++++++++------ 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/module/plugins/hoster/BitshareCom.py b/module/plugins/hoster/BitshareCom.py index d7143952b..86bc22860 100644 --- a/module/plugins/hoster/BitshareCom.py +++ b/module/plugins/hoster/BitshareCom.py @@ -22,15 +22,17 @@ class BitshareCom(SimpleHoster): FILE_INFO_PATTERN = r'Downloading (?P<N>.+) - (?P<S>[\d.]+) (?P<U>\w+)</h1>' OFFLINE_PATTERN = r'(>We are sorry, but the requested file was not found in our database|>Error - File not available<|The file was deleted either by the uploader, inactivity or due to copyright claim)' + COOKIES = [(".bitshare.com", "language_selection", "EN")] + FILE_AJAXID_PATTERN = r'var ajaxdl = "(.*?)";' TRAFFIC_USED_UP = r'Your Traffic is used up for today. Upgrade to premium to continue!' def setup(self): - self.req.cj.setCookie(".bitshare.com", "language_selection", "EN") self.multiDL = self.premium self.chunkLimit = 1 + def process(self, pyfile): if self.premium: self.account.relogin(self.user) @@ -77,6 +79,7 @@ class BitshareCom(SimpleHoster): elif check == "error": self.retry(5, 5 * 60, "Bitshare host : Error occured") + def getDownloadUrl(self): # Return location if direct download is active if self.premium: @@ -131,6 +134,7 @@ class BitshareCom(SimpleHoster): return url + def handleErrors(self, response, separator): self.logDebug("Checking response [%s]" % response) if "ERROR:Session timed out" in response: @@ -139,6 +143,7 @@ class BitshareCom(SimpleHoster): msg = response.split(separator)[-1] self.fail(msg) + def handleCaptchaErrors(self, response): self.logDebug("Result of captcha resolving [%s]" % response) if "SUCCESS" in response: 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é n'a pas été trouvé" @@ -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} diff --git a/module/plugins/hoster/UploadingCom.py b/module/plugins/hoster/UploadingCom.py index 45ab1d4cd..f4d6f5d8d 100644 --- a/module/plugins/hoster/UploadingCom.py +++ b/module/plugins/hoster/UploadingCom.py @@ -19,18 +19,18 @@ class UploadingCom(SimpleHoster): __author_name__ = ("jeix", "mkaay", "zoidberg") __author_mail__ = ("jeix@hasnomail.de", "mkaay@mkaay.de", "zoidberg@mujmail.cz") + FILE_NAME_PATTERN = r'id="file_title">(?P<N>.+)</' FILE_SIZE_PATTERN = r'size tip_container">(?P<S>[\d.]+) (?P<U>\w+)<' OFFLINE_PATTERN = r'(Page|file) not found' + COOKIES = [(".uploading.com", "lang", "1"), + (".uploading.com", "language", "1"), + (".uploading.com", "setlang", "en"), + (".uploading.com", "_lang", "en")] - def process(self, pyfile): - # set lang to english - self.req.cj.setCookie(".uploading.com", "lang", "1") - self.req.cj.setCookie(".uploading.com", "language", "1") - self.req.cj.setCookie(".uploading.com", "setlang", "en") - self.req.cj.setCookie(".uploading.com", "_lang", "en") + def process(self, pyfile): if not "/get/" in pyfile.url: pyfile.url = pyfile.url.replace("/files", "/files/get") @@ -42,6 +42,7 @@ class UploadingCom(SimpleHoster): else: self.handleFree() + def handlePremium(self): postData = {'action': 'get_link', 'code': self.file_info['ID'], @@ -55,6 +56,7 @@ class UploadingCom(SimpleHoster): raise Exception("Plugin defect.") + def handleFree(self): m = re.search('<h2>((Daily )?Download Limit)</h2>', self.html) if m: -- cgit v1.2.3 From 56971d70884e7d4f3242e7c52da88c4298ba130a Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Sun, 5 Oct 2014 02:26:08 +0200 Subject: [XFSPAccount] COOKIES attribute support --- module/plugins/accounts/CramitIn.py | 4 ++-- module/plugins/accounts/File4safeCom.py | 4 ++-- module/plugins/accounts/FilerioCom.py | 4 ++-- module/plugins/accounts/MovReelCom.py | 4 ++-- module/plugins/accounts/RarefileNet.py | 4 ++-- module/plugins/accounts/RyushareCom.py | 4 ++-- module/plugins/accounts/UptoboxCom.py | 4 ++-- module/plugins/internal/XFSPAccount.py | 20 +++++++++++++------- 8 files changed, 27 insertions(+), 21 deletions(-) diff --git a/module/plugins/accounts/CramitIn.py b/module/plugins/accounts/CramitIn.py index 34aa3ab40..f0cf2c6c7 100644 --- a/module/plugins/accounts/CramitIn.py +++ b/module/plugins/accounts/CramitIn.py @@ -6,10 +6,10 @@ from module.plugins.internal.XFSPAccount import XFSPAccount class CramitIn(XFSPAccount): __name__ = "CramitIn" __type__ = "account" - __version__ = "0.01" + __version__ = "0.02" __description__ = """Cramit.in account plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" - MAIN_PAGE = "http://cramit.in/" + HOSTER_URL = "http://cramit.in/" diff --git a/module/plugins/accounts/File4safeCom.py b/module/plugins/accounts/File4safeCom.py index aa7894e98..17a94195a 100644 --- a/module/plugins/accounts/File4safeCom.py +++ b/module/plugins/accounts/File4safeCom.py @@ -6,13 +6,13 @@ from module.plugins.internal.XFSPAccount import XFSPAccount class File4safeCom(XFSPAccount): __name__ = "File4safeCom" __type__ = "account" - __version__ = "0.01" + __version__ = "0.02" __description__ = """File4safe.com account plugin""" __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" - MAIN_PAGE = "http://file4safe.com/" + HOSTER_URL = "http://file4safe.com/" LOGIN_FAIL_PATTERN = r'input_login' PREMIUM_PATTERN = r'Extend Premium' diff --git a/module/plugins/accounts/FilerioCom.py b/module/plugins/accounts/FilerioCom.py index 544a7f3a6..8b5c41fee 100644 --- a/module/plugins/accounts/FilerioCom.py +++ b/module/plugins/accounts/FilerioCom.py @@ -6,10 +6,10 @@ from module.plugins.internal.XFSPAccount import XFSPAccount class FilerioCom(XFSPAccount): __name__ = "FilerioCom" __type__ = "account" - __version__ = "0.01" + __version__ = "0.02" __description__ = """FileRio.in account plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" - MAIN_PAGE = "http://filerio.in/" + HOSTER_URL = "http://filerio.in/" diff --git a/module/plugins/accounts/MovReelCom.py b/module/plugins/accounts/MovReelCom.py index 34862c4ef..1c2f3bbd4 100644 --- a/module/plugins/accounts/MovReelCom.py +++ b/module/plugins/accounts/MovReelCom.py @@ -6,7 +6,7 @@ from module.plugins.internal.XFSPAccount import XFSPAccount class MovReelCom(XFSPAccount): __name__ = "MovReelCom" __type__ = "account" - __version__ = "0.01" + __version__ = "0.02" __description__ = """Movreel.com account plugin""" __author_name__ = "t4skforce" @@ -15,7 +15,7 @@ class MovReelCom(XFSPAccount): login_timeout = 60 info_threshold = 30 - MAIN_PAGE = "http://movreel.com/" + HOSTER_URL = "http://movreel.com/" TRAFFIC_LEFT_PATTERN = r'Traffic.*?<b>([^<]+)</b>' LOGIN_FAIL_PATTERN = r'<b[^>]*>Incorrect Login or Password</b><br>' diff --git a/module/plugins/accounts/RarefileNet.py b/module/plugins/accounts/RarefileNet.py index c8eae79a8..e1fa7878a 100644 --- a/module/plugins/accounts/RarefileNet.py +++ b/module/plugins/accounts/RarefileNet.py @@ -6,10 +6,10 @@ from module.plugins.internal.XFSPAccount import XFSPAccount class RarefileNet(XFSPAccount): __name__ = "RarefileNet" __type__ = "account" - __version__ = "0.02" + __version__ = "0.03" __description__ = """RareFile.net account plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" - MAIN_PAGE = "http://rarefile.net/" + HOSTER_URL = "http://rarefile.net/" diff --git a/module/plugins/accounts/RyushareCom.py b/module/plugins/accounts/RyushareCom.py index 7fb373ca7..e6f9d486d 100644 --- a/module/plugins/accounts/RyushareCom.py +++ b/module/plugins/accounts/RyushareCom.py @@ -6,13 +6,13 @@ from module.plugins.internal.XFSPAccount import XFSPAccount class RyushareCom(XFSPAccount): __name__ = "RyushareCom" __type__ = "account" - __version__ = "0.03" + __version__ = "0.04" __description__ = """Ryushare.com account plugin""" __author_name__ = ("zoidberg", "trance4us") __author_mail__ = ("zoidberg@mujmail.cz", "") - MAIN_PAGE = "http://ryushare.com/" + HOSTER_URL = "http://ryushare.com/" def login(self, user, data, req): diff --git a/module/plugins/accounts/UptoboxCom.py b/module/plugins/accounts/UptoboxCom.py index 60de213ae..2c5f79ea1 100644 --- a/module/plugins/accounts/UptoboxCom.py +++ b/module/plugins/accounts/UptoboxCom.py @@ -6,12 +6,12 @@ from module.plugins.internal.XFSPAccount import XFSPAccount class UptoboxCom(XFSPAccount): __name__ = "UptoboxCom" __type__ = "account" - __version__ = "0.02" + __version__ = "0.03" __description__ = """DDLStorage.com account plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" - MAIN_PAGE = "http://uptobox.com/" + HOSTER_URL = "http://uptobox.com/" VALID_UNTIL_PATTERN = r'>Premium.[Aa]ccount expire: ([^<]+)</strong>' diff --git a/module/plugins/internal/XFSPAccount.py b/module/plugins/internal/XFSPAccount.py index 5c0bfc893..b93fb5d30 100644 --- a/module/plugins/internal/XFSPAccount.py +++ b/module/plugins/internal/XFSPAccount.py @@ -5,20 +5,23 @@ import re from time import mktime, strptime from module.plugins.Account import Account -from module.plugins.internal.SimpleHoster import parseHtmlForm +from module.plugins.internal.SimpleHoster import parseHtmlForm, set_cookies from module.utils import parseFileSize class XFSPAccount(Account): __name__ = "XFSPAccount" __type__ = "account" - __version__ = "0.06" + __version__ = "0.07" __description__ = """XFileSharingPro base account plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" - MAIN_PAGE = None + + HOSTER_URL = None + + COOKIES = None #: or list of tuples [(domain, name, value)] VALID_UNTIL_PATTERN = r'>Premium.[Aa]ccount expire:</TD><TD><b>([^<]+)</b>' TRAFFIC_LEFT_PATTERN = r'>Traffic available today:</TD><TD><b>([^<]+)</b>' @@ -27,7 +30,7 @@ class XFSPAccount(Account): def loadAccountInfo(self, user, req): - html = req.load(self.MAIN_PAGE + "?op=my_account", decode=True) + html = req.load(self.HOSTER_URL + "?op=my_account", decode=True) validuntil = trafficleft = None premium = True if re.search(self.PREMIUM_PATTERN, html) else False @@ -52,18 +55,21 @@ class XFSPAccount(Account): return {"validuntil": validuntil, "trafficleft": trafficleft, "premium": premium} + def login(self, user, data, req): - html = req.load('%slogin.html' % self.MAIN_PAGE, decode=True) + set_cookies(req.cj, self.COOKIES) + + html = req.load('%slogin.html' % self.HOSTER_URL, decode=True) action, inputs = parseHtmlForm('name="FL"', html) if not inputs: inputs = {"op": "login", - "redirect": self.MAIN_PAGE} + "redirect": self.HOSTER_URL} inputs.update({"login": user, "password": data['password']}) - html = req.load(self.MAIN_PAGE, post=inputs, decode=True) + html = req.load(self.HOSTER_URL, post=inputs, decode=True) if re.search(self.LOGIN_FAIL_PATTERN, html): self.wrongPassword() -- cgit v1.2.3 From c6eb00c85ee7ee83621175003e6140cdddf8f35e Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Sun, 5 Oct 2014 11:52:56 +0200 Subject: [HotfileFolderCom] Fix broken __pattern__ (thx zapp-brannigan) --- module/plugins/crypter/HotfileFolderCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/plugins/crypter/HotfileFolderCom.py b/module/plugins/crypter/HotfileFolderCom.py index 733437ec2..16fa604c9 100644 --- a/module/plugins/crypter/HotfileFolderCom.py +++ b/module/plugins/crypter/HotfileFolderCom.py @@ -6,9 +6,9 @@ from module.plugins.internal.DeadCrypter import DeadCrypter class HotfileFolderCom(DeadCrypter): __name__ = "HotfileFolderCom" __type__ = "crypter" - __version__ = "0.2" + __version__ = "0.3" - __pattern__ = r'https)://(?:www\.)?hotfile\.com/list/\w+/\w+' + __pattern__ = r'https?://(?:www\.)?hotfile\.com/list/\w+/\w+' __description__ = """Hotfile.com folder decrypter plugin""" __author_name__ = "RaNaN" -- cgit v1.2.3 From e5499906077a51df1c3b29e22234f37cec4a58ed Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Sun, 5 Oct 2014 03:35:49 +0200 Subject: Remove old Ev0InFetcher hook --- module/plugins/hooks/Ev0InFetcher.py | 80 ------------------------------------ 1 file changed, 80 deletions(-) delete mode 100644 module/plugins/hooks/Ev0InFetcher.py diff --git a/module/plugins/hooks/Ev0InFetcher.py b/module/plugins/hooks/Ev0InFetcher.py deleted file mode 100644 index 35a5c207c..000000000 --- a/module/plugins/hooks/Ev0InFetcher.py +++ /dev/null @@ -1,80 +0,0 @@ -# -*- coding: utf-8 -*- - -import feedparser - -from time import mktime, time - -from module.plugins.Hook import Hook - - -class Ev0InFetcher(Hook): - __name__ = "Ev0InFetcher" - __type__ = "hook" - __version__ = "0.21" - - __config__ = [("activated", "bool", "Activated", False), - ("interval", "int", "Check interval in minutes", 10), - ("queue", "bool", "Move new shows directly to Queue", False), - ("shows", "str", "Shows to check for (comma seperated)", ""), - ("quality", "xvid;x264;rmvb", "Video Format", "xvid"), - ("hoster", "str", "Hoster to use (comma seperated)", - "NetloadIn,RapidshareCom,MegauploadCom,HotfileCom")] - - __description__ = """Checks rss feeds for Ev0.in""" - __author_name__ = "mkaay" - __author_mail__ = "mkaay@mkaay.de" - - - def setup(self): - self.interval = self.getConfig("interval") * 60 - - def filterLinks(self, links): - results = self.core.pluginManager.parseUrls(links) - sortedLinks = {} - - for url, hoster in results: - if hoster not in sortedLinks: - sortedLinks[hoster] = [] - sortedLinks[hoster].append(url) - - for h in self.getConfig("hoster").split(","): - try: - return sortedLinks[h.strip()] - except: - continue - return [] - - - def periodical(self): - - def normalizefiletitle(filename): - filename = filename.replace('.', ' ') - filename = filename.replace('_', ' ') - filename = filename.lower() - return filename - - shows = [s.strip() for s in self.getConfig("shows").split(",")] - - feed = feedparser.parse("http://feeds.feedburner.com/ev0in/%s?format=xml" % self.getConfig("quality")) - - showStorage = {} - for show in shows: - showStorage[show] = int(self.getStorage("show_%s_lastfound" % show, 0)) - - found = False - for item in feed['items']: - for show, lastfound in showStorage.iteritems(): - if show.lower() in normalizefiletitle(item['title']) and lastfound < int(mktime(item.date_parsed)): - links = self.filterLinks(item['description'].split("<br />")) - packagename = item['title'].encode("utf-8") - self.logInfo(_("New episode '%s' (matched '%s')") % (packagename, show)) - self.core.api.addPackage(packagename, links, 1 if self.getConfig("queue") else 0) - self.setStorage("show_%s_lastfound" % show, int(mktime(item.date_parsed))) - found = True - if not found: - pass - - for show, lastfound in self.getStorage().iteritems(): - if int(lastfound) > 0 and int(lastfound) + (3600 * 24 * 30) < int(time()): - self.delStorage("show_%s_lastfound" % show) - self.logDebug("Cleaned '%s' record" % show) -- cgit v1.2.3