summaryrefslogtreecommitdiffstats
path: root/module/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins')
-rw-r--r--module/plugins/hoster/FilefactoryCom.py3
-rw-r--r--module/plugins/hoster/UploadingCom.py11
-rw-r--r--module/plugins/internal/SimpleHoster.py11
3 files changed, 15 insertions, 10 deletions
diff --git a/module/plugins/hoster/FilefactoryCom.py b/module/plugins/hoster/FilefactoryCom.py
index 90b844b9f..37987059b 100644
--- a/module/plugins/hoster/FilefactoryCom.py
+++ b/module/plugins/hoster/FilefactoryCom.py
@@ -24,7 +24,7 @@ class FilefactoryCom(SimpleHoster):
__name__ = "FilefactoryCom"
__type__ = "hoster"
__pattern__ = r"https?://(?:www\.)?filefactory\.com/file/(?P<id>[a-zA-Z0-9]+)"
- __version__ = "0.46"
+ __version__ = "0.47"
__description__ = """Filefactory.Com File Download Hoster"""
__author_name__ = ("stickell")
__author_mail__ = ("l.stickell@yahoo.it")
@@ -32,6 +32,7 @@ class FilefactoryCom(SimpleHoster):
FILE_INFO_PATTERN = r'<div id="file_name"[^>]*>\s*<h2>(?P<N>[^<]+)</h2>\s*<div id="file_info">\s*(?P<S>[\d.]+) (?P<U>\w+) uploaded'
DIRECT_LINK_PATTERN = r'<a href="(https?://[^"]+)"[^>]*><i[^>]*></i> Download with FileFactory Premium</a>'
FILE_OFFLINE_PATTERN = r'<h2>File Removed</h2>'
+ PREMIUM_ONLY_PATTERN = r'>Premium Account Required<'
def handleFree(self):
self.html = self.load(self.pyfile.url, decode=True)
diff --git a/module/plugins/hoster/UploadingCom.py b/module/plugins/hoster/UploadingCom.py
index 1da571460..c8ca2169c 100644
--- a/module/plugins/hoster/UploadingCom.py
+++ b/module/plugins/hoster/UploadingCom.py
@@ -1,5 +1,5 @@
-#!/usr/bin/env python
# -*- coding: utf-8 -*-
+
"""
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -19,6 +19,7 @@
import re
from pycurl import HTTPHEADER
+
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, timestamp
from module.common.json_layer import json_loads
@@ -27,14 +28,14 @@ class UploadingCom(SimpleHoster):
__name__ = "UploadingCom"
__type__ = "hoster"
__pattern__ = r"http://(?:www\.)?uploading\.com/files/(?:get/)?(?P<ID>[\w\d]+)"
- __version__ = "0.33"
+ __version__ = "0.34"
__description__ = """Uploading.Com File Download Hoster"""
__author_name__ = ("jeix", "mkaay", "zoidberg")
__author_mail__ = ("jeix@hasnomail.de", "mkaay@mkaay.de", "zoidberg@mujmail.cz")
- FILE_NAME_PATTERN = r'<title>Download (?P<N>.*?) for free on uploading.com</title>'
- FILE_SIZE_PATTERN = r'<span>File size: (?P<S>.*?)</span>'
- FILE_OFFLINE_PATTERN = r'<h2.*?>The requested file is not found</h2>'
+ FILE_NAME_PATTERN = r'id="file_title">(?P<N>.+)</'
+ FILE_SIZE_PATTERN = r'size tip_container">(?P<S>[\d.]+) (?P<U>\w+)<'
+ FILE_OFFLINE_PATTERN = r'Page not found!'
def process(self, pyfile):
# set lang to english
diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py
index 47fded260..46d0a9517 100644
--- a/module/plugins/internal/SimpleHoster.py
+++ b/module/plugins/internal/SimpleHoster.py
@@ -163,7 +163,7 @@ class PluginParseError(Exception):
class SimpleHoster(Hoster):
__name__ = "SimpleHoster"
- __version__ = "0.32"
+ __version__ = "0.33"
__pattern__ = None
__type__ = "hoster"
__description__ = """Base hoster plugin"""
@@ -202,14 +202,17 @@ class SimpleHoster(Hoster):
# Due to a 0.4.9 core bug self.load would keep previous cookies even if overridden by cookies parameter.
# Workaround using getURL. Can be reverted in 0.5 as the cookies bug has been fixed.
self.html = getURL(pyfile.url, decode=not self.SH_BROKEN_ENCODING, cookies=self.SH_COOKIES)
- self.getFileInfo()
+ premium_only = hasattr(self, 'PREMIUM_ONLY_PATTERN') and re.search(self.PREMIUM_ONLY_PATTERN, self.html)
+ if not premium_only: # Usually premium only pages doesn't show the file information
+ self.getFileInfo()
+
if self.premium and (not self.SH_CHECK_TRAFFIC or self.checkTrafficLeft()):
self.handlePremium()
+ elif premium_only:
+ self.fail("This link require a premium account")
else:
# This line is required due to the getURL workaround. Can be removed in 0.5
self.html = self.load(pyfile.url, decode=not self.SH_BROKEN_ENCODING, cookies=self.SH_COOKIES)
- if hasattr(self, 'PREMIUM_ONLY_PATTERN') and re.search(self.PREMIUM_ONLY_PATTERN, self.html):
- self.fail("This link require a premium account")
self.handleFree()
def load(self, url, get={}, post={}, ref=True, cookies=True, just_header=False, decode=False):