summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--module/FileDatabase.py2
-rw-r--r--module/plugins/crypter/SerienjunkiesOrg.py94
-rw-r--r--module/plugins/hooks/UnRar.py2
3 files changed, 46 insertions, 52 deletions
diff --git a/module/FileDatabase.py b/module/FileDatabase.py
index a59632bb8..a71336e07 100644
--- a/module/FileDatabase.py
+++ b/module/FileDatabase.py
@@ -800,7 +800,7 @@ class FileDatabaseBackend(Thread):
cmd += ")"
- cmd = "SELECT l.id FROM links as l INNER JOIN packages as p ON l.package=p.id WHERE p.queue=1 AND l.plugin NOT IN %s AND l.status IN (2,3,6,14) ORDER BY p.priority, p.packageorder, l.linkorder LIMIT 5" % cmd
+ cmd = "SELECT l.id FROM links as l INNER JOIN packages as p ON l.package=p.id WHERE p.queue=1 AND l.plugin NOT IN %s AND l.status IN (2,3,6,14) ORDER BY p.priority DESC, p.packageorder ASC, l.linkorder ASC LIMIT 5" % cmd
self.c.execute(cmd) # very bad!
diff --git a/module/plugins/crypter/SerienjunkiesOrg.py b/module/plugins/crypter/SerienjunkiesOrg.py
index 49ec049bc..1b0baf86a 100644
--- a/module/plugins/crypter/SerienjunkiesOrg.py
+++ b/module/plugins/crypter/SerienjunkiesOrg.py
@@ -94,58 +94,52 @@ class SerienjunkiesOrg(Crypter):
self.packages.append((package, links, package))
def handleEpisode(self, url):
- if not self.core.isClientConnected():
- raise Fail(_("No Client connected for captcha decrypting."))
- for i in range(3):
- src = self.getSJSrc(url)
- if not src.find("Du hast das Download-Limit überschritten! Bitte versuche es später nocheinmal.") == -1:
- self.log.info(_("Downloadlimit reached"))
- return False
- else:
- soup = BeautifulSoup(src)
- form = soup.find("form")
- packageName = soup.find("h1", attrs={"class":"wrap"}).text
- captchaTag = soup.find(attrs={"src":re.compile("^/secure/")})
- captchaUrl = "http://download.serienjunkies.org"+captchaTag["src"]
- result = self.decryptCaptcha(str(captchaUrl))
- sinp = form.find(attrs={"name":"s"})
-
- self.req.lastUrl = url
- sj = self.req.load(str(url), post={'s': sinp["value"], 'c': result, 'action': "Download"})
-
- soup = BeautifulSoup(sj)
- rawLinks = soup.findAll(attrs={"action": re.compile("^http://download.serienjunkies.org/")})
-
- if not len(rawLinks) > 0:
- continue
-
- links = []
- for link in rawLinks:
- frameUrl = link["action"].replace("/go-", "/frame/go-")
- links.append(self.handleFrame(frameUrl))
- self.packages.append((packageName, links, packageName))
- break
-
- def handleOldStyleLink(self, url):
- if not self.core.isClientConnected():
- raise Fail(_("No Client connected for captcha decrypting."))
- for i in range(3):
- sj = self.req.load(str(url))
- soup = BeautifulSoup(sj)
- form = soup.find("form", attrs={"action":re.compile("^http://serienjunkies.org")})
- captchaTag = form.find(attrs={"src":re.compile("^/safe/secure/")})
- captchaUrl = "http://serienjunkies.org"+captchaTag["src"]
- captchaData = self.req.load(str(captchaUrl))
- result = self.waitForCaptcha(captchaData, "png")
- url = form["action"]
+ src = self.getSJSrc(url)
+ if not src.find("Du hast das Download-Limit überschritten! Bitte versuche es später nocheinmal.") == -1:
+ self.fail(_("Downloadlimit reached"))
+ else:
+ soup = BeautifulSoup(src)
+ form = soup.find("form")
+ packageName = soup.find("h1", attrs={"class":"wrap"}).text
+ captchaTag = soup.find(attrs={"src":re.compile("^/secure/")})
+ if not captchaTag:
+ self.retry()
+
+ captchaUrl = "http://download.serienjunkies.org"+captchaTag["src"]
+ result = self.decryptCaptcha(str(captchaUrl))
sinp = form.find(attrs={"name":"s"})
- self.req.load(str(url), post={'s': sinp["value"], 'c': result, 'dl.start': "Download"}, cookies=False, just_header=True)
- decrypted = self.req.lastEffectiveURL
- if decrypted == str(url):
- continue
- self.packages.append((self.pyfile.package().name, [decrypted], self.pyfile.package().folder))
- break
+ self.req.lastUrl = url
+ sj = self.req.load(str(url), post={'s': sinp["value"], 'c': result, 'action': "Download"})
+
+ soup = BeautifulSoup(sj)
+ rawLinks = soup.findAll(attrs={"action": re.compile("^http://download.serienjunkies.org/")})
+
+ if not len(rawLinks) > 0:
+ self.retry()
+
+ links = []
+ for link in rawLinks:
+ frameUrl = link["action"].replace("/go-", "/frame/go-")
+ links.append(self.handleFrame(frameUrl))
+ self.packages.append((packageName, links, packageName))
+
+ def handleOldStyleLink(self, url):
+ sj = self.req.load(str(url))
+ soup = BeautifulSoup(sj)
+ form = soup.find("form", attrs={"action":re.compile("^http://serienjunkies.org")})
+ captchaTag = form.find(attrs={"src":re.compile("^/safe/secure/")})
+ captchaUrl = "http://serienjunkies.org"+captchaTag["src"]
+ captchaData = self.req.load(str(captchaUrl))
+ result = self.waitForCaptcha(captchaData, "png")
+ url = form["action"]
+ sinp = form.find(attrs={"name":"s"})
+
+ self.req.load(str(url), post={'s': sinp["value"], 'c': result, 'dl.start': "Download"}, cookies=False, just_header=True)
+ decrypted = self.req.lastEffectiveURL
+ if decrypted == str(url):
+ self.retry()
+ self.packages.append((self.pyfile.package().name, [decrypted], self.pyfile.package().folder))
def handleFrame(self, url):
self.req.load(str(url), cookies=False, just_header=True)
diff --git a/module/plugins/hooks/UnRar.py b/module/plugins/hooks/UnRar.py
index f6c202ddb..46e7874d3 100644
--- a/module/plugins/hooks/UnRar.py
+++ b/module/plugins/hooks/UnRar.py
@@ -106,7 +106,7 @@ class UnRar(Hook):
u = Unrar(join(folder, fname))
try:
- success = u.crackPassword(passwords=self.passwords, statusFunction=s, overwrite=True, destination=folder)
+ success = u.crackPassword(passwords=self.passwords, statusFunction=s, overwrite=True, destination=folder, fullPath=self.getConfig("fullpath"))
except WrongPasswordError:
continue
except CommandError, e: