summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--module/plugins/accounts/Share76Com.py11
-rw-r--r--module/plugins/hooks/LinkdecrypterCom.py19
-rw-r--r--module/plugins/hoster/BillionuploadsCom.py17
-rw-r--r--module/plugins/hoster/EuroshareEu.py28
-rw-r--r--module/plugins/hoster/NetloadIn.py12
-rw-r--r--module/plugins/hoster/SendmywayCom.py18
-rw-r--r--module/plugins/hoster/Share76Com.py19
-rw-r--r--module/plugins/hoster/SharebeesCom.py19
-rw-r--r--module/plugins/hoster/UploadedTo.py13
-rw-r--r--module/plugins/hoster/XFileSharingPro.py139
-rw-r--r--module/plugins/hoster/YoutubeCom.py20
11 files changed, 219 insertions, 96 deletions
diff --git a/module/plugins/accounts/Share76Com.py b/module/plugins/accounts/Share76Com.py
new file mode 100644
index 000000000..9c946ae50
--- /dev/null
+++ b/module/plugins/accounts/Share76Com.py
@@ -0,0 +1,11 @@
+# -*- coding: utf-8 -*-
+from module.plugins.internal.XFSPAccount import XFSPAccount
+
+class Share76Com(XFSPAccount):
+ __name__ = "Share76Com"
+ __version__ = "0.02"
+ __type__ = "account"
+ __description__ = """Share76.com account plugin"""
+ __author_name__ = ("me")
+
+ MAIN_PAGE = "http://Share76.com/"
diff --git a/module/plugins/hooks/LinkdecrypterCom.py b/module/plugins/hooks/LinkdecrypterCom.py
index ac939afd9..a554e05eb 100644
--- a/module/plugins/hooks/LinkdecrypterCom.py
+++ b/module/plugins/hooks/LinkdecrypterCom.py
@@ -24,28 +24,33 @@ from module.utils import remove_chars
class LinkdecrypterCom(Hook):
__name__ = "LinkdecrypterCom"
- __version__ = "0.14"
+ __version__ = "0.15"
__description__ = """linkdecrypter.com - regexp loader"""
__config__ = [ ("activated", "bool", "Activated" , "True") ]
__author_name__ = ("zoidberg")
-
+
def coreReady(self):
page = getURL("http://linkdecrypter.com/")
m = re.search(r'<b>Supported</b>: <i>([^+<]*)', page)
if not m:
self.logError(_("Crypter list not found"))
return
-
- online = m.group(1).split(', ')
+
builtin = [ name.lower() for name in self.core.pluginManager.crypterPlugins.keys() ]
builtin.extend([ "downloadserienjunkiesorg" ])
-
- online = [ crypter.replace(".", "\\.") for crypter in online if remove_chars(crypter, "-.") not in builtin ]
+
+ crypter_pattern = re.compile("(\w[\w.-]+)")
+ online = []
+ for crypter in m.group(1).split(', '):
+ m = re.match(crypter_pattern, crypter)
+ if m and remove_chars(m.group(1), "-.") not in builtin:
+ online.append(m.group(1).replace(".", "\\."))
+
if not online:
self.logError(_("Crypter list is empty"))
return
- regexp = r"https?://([^.]+\.)*?(%s)/.*" % "|".join(online)
+ regexp = r"http://([^.]+\.)*?(%s)/.*" % "|".join(online)
dict = self.core.pluginManager.crypterPlugins[self.__name__]
dict["pattern"] = regexp
diff --git a/module/plugins/hoster/BillionuploadsCom.py b/module/plugins/hoster/BillionuploadsCom.py
new file mode 100644
index 000000000..5b053d547
--- /dev/null
+++ b/module/plugins/hoster/BillionuploadsCom.py
@@ -0,0 +1,17 @@
+# -*- coding: utf-8 -*-
+from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo
+
+class BillionuploadsCom(XFileSharingPro):
+ __name__ = "BillionuploadsCom"
+ __type__ = "hoster"
+ __pattern__ = r"http://(?:\w*\.)*?billionuploads.com/\w{12}"
+ __version__ = "0.01"
+ __description__ = """billionuploads.com hoster plugin"""
+ __author_name__ = ("zoidberg")
+ __author_mail__ = ("zoidberg@mujmail.cz")
+
+ FILE_NAME_PATTERN = r'<b>Filename:</b>(?P<N>.*?)<br>'
+ FILE_SIZE_PATTERN = r'<b>Size:</b>(?P<S>.*?)<br>'
+ HOSTER_NAME = "billionuploads.com"
+
+getInfo = create_getInfo(BillionuploadsCom)
diff --git a/module/plugins/hoster/EuroshareEu.py b/module/plugins/hoster/EuroshareEu.py
index 97e6a989a..5224dfd9f 100644
--- a/module/plugins/hoster/EuroshareEu.py
+++ b/module/plugins/hoster/EuroshareEu.py
@@ -23,40 +23,40 @@ class EuroshareEu(SimpleHoster):
__name__ = "EuroshareEu"
__type__ = "hoster"
__pattern__ = r"http://(\w*\.)?euroshare.(eu|sk|cz|hu|pl)/file/.*"
- __version__ = "0.24"
+ __version__ = "0.25"
__description__ = """Euroshare.eu"""
__author_name__ = ("zoidberg")
FILE_INFO_PATTERN = r'<span style="float: left;"><strong>(?P<N>.+?)</strong> \((?P<S>.+?)\)</span>'
FILE_OFFLINE_PATTERN = ur'<h2>S.bor sa nena.iel</h2>|Požadovaná stránka neexistuje!'
-
+
FREE_URL_PATTERN = r'<a href="(/file/\d+/[^/]*/download/)"><div class="downloadButton"'
ERR_PARDL_PATTERN = r'<h2>Prebieha s.ahovanie</h2>|<p>Naraz je z jednej IP adresy mo.n. s.ahova. iba jeden s.bor'
ERR_NOT_LOGGED_IN_PATTERN = r'href="/customer-zone/login/"'
-
+
FILE_URL_REPLACEMENTS = [(r"(http://[^/]*\.)(sk|cz|hu|pl)/", r"\1eu/")]
-
+
def setup(self):
self.multiDL = self.resumeDownload = self.premium
self.req.setOption("timeout", 120)
-
+
def handlePremium(self):
if self.ERR_NOT_LOGGED_IN_PATTERN in self.html:
- self.account.relogin(user)
- self.retry()
+ self.account.relogin(self.user)
+ self.retry(reason="User not logged in")
self.download(self.pyfile.url.rstrip('/') + "/download/")
-
+
check = self.checkDownload({"login": re.compile(self.ERR_NOT_LOGGED_IN_PATTERN),
"json": re.compile(r'\{"status":"error".*?"message":"(.*?)"')
})
if check == "login" or (check == "json" and self.lastCheck.group(1) == "Access token expired"):
- self.account.relogin(user)
- self.retry()
+ self.account.relogin(self.user)
+ self.retry(reason="Access token expired")
elif check == "json":
self.fail(self.lastCheck.group(1))
- def handleFree(self):
+ def handleFree(self):
if re.search(self.ERR_PARDL_PATTERN, self.html) is not None:
self.longWait(300, 12)
@@ -66,9 +66,9 @@ class EuroshareEu(SimpleHoster):
parsed_url = "http://euroshare.eu%s" % found.group(1)
self.logDebug("URL", parsed_url)
self.download(parsed_url, disposition=True)
-
+
check = self.checkDownload({"multi_dl": re.compile(self.ERR_PARDL_PATTERN)})
if check == "multi_dl":
self.longWait(300, 12)
-
-getInfo = create_getInfo(EuroshareEu) \ No newline at end of file
+
+getInfo = create_getInfo(EuroshareEu) \ No newline at end of file
diff --git a/module/plugins/hoster/NetloadIn.py b/module/plugins/hoster/NetloadIn.py
index fa2f3ddef..d2bf37d70 100644
--- a/module/plugins/hoster/NetloadIn.py
+++ b/module/plugins/hoster/NetloadIn.py
@@ -55,7 +55,7 @@ class NetloadIn(Hoster):
__name__ = "NetloadIn"
__type__ = "hoster"
__pattern__ = r"http://.*netload\.in/(?:datei(.*?)(?:\.htm|/)|index.php?id=10&file_id=)"
- __version__ = "0.40"
+ __version__ = "0.41"
__description__ = """Netload.in Download Hoster"""
__author_name__ = ("spoob", "RaNaN", "Gregy")
__author_mail__ = ("spoob@pyload.org", "ranan@pyload.org", "gregy@gregy.cz")
@@ -66,7 +66,7 @@ class NetloadIn(Hoster):
self.multiDL = True
self.chunkLimit = -1
self.resumeDownload = True
-
+
def process(self, pyfile):
self.url = pyfile.url
self.prepare()
@@ -94,7 +94,11 @@ class NetloadIn(Hoster):
id_regex = re.compile(self.__pattern__)
match = id_regex.search(url)
- if not match:
+ if match:
+ #normalize url
+ self.url = 'http://www.netload.in/datei%s.htm' % match.group(1)
+ self.logDebug("URL: %s" % self.url)
+ else:
self.api_data = False
return
@@ -107,7 +111,7 @@ class NetloadIn(Hoster):
self.log.debug("Netload: APIDATA: "+src)
self.api_data = {}
- if src and src not in ("unknown file_data", "unknown_server_data", "No input file specified."):
+ if src and ";" in src and src not in ("unknown file_data", "unknown_server_data", "No input file specified."):
lines = src.split(";")
self.api_data["exists"] = True
self.api_data["fileid"] = lines[0]
diff --git a/module/plugins/hoster/SendmywayCom.py b/module/plugins/hoster/SendmywayCom.py
new file mode 100644
index 000000000..fcbac850a
--- /dev/null
+++ b/module/plugins/hoster/SendmywayCom.py
@@ -0,0 +1,18 @@
+# -*- coding: utf-8 -*-
+from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo
+
+
+class SendmywayCom(XFileSharingPro):
+ __name__ = "SendmywayCom"
+ __type__ = "hoster"
+ __pattern__ = r"http://(?:\w*\.)*?sendmyway.com/\w{12}"
+ __version__ = "0.01"
+ __description__ = """SendMyWay hoster plugin"""
+ __author_name__ = ("zoidberg")
+ __author_mail__ = ("zoidberg@mujmail.cz")
+
+ FILE_NAME_PATTERN = r'<p class="file-name" ><.*?>\s*(?P<N>.+)'
+ FILE_SIZE_PATTERN = r'<small>\((?P<S>\d+) bytes\)</small>'
+ HOSTER_NAME = "sendmyway.com"
+
+getInfo = create_getInfo(SendmywayCom)
diff --git a/module/plugins/hoster/Share76Com.py b/module/plugins/hoster/Share76Com.py
new file mode 100644
index 000000000..db850cb73
--- /dev/null
+++ b/module/plugins/hoster/Share76Com.py
@@ -0,0 +1,19 @@
+# -*- coding: utf-8 -*-
+from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo
+
+class Share76Com(XFileSharingPro):
+ __name__ = "Share76Com"
+ __type__ = "hoster"
+ __pattern__ = r"http://(?:\w*\.)*?share76.com/\w{12}"
+ __version__ = "0.03"
+ __description__ = """share76.com hoster plugin"""
+ __author_name__ = ("me")
+
+ FILE_INFO_PATTERN = r'<h2>\s*File:\s*<font[^>]*>(?P<N>[^>]+)</font>\s*\[<font[^>]*>(?P<S>[0-9.]+) (?P<U>[kKMG])i?B</font>\]</h2>'
+ HOSTER_NAME = "share76.com"
+
+ def setup(self):
+ self.resumeDownload = self.multiDL = self.premium
+ self.chunkLimit = 1
+
+getInfo = create_getInfo(Share76Com)
diff --git a/module/plugins/hoster/SharebeesCom.py b/module/plugins/hoster/SharebeesCom.py
new file mode 100644
index 000000000..f5bacc5b0
--- /dev/null
+++ b/module/plugins/hoster/SharebeesCom.py
@@ -0,0 +1,19 @@
+# -*- coding: utf-8 -*-
+from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo
+
+
+class SharebeesCom(XFileSharingPro):
+ __name__ = "SharebeesCom"
+ __type__ = "hoster"
+ __pattern__ = r"http://(?:\w*\.)*?sharebees.com/\w{12}"
+ __version__ = "0.01"
+ __description__ = """ShareBees hoster plugin"""
+ __author_name__ = ("zoidberg")
+ __author_mail__ = ("zoidberg@mujmail.cz")
+
+ FILE_NAME_PATTERN = r'<p class="file-name" ><.*?>\s*(?P<N>.+)'
+ FILE_SIZE_PATTERN = r'<small>\((?P<S>\d+) bytes\)</small>'
+ FORM_PATTERN = 'F1'
+ HOSTER_NAME = "sharebees.com"
+
+getInfo = create_getInfo(SharebeesCom)
diff --git a/module/plugins/hoster/UploadedTo.py b/module/plugins/hoster/UploadedTo.py
index 19ca4ba9d..d729e73c6 100644
--- a/module/plugins/hoster/UploadedTo.py
+++ b/module/plugins/hoster/UploadedTo.py
@@ -74,13 +74,14 @@ class UploadedTo(Hoster):
__name__ = "UploadedTo"
__type__ = "hoster"
__pattern__ = r"http://[\w\.-]*?(uploaded\.(to|net)(/file/|/?\?id=|.*?&id=)|ul\.to/)\w+"
- __version__ = "0.62"
+ __version__ = "0.63"
__description__ = """Uploaded.net Download Hoster"""
__author_name__ = ("spoob", "mkaay", "zoidberg", "netpok")
__author_mail__ = ("spoob@pyload.org", "mkaay@mkaay.de", "zoidberg@mujmail.cz", "netpok@gmail.com")
FILE_INFO_PATTERN = r'<a href="file/(?P<ID>\w+)" id="filename">(?P<N>[^<]+)</a> &nbsp;\s*<small[^>]*>(?P<S>[^<]+)</small>'
FILE_OFFLINE_PATTERN = r'<small class="cL">Error: 404</small>'
+ DL_LIMIT_PATTERN = "You have reached the max. number of possible free downloads for this hour"
def setup(self):
self.html = None
@@ -199,7 +200,7 @@ class UploadedTo(Hoster):
self.retry()
elif "limit-parallel" in result:
self.fail("Cannot download in parallel")
- elif "You have reached the max. number of possible free downloads for this hour" in result: # limit-dl
+ elif self.DL_LIMIT_PATTERN in result: # limit-dl
self.setWait(60 * 60, True)
self.wait()
self.retry()
@@ -212,11 +213,13 @@ class UploadedTo(Hoster):
break
else:
self.fail("Unknown error '%s'")
- self.setWait(60 * 60, True)
- self.wait()
- self.retry()
if not downloadURL:
self.fail("No Download url retrieved/all captcha attempts failed")
self.download(downloadURL)
+ check = self.checkDownload({"limit-dl": self.DL_LIMIT_PATTERN})
+ if check == "limit-dl":
+ self.setWait(60 * 60, True)
+ self.wait()
+ self.retry()
diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py
index 713198754..d58a7073e 100644
--- a/module/plugins/hoster/XFileSharingPro.py
+++ b/module/plugins/hoster/XFileSharingPro.py
@@ -3,7 +3,7 @@
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License,
- or (at your option) any later version.
+ or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -34,7 +34,7 @@ class XFileSharingPro(SimpleHoster):
__name__ = "XFileSharingPro"
__type__ = "hoster"
__pattern__ = r"^unmatchable$"
- __version__ = "0.13"
+ __version__ = "0.14"
__description__ = """XFileSharingPro common hoster base"""
__author_name__ = ("zoidberg")
__author_mail__ = ("zoidberg@mujmail.cz")
@@ -52,21 +52,18 @@ class XFileSharingPro(SimpleHoster):
RECAPTCHA_URL_PATTERN = r'http://[^"\']+?recaptcha[^"\']+?\?k=([^"\']+)"'
CAPTCHA_DIV_PATTERN = r'<b>Enter code.*?<div.*?>(.*?)</div>'
ERROR_PATTERN = r'class=["\']err["\'][^>]*>(.*?)</'
- FORM_PATTERN = 'F1'
-
+
def setup(self):
- self.__pattern__ = self.core.pluginManager.hosterPlugins[self.__name__]['pattern']
- self.multiDL = True
- self.chunkLimit = 1
+ if self.__name__ == "XFileSharingPro":
+ self.__pattern__ = self.core.pluginManager.hosterPlugins[self.__name__]['pattern']
+ self.multiDL = True
+ else:
+ self.resumeDownload = self.multiDL = self.premium
+
+ self.chunkLimit = 1
def process(self, pyfile):
- if not hasattr(self, "HOSTER_NAME"):
- self.HOSTER_NAME = re.search(self.__pattern__, self.pyfile.url).group(1)
- if not hasattr(self, "DIRECT_LINK_PATTERN"):
- self.DIRECT_LINK_PATTERN = r'(http://(\w+\.%s|\d+\.\d+\.\d+\.\d+)(:\d+/d/|/files/\d+/\w+/)[^"\'<]+)' % self.HOSTER_NAME
-
- self.captcha = self.errmsg = None
- self.passwords = self.getPassword().splitlines()
+ self.prepare()
if not re.match(self.__pattern__, self.pyfile.url):
if self.premium:
@@ -79,58 +76,74 @@ class XFileSharingPro(SimpleHoster):
self.file_info = self.getFileInfo()
except PluginParseError:
self.file_info = None
-
- self.req.http.lastURL = self.pyfile.url
-
- self.req.http.c.setopt(FOLLOWLOCATION, 0)
- self.html = self.load(self.pyfile.url, cookies = True, decode = True)
- self.header = self.req.http.header
- self.req.http.c.setopt(FOLLOWLOCATION, 1)
- self.location = None
- found = re.search("Location\s*:\s*(.*)", self.header, re.I)
- if found and re.match(self.DIRECT_LINK_PATTERN, found.group(1)):
- self.location = found.group(1).strip()
-
+ self.location = self.getDirectDownloadLink()
+
if not self.file_info:
pyfile.name = html_unescape(unquote(urlparse(self.location if self.location else pyfile.url).path.split("/")[-1]))
-
- if self.location:
+
+ if self.location:
self.startDownload(self.location)
elif self.premium:
self.handlePremium()
else:
self.handleFree()
+ def prepare(self):
+ """ Initialize important variables """
+ if not hasattr(self, "HOSTER_NAME"):
+ self.HOSTER_NAME = re.search(self.__pattern__, self.pyfile.url).group(1)
+ if not hasattr(self, "DIRECT_LINK_PATTERN"):
+ self.DIRECT_LINK_PATTERN = r'(http://(\w+\.%s|\d+\.\d+\.\d+\.\d+)(:\d+/d/|/files/\d+/\w+/)[^"\'<]+)' % self.HOSTER_NAME
+
+ self.captcha = self.errmsg = None
+ self.passwords = self.getPassword().splitlines()
+
+ def getDirectDownloadLink(self):
+ """ Get download link for premium users with direct download enabled """
+ self.req.http.lastURL = self.pyfile.url
+
+ self.req.http.c.setopt(FOLLOWLOCATION, 0)
+ self.html = self.load(self.pyfile.url, cookies = True, decode = True)
+ self.header = self.req.http.header
+ self.req.http.c.setopt(FOLLOWLOCATION, 1)
+
+ location = None
+ found = re.search("Location\s*:\s*(.*)", self.header, re.I)
+ if found and re.match(self.DIRECT_LINK_PATTERN, found.group(1)):
+ location = found.group(1).strip()
+
+ return location
+
def handleFree(self):
url = self.getDownloadLink()
self.logDebug("Download URL: %s" % url)
self.startDownload(url)
-
+
def getDownloadLink(self):
for i in range(5):
self.logDebug("Getting download link: #%d" % i)
data = self.getPostParameters()
-
+
self.req.http.c.setopt(FOLLOWLOCATION, 0)
self.html = self.load(self.pyfile.url, post = data, ref = True, decode = True)
self.header = self.req.http.header
- self.req.http.c.setopt(FOLLOWLOCATION, 1)
-
+ self.req.http.c.setopt(FOLLOWLOCATION, 1)
+
found = re.search("Location\s*:\s*(.*)", self.header, re.I)
- if found:
+ if found:
break
-
+
found = re.search(self.DIRECT_LINK_PATTERN, self.html, re.S)
- if found:
- break
+ if found:
+ break
else:
- if self.errmsg and 'captcha' in self.errmsg:
+ if self.errmsg and 'captcha' in self.errmsg:
self.fail("No valid captcha code entered")
else:
self.fail("Download link not found")
-
+
return found.group(1)
def handlePremium(self):
@@ -138,7 +151,7 @@ class XFileSharingPro(SimpleHoster):
found = re.search(self.DIRECT_LINK_PATTERN, self.html)
if not found: self.parseError('DIRECT LINK')
self.startDownload(found.group(1))
-
+
def handleOverriden(self):
#only tested with easybytez.com
self.html = self.load("http://www.%s/" % self.HOSTER_NAME)
@@ -154,7 +167,7 @@ class XFileSharingPro(SimpleHoster):
self.req.http.c.setopt(LOW_SPEED_TIME, 600)
self.html = self.load(action, post = inputs)
- action, inputs = self.parseHtmlForm(self.FORM_PATTERN)
+ action, inputs = self.parseHtmlForm('F1')
if not inputs: self.parseError('TEXTAREA')
self.logDebug(self.HOSTER_NAME, inputs)
if inputs['st'] == 'OK':
@@ -162,8 +175,8 @@ class XFileSharingPro(SimpleHoster):
elif inputs['st'] == 'Can not leech file':
self.retry(max_tries=20, wait_time=180, reason=inputs['st'])
else:
- self.fail(inputs['st'])
-
+ self.fail(inputs['st'])
+
#get easybytez.com link for uploaded file
found = re.search(self.OVR_DOWNLOAD_LINK_PATTERN, self.html)
if not found: self.parseError('DIRECT LINK (OVR)')
@@ -201,49 +214,53 @@ class XFileSharingPro(SimpleHoster):
self.fail("File too large for free download")
else:
self.fail(self.errmsg)
-
+
else:
self.errmsg = None
-
+
return self.errmsg
def getPostParameters(self):
for i in range(3):
if not self.errmsg: self.checkErrors()
- action, inputs = self.parseHtmlForm(input_names={"op": re.compile("^download")})
- if not inputs:
+ if hasattr(self,"FORM_PATTERN"):
action, inputs = self.parseHtmlForm(self.FORM_PATTERN)
- if not inputs:
+ else:
+ action, inputs = self.parseHtmlForm(input_names={"op": re.compile("^download")})
+
+ if not inputs:
+ action, inputs = self.parseHtmlForm('F1')
+ if not inputs:
if self.errmsg:
self.retry()
else:
self.parseError("Form not found")
-
+
self.logDebug(self.HOSTER_NAME, inputs)
-
- if 'op' in inputs and inputs['op'] in ('download2', 'download3'):
+
+ if 'op' in inputs and inputs['op'] in ('download2', 'download3'):
if "password" in inputs:
if self.passwords:
inputs['password'] = self.passwords.pop(0)
else:
self.fail("No or invalid passport")
-
- if not self.premium:
+
+ if not self.premium:
found = re.search(self.WAIT_PATTERN, self.html)
if found:
wait_time = int(found.group(1)) + 1
self.setWait(wait_time, False)
else:
wait_time = 0
-
+
self.captcha = self.handleCaptcha(inputs)
if wait_time: self.wait()
-
+
self.errmsg = None
return inputs
-
+
else:
inputs['referer'] = self.pyfile.url
@@ -258,7 +275,7 @@ class XFileSharingPro(SimpleHoster):
self.errmsg = None
else: self.parseError('FORM: %s' % (inputs['op'] if 'op' in inputs else 'UNKNOWN'))
-
+
def handleCaptcha(self, inputs):
found = re.search(self.RECAPTCHA_URL_PATTERN, self.html)
if found:
@@ -274,14 +291,14 @@ class XFileSharingPro(SimpleHoster):
inputs['code'] = self.decryptCaptcha(captcha_url)
return 2
else:
- found = re.search(self.CAPTCHA_DIV_PATTERN, self.html, re.S)
+ found = re.search(self.CAPTCHA_DIV_PATTERN, self.html, re.S)
if found:
captcha_div = found.group(1)
- self.logDebug(captcha_div)
+ self.logDebug(captcha_div)
numerals = re.findall('<span.*?padding-left\s*:\s*(\d+).*?>(\d)</span>', html_unescape(captcha_div))
inputs['code'] = "".join([a[1] for a in sorted(numerals, key = lambda num: int(num[0]))])
- self.logDebug("CAPTCHA", inputs['code'], numerals)
- return 3
+ self.logDebug("CAPTCHA", inputs['code'], numerals)
+ return 3
return 0
-
+
getInfo = create_getInfo(XFileSharingPro) \ No newline at end of file
diff --git a/module/plugins/hoster/YoutubeCom.py b/module/plugins/hoster/YoutubeCom.py
index c9e8a1c7a..29cb3f60a 100644
--- a/module/plugins/hoster/YoutubeCom.py
+++ b/module/plugins/hoster/YoutubeCom.py
@@ -11,9 +11,9 @@ class YoutubeCom(Hoster):
__name__ = "YoutubeCom"
__type__ = "hoster"
__pattern__ = r"(http|https)://(www\.)?(de\.)?\youtube\.com/watch\?v=.*"
- __version__ = "0.27"
- __config__ = [("quality", "sd;hd;fullhd", "Quality Setting", "hd"),
- ("fmt", "int", "FMT Number 0-102", 0),
+ __version__ = "0.28"
+ __config__ = [("quality", "sd;hd;fullhd;240p;360p;480p;720p;1080p;3072p", "Quality Setting", "hd"),
+ ("fmt", "int", "FMT/ITAG Number (5-102, 0 for auto)", 0),
(".mp4", "bool", "Allow .mp4", True),
(".flv", "bool", "Allow .flv", True),
(".webm", "bool", "Allow .webm", False),
@@ -47,6 +47,8 @@ class YoutubeCom(Hoster):
102: (".webm", 1280, 720, 8, True)
}
+ def setup(self):
+ self.resumeDownload = self.multiDL = True
def process(self, pyfile):
html = self.load(pyfile.url, decode=True)
@@ -59,8 +61,16 @@ class YoutubeCom(Hoster):
#get config
use3d = self.getConf("3d")
- quality = {"sd":82,"hd":84,"fullhd":85} if use3d else {"sd":18,"hd":22,"fullhd":37}
- desired_fmt = self.getConf("fmt") or quality.get(self.getConf("quality"), 18)
+ if use3d:
+ quality = {"sd":82,"hd":84,"fullhd":85,"240p":83,"360p":82,"480p":82,"720p":84,"1080p":85,"3072p":85}
+ else:
+ quality = {"sd":18,"hd":22,"fullhd":37,"240p":5,"360p":18,"480p":35,"720p":22,"1080p":37,"3072p":38}
+ desired_fmt = self.getConf("fmt")
+ if desired_fmt and desired_fmt not in formats:
+ self.logWarning("FMT %d unknown - using default." % desired_fmt)
+ desired_fmt = 0
+ if not desired_fmt:
+ desired_fmt = quality.get(self.getConf("quality"), 18)
#parse available streams
streams = unquote(re.search(r'url_encoded_fmt_stream_map=(.*?);', html).group(1))