diff options
Diffstat (limited to 'pyload/plugins/hoster/XFileSharingPro.py')
-rw-r--r-- | pyload/plugins/hoster/XFileSharingPro.py | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/pyload/plugins/hoster/XFileSharingPro.py b/pyload/plugins/hoster/XFileSharingPro.py index e37afc243..d6fb31307 100644 --- a/pyload/plugins/hoster/XFileSharingPro.py +++ b/pyload/plugins/hoster/XFileSharingPro.py @@ -24,6 +24,7 @@ from pycurl import FOLLOWLOCATION, LOW_SPEED_TIME from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, PluginParseError from module.plugins.internal.CaptchaService import ReCaptcha, SolveMedia from module.utils import html_unescape +from module.network.RequestFactory import getURL class XFileSharingPro(SimpleHoster): @@ -35,7 +36,7 @@ class XFileSharingPro(SimpleHoster): __name__ = "XFileSharingPro" __type__ = "hoster" __pattern__ = r"^unmatchable$" - __version__ = "0.21" + __version__ = "0.23" __description__ = """XFileSharingPro common hoster base""" __author_name__ = ("zoidberg", "stickell") __author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it") @@ -73,18 +74,20 @@ class XFileSharingPro(SimpleHoster): else: self.fail("Only premium users can download from other hosters with %s" % self.HOSTER_NAME) else: + try: + # Due to a 0.4.9 core bug self.load would use cookies even if + # cookies=False. Workaround using getURL to avoid cookies. + # Can be reverted in 0.5 as the cookies bug has been fixed. + self.html = getURL(pyfile.url, decode=True) + self.file_info = self.getFileInfo() + except PluginParseError: + self.file_info = None + self.location = self.getDirectDownloadLink() - # self.load will fail because pyfile.url is a direct link to the download if self.location - # is set so it will be executed only if pyfile.url is not a direct link (location not set). - if not self.location: - try: - self.html = self.load(pyfile.url, cookies=False, decode=True) - self.file_info = self.getFileInfo() - except PluginParseError: - self.file_info = None - pyfile.name = html_unescape(unquote(urlparse( - self.location if self.location else pyfile.url).path.split("/")[-1])) + if not self.file_info: + pyfile.name = html_unescape(unquote(urlparse( + self.location if self.location else pyfile.url).path.split("/")[-1])) if self.location: self.startDownload(self.location) |