summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorGravatar fragonib <devnull@localhost> 2010-12-06 16:26:29 +0100
committerGravatar fragonib <devnull@localhost> 2010-12-06 16:26:29 +0100
commit01c071d125edcfecc1c9f87482203aff5f04d083 (patch)
tree331530210f64a731d1e664495679f4ad717876aa /module
parent--status option, improved cli commands (diff)
downloadpyload-01c071d125edcfecc1c9f87482203aff5f04d083.tar.xz
Little fixes
Diffstat (limited to 'module')
-rw-r--r--module/plugins/crypter/LinkSaveIn.py2
-rw-r--r--module/plugins/crypter/NetfolderIn.py18
-rw-r--r--module/plugins/crypter/RelinkUs.py5
-rw-r--r--module/plugins/hoster/OneFichierCom.py17
4 files changed, 16 insertions, 26 deletions
diff --git a/module/plugins/crypter/LinkSaveIn.py b/module/plugins/crypter/LinkSaveIn.py
index d8f401f46..c9621d658 100644
--- a/module/plugins/crypter/LinkSaveIn.py
+++ b/module/plugins/crypter/LinkSaveIn.py
@@ -13,7 +13,7 @@ class LinkSaveIn(Crypter):
__version__ = "1.0"
__description__ = """LinkSave.in Crypter Plugin"""
__author_name__ = ("fragonib")
- __author_mail__ = ("fragonib AT yahoo DOT es")
+ __author_mail__ = ("fragonib[AT]yahoo[DOT]es")
# Constants
_JK_KEY_ = "jk"
diff --git a/module/plugins/crypter/NetfolderIn.py b/module/plugins/crypter/NetfolderIn.py
index ce220d535..510f09396 100644
--- a/module/plugins/crypter/NetfolderIn.py
+++ b/module/plugins/crypter/NetfolderIn.py
@@ -3,12 +3,11 @@
from module.plugins.Crypter import Crypter
import re
-
class NetfolderIn(Crypter):
__name__ = "NetfolderIn"
__type__ = "crypter"
- __pattern__ = r"http://(?:www\.)?netfolder.in/((?P<id1>\w+)/\w+|folder.php\?folder_id=(?P<id2>.+))"
- __version__ = "0.2"
+ __pattern__ = r"http://(?:www\.)?netfolder.in/((?P<id1>\w+)/\w+|folder.php\?folder_id=(?P<id2>\w+))"
+ __version__ = "0.3"
__description__ = """NetFolder Crypter Plugin"""
__author_name__ = ("RaNaN", "fragonib")
__author_mail__ = ("RaNaN@pyload.org", "fragonib[AT]yahoo[DOT]es")
@@ -28,10 +27,7 @@ class NetfolderIn(Crypter):
(package_name, folder_name) = self.getPackageNameAndFolder()
# Get package links
- try:
- package_links = self.getLinks()
- except:
- self.fail("Unable to extract links package")
+ package_links = self.getLinks()
# Set package
self.packages = [(package_name, package_links, folder_name)]
@@ -46,13 +42,12 @@ class NetfolderIn(Crypter):
def submitPassword(self):
-
# Gather data
try:
m = re.match(self.__pattern__, self.pyfile.url)
id = max(m.group('id1'), m.group('id2'))
except AttributeError:
- self.log.debug("RelinkUs: Unable to get package id from url [%s]" % (url))
+ self.log.debug("NetfolderIn: Unable to get package id from url [%s]" % (url))
return
url = "http://netfolder.in/folder.php?folder_id=" + id
password = self.pyfile.package().password
@@ -64,7 +59,7 @@ class NetfolderIn(Crypter):
# Check for invalid password
if '<div class="InPage_Error">' in html:
- self.log.debug("NetfolderIn: Incorrect password, please set right password on Add package form and retry")
+ self.log.debug("NetfolderIn: Incorrect password, please set right password on Edit package form and retry")
return None
return html
@@ -85,6 +80,7 @@ class NetfolderIn(Crypter):
def getLinks(self):
- links = re.findall(r'href="(http://.{0,3}netload\.in/(datei|index.php?id=10&file_id=)[^"]+)', self.html)
+ links = re.findall('href="(http://(?:www\.)?netload\.in/(?:datei|index.php\?.*?file_id=)\w+)', self.html)
links = [x[0] for x in links]
+ self.log.debug("NetfolderIn: Package has %d links" % len(links))
return links \ No newline at end of file
diff --git a/module/plugins/crypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py
index ef00b1183..d122c9dac 100644
--- a/module/plugins/crypter/RelinkUs.py
+++ b/module/plugins/crypter/RelinkUs.py
@@ -7,7 +7,6 @@ import binascii
import re
import urllib
-
class RelinkUs(Crypter):
__name__ = "RelinkUs"
__type__ = "crypter"
@@ -15,7 +14,7 @@ class RelinkUs(Crypter):
__version__ = "2.2"
__description__ = """Relink.us Crypter Plugin"""
__author_name__ = ("fragonib")
- __author_mail__ = ("fragonib AT yahoo DOT es")
+ __author_mail__ = ("fragonib[AT]yahoo[DOT]es")
# Constants
_JK_KEY_ = "jk"
@@ -38,7 +37,7 @@ class RelinkUs(Crypter):
if self.isPasswordProtected():
self.html = self.submitPassword()
if self.html is None:
- self.fail("Incorrect password, please set right password on Add package form and retry")
+ self.fail("Incorrect password, please set right password on Edit package form and retry")
# Get package name and folder
(package_name, folder_name) = self.getPackageNameAndFolder()
diff --git a/module/plugins/hoster/OneFichierCom.py b/module/plugins/hoster/OneFichierCom.py
index ffb89a5f6..a6357ab89 100644
--- a/module/plugins/hoster/OneFichierCom.py
+++ b/module/plugins/hoster/OneFichierCom.py
@@ -40,24 +40,21 @@ class OneFichierCom(Hoster):
r"The file may has been deleted by its owner",
r"Le fichier demandé n'existe pas\.",
r"Il a pu être supprimé par son propriétaire\.")
- expr = '(' + '|'.join(warnings) + ')'
-
- if re.search(expr, self.html) is not None:
+ pattern = '(' + '|'.join(warnings) + ')'
+ if re.search(pattern, self.html) is not None:
return False
return True
def get_file_url(self):
- self.log.debug("OneFichierCom: Getting file URL")
file_url_pattern = r"<br/>\&nbsp;<br/>\&nbsp;<br/>\&nbsp;[\t\n\r ]+<a href=\"(?P<url>http://.*?)\""
m = re.search(file_url_pattern, self.html)
if m is not None:
url = m.group('url')
- self.log.debug("OneFichierCom: File URL [%s]" % url)
+ self.log.debug("OneFichierCom: Got file URL [%s]" % url)
return url
def get_file_name(self):
- self.log.debug("OneFichierCom: Getting file name")
file_name_patterns = (
r"\">(Nom du fichier :|File name :)</th>[\t\r\n ]+<td>(?P<name>.*?)</td>",
r"(>Cliquez ici pour télécharger|>Click here to download) (?P<name>.*?)</a>",
@@ -69,13 +66,11 @@ class OneFichierCom(Hoster):
m = re.search(pattern, self.html)
if m is not None:
name = m.group('name').strip()
- self.log.debug("OneFichierCom: File name [%s]" % name)
+ self.log.debug("OneFichierCom: Got file name [%s]" % name)
return name
def get_file_size(self):
- self.log.debug("OneFichierCom: Getting file size")
- file_size_pattern = r"<th>(Taille :|File size :)</th>[\t\n\r ]+<td>(?P<size>\d*)\s+(?P<units>.*?)</td>"
-
+ file_size_pattern = r"<th>(Taille :|File size :)</th>[\t\n\r ]+<td>(?P<size>\d*)\s+(?P<units>.*?)</td>"
m = re.search(file_size_pattern, self.html)
if m is not None:
size = int(m.group('size'))
@@ -85,5 +80,5 @@ class OneFichierCom(Hoster):
except KeyError:
multiplier = 1
bytes = size * multiplier
- self.log.debug("OneFichierCom: File size [%s] bytes" % bytes)
+ self.log.debug("OneFichierCom: Got file size of [%s] bytes" % bytes)
return bytes \ No newline at end of file