summaryrefslogtreecommitdiffstats
path: root/pyload/plugins/hook/XFileSharingPro.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-11-13 23:47:36 +0100
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-11-13 23:47:36 +0100
commitbdfa8104065831bf0eb2f6a022552e8de725ed47 (patch)
tree4a43864e1bb257c7737a765d62899244b825a859 /pyload/plugins/hook/XFileSharingPro.py
parent[themes] Tiny code cosmetics (diff)
parent[Plugin] Some fixes by rlindner81 (diff)
downloadpyload-bdfa8104065831bf0eb2f6a022552e8de725ed47.tar.xz
Merge branch 'stable' into 0.4.10
Conflicts: module/plugins/accounts/MegaRapidCz.py module/plugins/accounts/ShareRapidCom.py module/plugins/crypter/HotfileComFolder.py module/plugins/crypter/HotfileFolderCom.py module/plugins/hoster/Keep2shareCC.py module/plugins/hoster/Keep2shareCc.py module/plugins/hoster/MegaCoNz.py module/plugins/hoster/MegaNz.py module/plugins/hoster/MegaRapidCz.py module/plugins/hoster/ShareRapidCom.py module/plugins/internal/CaptchaService.py pyload/api/__init__.py pyload/manager/AccountManager.py pyload/manager/PluginManager.py pyload/manager/thread/PluginThread.py pyload/network/HTTPRequest.py pyload/network/XDCCRequest.py pyload/plugins/Plugin.py pyload/plugins/account/BillionuploadsCom.py pyload/plugins/account/CramitIn.py pyload/plugins/account/EasybytezCom.py pyload/plugins/account/FastshareCz.py pyload/plugins/account/File4safeCom.py pyload/plugins/account/FileParadoxIn.py pyload/plugins/account/FileomCom.py pyload/plugins/account/FilerNet.py pyload/plugins/account/FilerioCom.py pyload/plugins/account/FourSharedCom.py pyload/plugins/account/Ftp.py pyload/plugins/account/Http.py pyload/plugins/account/HugefilesNet.py pyload/plugins/account/HundredEightyUploadCom.py pyload/plugins/account/LomafileCom.py pyload/plugins/account/MovReelCom.py pyload/plugins/account/MultishareCz.py pyload/plugins/account/MyfastfileCom.py pyload/plugins/account/NosuploadCom.py pyload/plugins/account/NovafileCom.py pyload/plugins/account/QuickshareCz.py pyload/plugins/account/RarefileNet.py pyload/plugins/account/RyushareCom.py pyload/plugins/account/SecureUploadEu.py pyload/plugins/account/SendmywayCom.py pyload/plugins/account/ShareRapidCom.py pyload/plugins/account/StahnuTo.py pyload/plugins/account/StreamcloudEu.py pyload/plugins/account/TusfilesNet.py pyload/plugins/account/UploadingCom.py pyload/plugins/account/UptoboxCom.py pyload/plugins/account/VidPlayNet.py pyload/plugins/addon/Checksum.py pyload/plugins/addon/ClickAndLoad.py pyload/plugins/addon/DeleteFinished.py pyload/plugins/addon/DownloadScheduler.py pyload/plugins/addon/ExternalScripts.py pyload/plugins/addon/ExtractArchive.py pyload/plugins/addon/HotFolder.py pyload/plugins/addon/IRCInterface.py pyload/plugins/addon/MergeFiles.py pyload/plugins/addon/MultiHome.py pyload/plugins/addon/RestartFailed.py pyload/plugins/addon/UnSkipOnFail.py pyload/plugins/addon/WindowsPhoneToastNotify.py pyload/plugins/addon/XMPPInterface.py pyload/plugins/base/Container.py pyload/plugins/base/Crypter.py pyload/plugins/base/Hook.py pyload/plugins/base/OCR.py pyload/plugins/container/RSDF.py pyload/plugins/crypter/DuploadOrgFolder.py pyload/plugins/crypter/EasybytezComFolder.py pyload/plugins/crypter/FiredriveComFolder.py pyload/plugins/crypter/HotfileFolderCom.py pyload/plugins/crypter/LinkSaveIn.py pyload/plugins/crypter/MultiuploadCom.py pyload/plugins/crypter/ShareRapidComFolder.py pyload/plugins/crypter/TusfilesNetFolder.py pyload/plugins/crypter/UploadableChFolder.py pyload/plugins/crypter/UploadedToFolder.py pyload/plugins/hook/Captcha9kw.py pyload/plugins/hook/MyfastfileCom.py pyload/plugins/hoster/BillionuploadsCom.py pyload/plugins/hoster/CramitIn.py pyload/plugins/hoster/EasybytezCom.py pyload/plugins/hoster/File4safeCom.py pyload/plugins/hoster/FileParadoxIn.py pyload/plugins/hoster/FilefactoryCom.py pyload/plugins/hoster/FileomCom.py pyload/plugins/hoster/FilerioCom.py pyload/plugins/hoster/FileshareInUa.py pyload/plugins/hoster/FiredriveCom.py pyload/plugins/hoster/Ftp.py pyload/plugins/hoster/HugefilesNet.py pyload/plugins/hoster/HundredEightyUploadCom.py pyload/plugins/hoster/Keep2shareCC.py pyload/plugins/hoster/LoadTo.py pyload/plugins/hoster/LomafileCom.py pyload/plugins/hoster/MegaNz.py pyload/plugins/hoster/MegacrypterCom.py pyload/plugins/hoster/MovReelCom.py pyload/plugins/hoster/MyvideoDe.py pyload/plugins/hoster/NosuploadCom.py pyload/plugins/hoster/NovafileCom.py pyload/plugins/hoster/PandaPlaNet.py pyload/plugins/hoster/PremiumTo.py pyload/plugins/hoster/RarefileNet.py pyload/plugins/hoster/RyushareCom.py pyload/plugins/hoster/SecureUploadEu.py pyload/plugins/hoster/SendmywayCom.py pyload/plugins/hoster/ShareRapidCom.py pyload/plugins/hoster/SockshareCom.py pyload/plugins/hoster/StreamcloudEu.py pyload/plugins/hoster/TurbobitNet.py pyload/plugins/hoster/TusfilesNet.py pyload/plugins/hoster/UptoboxCom.py pyload/plugins/hoster/VidPlayNet.py pyload/plugins/hoster/WebshareCz.py pyload/plugins/internal/DeadCrypter.py pyload/plugins/internal/DeadHoster.py pyload/plugins/internal/MultiHoster.py pyload/plugins/internal/SimpleCrypter.py pyload/plugins/internal/SimpleHoster.py pyload/plugins/internal/UpdateManager.py pyload/plugins/internal/XFSPAccount.py pyload/plugins/internal/XFSPHoster.py pyload/utils/__init__.py pyload/utils/packagetools.py pyload/webui/app/cnl.py
Diffstat (limited to 'pyload/plugins/hook/XFileSharingPro.py')
-rw-r--r--pyload/plugins/hook/XFileSharingPro.py135
1 files changed, 77 insertions, 58 deletions
diff --git a/pyload/plugins/hook/XFileSharingPro.py b/pyload/plugins/hook/XFileSharingPro.py
index d9ccda796..3f70f88f3 100644
--- a/pyload/plugins/hook/XFileSharingPro.py
+++ b/pyload/plugins/hook/XFileSharingPro.py
@@ -6,17 +6,42 @@ from pyload.plugins.base.Hook import Hook
class XFileSharingPro(Hook):
- __name__ = "XFileSharingPro"
- __type__ = "hook"
- __version__ = "0.12"
+ __name__ = "XFileSharingPro"
+ __type__ = "hook"
+ __version__ = "0.22"
__config__ = [("activated", "bool", "Activated", True),
- ("load_default", "bool", "Include default (built-in) hoster list", True),
- ("include_hosters", "str", "Include hosters (comma separated)", ""),
- ("exclude_hosters", "str", "Exclude hosters (comma separated)", "")]
+ ("use_hoster_list", "bool", "Load listed hosters only", False),
+ ("use_crypter_list", "bool", "Load listed crypters only", False),
+ ("use_builtin_list", "bool", "Load built-in plugin list", True),
+ ("hoster_list", "str", "Hoster list (comma separated)", ""),
+ ("crypter_list", "str", "Crypter list (comma separated)", "")]
- __description__ = """XFileSharingPro hook plugin"""
- __authors__ = [("zoidberg", "zoidberg@mujmail.cz")]
+ __description__ = """Load XFileSharingPro based hosters and crypter which don't need a own plugin to run"""
+ __license__ = "GPLv3"
+ __authors__ = [("Walter Purcaro", "vuolter@gmail.com")]
+
+
+ # event_list = ["pluginConfigChanged"]
+ regexp = {'hoster' : (r'https?://(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:embed-)?\w{12}',
+ r'https?://(?:[^/]+\.)?(%s)/(?:embed-)?\w{12}\W?'),
+ 'crypter': (r'https?://(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:user|folder)s?/\w+',
+ r'https?://(?:[^/]+\.)?(%s)/(?:user|folder)s?/\w+')}
+
+ HOSTER_LIST = [#WORKING HOSTERS:
+ "eyesfile.ca", "file4safe.com", "fileband.com", "filedwon.com", "filevice.com", "hostingbulk.com",
+ "linestorage.com", "ravishare.com", "sharesix.com", "thefile.me", "verzend.be", "xvidstage.com",
+ #NOT TESTED:
+ "101shared.com", "4upfiles.com", "filemaze.ws", "filenuke.com", "linkzhost.com", "mightyupload.com",
+ "rockdizfile.com", "sharebeast.com", "sharerepo.com", "shareswift.com", "uploadbaz.com", "uploadc.com",
+ "vidbull.com", "zalaa.com", "zomgupload.com",
+ #NOT WORKING:
+ "amonshare.com", "banicrazy.info", "boosterking.com", "host4desi.com", "laoupload.com", "rd-fs.com"]
+ CRYPTER_LIST = []
+
+
+ # def pluginConfigChanged(self.__name__, plugin, name, value):
+ # self.loadPattern()
def coreReady(self):
@@ -24,56 +49,50 @@ class XFileSharingPro(Hook):
def loadPattern(self):
- hoster_list = self.getConfigSet('include_hosters')
- exclude_list = self.getConfigSet('exclude_hosters')
-
- if self.getConfig('load_default'):
- hoster_list |= set((
- #WORKING HOSTERS:
- "aieshare.com", "asixfiles.com", "banashare.com", "cyberlocker.ch", "eyesfile.co", "eyesfile.com",
- "fileband.com", "filedwon.com", "filedownloads.org", "hipfile.com", "kingsupload.com", "mlfat4arab.com",
- "netuploaded.com", "odsiebie.pl", "q4share.com", "ravishare.com", "uptobox.com", "verzend.be",
- "xvidstage.com", "thefile.me", "sharesix.com", "hostingbulk.com",
- #NOT TESTED:
- "bebasupload.com", "boosterking.com", "divxme.com", "filevelocity.com", "glumbouploads.com",
- "grupload.com", "heftyfile.com", "host4desi.com", "laoupload.com", "linkzhost.com", "movreel.com",
- "rockdizfile.com", "limfile.com", "share76.com", "sharebeast.com", "sharehut.com", "sharerun.com",
- "shareswift.com", "sharingonline.com", "6ybh-upload.com", "skipfile.com", "spaadyshare.com",
- "space4file.com", "uploadbaz.com", "uploadc.com", "uploaddot.com", "uploadfloor.com", "uploadic.com",
- "uploadville.com", "vidbull.com", "zalaa.com", "zomgupload.com", "kupload.org", "movbay.org",
- "multishare.org", "omegave.org", "toucansharing.org", "uflinq.org", "banicrazy.info", "flowhot.info",
- "upbrasil.info", "shareyourfilez.biz", "bzlink.us", "cloudcache.cc", "fileserver.cc", "farshare.to",
- "filemaze.ws", "filehost.ws", "filestock.ru", "moidisk.ru", "4up.im", "100shared.com", "sharesix.com",
- "thefile.me", "filenuke.com", "sharerepo.com", "mightyupload.com",
- #WRONG FILE NAME:
- "sendmyway.com", "upchi.co.il",
- #NOT WORKING:
- "amonshare.com", "imageporter.com", "file4safe.com",
- #DOWN OR BROKEN:
- "ddlanime.com", "fileforth.com", "loombo.com", "goldfile.eu", "putshare.com"
- ))
-
- hoster_list -= (exclude_list)
- hoster_list -= set(('', u''))
-
- if not hoster_list:
- self.unload()
- return
-
- regexp = r"http://(?:[^/]*\.)?(%s)/(?:embed-)?\w{12}" % ("|".join(sorted(hoster_list)).replace('.', '\.'))
-
- dict = self.core.pluginManager.hosterPlugins['XFileSharingPro']
- dict['pattern'] = regexp
- dict['re'] = re.compile(regexp)
- self.logDebug("Pattern loaded - handling %d hosters" % len(hoster_list))
-
-
- def getConfigSet(self, option):
- s = self.getConfig(option).lower().replace('|', ',').replace(';', ',')
- return set([x.strip() for x in s.split(',')])
+ use_builtin_list = self.getConfig('use_builtin_list')
+ for type, plugin in (("hoster", "XFileSharingPro"),
+ ("crypter", "XFileSharingProFolder")):
+ every_plugin = not self.getConfig("use_%s_list" % type)
- def unload(self):
- dict = self.core.pluginManager.hosterPlugins['XFileSharingPro']
+ if every_plugin:
+ self.logInfo(_("Handling any %s I can!") % type)
+ pattern = self.regexp[type][0]
+ else:
+ s = self.getConfig('%s_list' % type).replace('\\', '').replace('|', ',').replace(';', ',').lower()
+ plugin_list = set([x.strip() for x in s.split(',')])
+
+ if use_builtin_list:
+ plugin_list |= set([x.lower() for x in getattr(self, "%s_LIST" % type.upper())])
+
+ plugin_list -= set(('', u''))
+
+ if not plugin_list:
+ self.logInfo(_("No %s to handle") % type)
+ self._unload(type, plugin)
+ return
+
+ match_list = '|'.join(sorted(plugin_list))
+
+ len_match_list = len(plugin_list)
+ self.logInfo(_("Handling %d %s%s: %s") % (len_match_list, type, "" if len_match_list is 1 else "s", match_list.replace('|', ', ')))
+
+ pattern = self.regexp[type][1] % match_list.replace('.', '\.')
+
+ dict = self.core.pluginManager.plugins[type][plugin]
+ dict['pattern'] = pattern
+ dict['re'] = re.compile(pattern)
+
+ self.logDebug("Loaded %s pattern: %s" % (type, pattern))
+
+
+ def _unload(self, type, plugin):
+ dict = self.core.pluginManager.plugins[type][plugin]
dict['pattern'] = r'^unmatchable$'
- dict['re'] = re.compile(r'^unmatchable$')
+ dict['re'] = re.compile(dict['pattern'])
+
+
+ def unload(self):
+ for type, plugin in (("hoster", "XFileSharingPro"),
+ ("crypter", "XFileSharingProFolder")):
+ self._unload(type, plugin)