diff options
author | fragonib <devnull@localhost> | 2011-06-12 18:24:51 +0200 |
---|---|---|
committer | fragonib <devnull@localhost> | 2011-06-12 18:24:51 +0200 |
commit | 444a1f00a7fa986400095233ba75953de0fe42b8 (patch) | |
tree | 6d234ebf713d3b701069bbda6320271d689e1b38 | |
parent | ul fix (diff) | |
download | pyload-444a1f00a7fa986400095233ba75953de0fe42b8.tar.xz |
RelinkUs, ShareLinksBiz, BitshareCom little improvements
-rw-r--r-- | module/plugins/crypter/RelinkUs.py | 26 | ||||
-rw-r--r-- | module/plugins/crypter/ShareLinksBiz.py | 20 | ||||
-rw-r--r-- | module/plugins/hoster/BitshareCom.py | 20 |
3 files changed, 37 insertions, 29 deletions
diff --git a/module/plugins/crypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py index c2bc6c589..d00e4cc18 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -11,7 +11,7 @@ class RelinkUs(Crypter): __name__ = "RelinkUs" __type__ = "crypter" __pattern__ = r"http://(www\.)?relink.us/(f/|((view|go).php\?id=))(?P<id>.+)" - __version__ = "2.2" + __version__ = "2.3" __description__ = """Relink.us Crypter Plugin""" __author_name__ = ("fragonib") __author_mail__ = ("fragonib[AT]yahoo[DOT]es") @@ -91,17 +91,25 @@ class RelinkUs(Crypter): return html def getPackageNameAndFolder(self): - title_re = r'<td class="top">Title</td><td class="top">\|</td><td><span class="info_view_id"><i>(?P<title>.+)</i></span></td>' - m = re.search(title_re, self.html) - if m is not None: - name = folder = m.group('title') - self.logDebug("Found name [%s] and folder [%s] in package info" % (name, folder)) - return name, folder - else: + # Get title from html + try: + title_re = r'<td class="top">Title</td><td class="top">\|</td><td><span class="info_view_id"><i>(?P<title>.+)</i></span></td>' + title = re.search(title_re, self.html).group('title') + if 'Title deactived by the owner' in title: + title = None + except: + title = None + + # Set name & folder + if title is None: name = self.package.name folder = self.package.folder self.logDebug("Package info not found, defaulting to pyfile name [%s] and folder [%s]" % (name, folder)) - return name, folder + else: + name = folder = title + self.logDebug("Found name [%s] and folder [%s] in package info" % (name, folder)) + + return name, folder def getCipherParams(self): diff --git a/module/plugins/crypter/ShareLinksBiz.py b/module/plugins/crypter/ShareLinksBiz.py index 7676e9cbf..0df26110e 100644 --- a/module/plugins/crypter/ShareLinksBiz.py +++ b/module/plugins/crypter/ShareLinksBiz.py @@ -11,26 +11,24 @@ import re class ShareLinksBiz(Crypter):
__name__ = "ShareLinksBiz"
__type__ = "crypter"
- __pattern__ = r"(http://[\w\.]*?share-links\.biz)/(?P<id>_[0-9a-z]+)(/.*)?"
- __version__ = "1.0"
+ __pattern__ = r"(?P<base>http://[\w\.]*?(share-links|s2l)\.biz)/(?P<id>_?[0-9a-z]+)(/.*)?"
+ __version__ = "1.1"
__description__ = """Share-Links.biz Crypter"""
__author_name__ = ("fragonib")
__author_mail__ = ("fragonib[AT]yahoo[DOT]es")
def setup(self):
- self.html = None
self.baseUrl = None
self.fileId = None
- self.captcha = False
self.package = None
+ self.html = None
+ self.captcha = False
def decrypt(self, pyfile):
# Init
- self.package = pyfile.package()
- self.baseUrl = re.search(self.__pattern__, pyfile.url).group(1)
- self.fileId = re.match(self.__pattern__, pyfile.url).group('id')
+ self.initFile(pyfile)
# Request package
url = self.baseUrl + '/' + self.fileId
@@ -62,6 +60,14 @@ class ShareLinksBiz(Crypter): # Pack
self.packages = [(package_name, package_links, package_folder)]
+ def initFile(self, pyfile):
+ url = pyfile.url
+ if 's2l.biz' in url:
+ url = self.load(url, just_header=True)['location']
+ self.baseUrl = re.search(self.__pattern__, url).group(1)
+ self.fileId = re.match(self.__pattern__, url).group('id')
+ self.package = pyfile.package()
+
def isOnline(self):
if "No usable content was found" in self.html:
self.logDebug("File not found")
diff --git a/module/plugins/hoster/BitshareCom.py b/module/plugins/hoster/BitshareCom.py index ca651c3c7..d48900f51 100644 --- a/module/plugins/hoster/BitshareCom.py +++ b/module/plugins/hoster/BitshareCom.py @@ -45,10 +45,10 @@ class BitshareCom(Hoster): __name__ = "BitshareCom" __type__ = "hoster" __pattern__ = r"http://(www\.)?bitshare\.com/(files/(?P<id1>[a-zA-Z0-9]+)(/(?P<name>.*?)\.html)?|\?f=(?P<id2>[a-zA-Z0-9]+))" - __version__ = "0.4" + __version__ = "0.41" __description__ = """Bitshare.Com File Download Hoster""" - __author_name__ = ("paul", "king", "fragonib") - __author_mail__ = ("", "", "fragonib[AT]yahoo[DOT]es") + __author_name__ = ("paulking", "fragonib") + __author_mail__ = (None, "fragonib[AT]yahoo[DOT]es") HOSTER_DOMAIN = "bitshare.com" FILE_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)''' @@ -78,16 +78,10 @@ class BitshareCom(Hoster): self.offline() # File name - name1 = re.search(BitshareCom.__pattern__, self.pyfile.url) - if name1: - name1 = name1.group('name') - else: - name1 = "" - name2 = re.search(BitshareCom.FILE_INFO_PATTERN, self.html) - if name2: - name2 = name2.group('name') - else: - name2 = "" + m = re.search(BitshareCom.__pattern__, self.pyfile.url) + name1 = m.group('name') if m is not None else None + m = re.search(BitshareCom.FILE_INFO_PATTERN, self.html) + name2 = m.group('name') if m is not None else None self.pyfile.name = max(name1, name2) # Ajax file id |