# -*- coding: utf-8 -*-
import base64
import binascii
import re
from Crypto.Cipher import AES
from module.plugins.Crypter import Crypter
class ShareLinksBiz(Crypter):
__name__ = "ShareLinksBiz"
__type__ = "crypter"
__pattern__ = r"(?Phttp://[\w\.]*?(share-links|s2l)\.biz)/(?P_?[0-9a-z]+)(/.*)?"
__version__ = "1.13"
__description__ = """Share-Links.biz Crypter"""
__author_name__ = ("fragonib")
__author_mail__ = ("fragonib[AT]yahoo[DOT]es")
def setup(self):
self.baseUrl = None
self.fileId = None
self.package = None
self.html = None
self.captcha = False
def decrypt(self, pyfile):
# Init
self.initFile(pyfile)
# Request package
url = self.baseUrl + '/' + self.fileId
self.html = self.load(url, decode=True)
# Unblock server (load all images)
self.unblockServer()
# Check for protection
if self.isPasswordProtected():
self.unlockPasswordProtection()
self.handleErrors()
if self.isCaptchaProtected():
self.captcha = True
self.unlockCaptchaProtection()
self.handleErrors()
# Extract package links
package_links = []
package_links.extend(self.handleWebLinks())
package_links.extend(self.handleContainers())
package_links.extend(self.handleCNL2())
package_links = set(package_links)
# Get package info
package_name, package_folder = self.getPackageInfo()
# 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")
return False
return True
def isPasswordProtected(self):
if re.search(r'''''', self.html):
self.logDebug("Links are protected")
return True
return False
def isCaptchaProtected(self):
if '