summaryrefslogtreecommitdiffstats
path: root/pyload/plugins/hoster/FileshareInUa.py
diff options
context:
space:
mode:
authorGravatar Stefano <l.stickell@yahoo.it> 2013-07-22 20:50:34 +0200
committerGravatar Stefano <l.stickell@yahoo.it> 2013-07-22 21:20:06 +0200
commitaaaf5a4cddec894aacd7400c59a9f2f5e710362f (patch)
tree9d9e89aff86598b3ffcc86117abd554b193e28b5 /pyload/plugins/hoster/FileshareInUa.py
parentimplemented media type filter (diff)
downloadpyload-aaaf5a4cddec894aacd7400c59a9f2f5e710362f.tar.xz
Fixed PEP 8 violations in Hosters
(cherry picked from commit 2edeee0532ec6d6b4b26fd045a5971f67ca455da) Conflicts: pyload/plugins/hoster/BasePlugin.py pyload/plugins/hoster/MultishareCz.py pyload/plugins/hoster/NetloadIn.py pyload/plugins/hoster/PremiumizeMe.py pyload/plugins/hoster/RapidshareCom.py
Diffstat (limited to 'pyload/plugins/hoster/FileshareInUa.py')
-rw-r--r--pyload/plugins/hoster/FileshareInUa.py35
1 files changed, 18 insertions, 17 deletions
diff --git a/pyload/plugins/hoster/FileshareInUa.py b/pyload/plugins/hoster/FileshareInUa.py
index 9700b2d0a..d3724f728 100644
--- a/pyload/plugins/hoster/FileshareInUa.py
+++ b/pyload/plugins/hoster/FileshareInUa.py
@@ -1,9 +1,9 @@
-from urllib import urlencode
import re
from module.plugins.Hoster import Hoster
from module.network.RequestFactory import getURL
from module.utils import parseFileSize
+
class FileshareInUa(Hoster):
__name__ = "FileshareInUa"
__type__ = "hoster"
@@ -12,12 +12,12 @@ class FileshareInUa(Hoster):
__description__ = """fileshare.in.ua hoster plugin"""
__author_name__ = ("fwannmacher")
__author_mail__ = ("felipe@warhammerproject.com")
-
+
HOSTER_NAME = "fileshare.in.ua"
PATTERN_FILENAME = r'<h3 class="b-filename">(.*?)</h3>'
PATTERN_FILESIZE = r'<b class="b-filesize">(.*?)</b>'
PATTERN_OFFLINE = "This file doesn't exist, or has been removed."
-
+
def setup(self):
self.resumeDownload = True
self.multiDL = True
@@ -28,51 +28,52 @@ class FileshareInUa(Hoster):
if not self._checkOnline():
self.offline()
-
+
self.pyfile.name = self._getName()
-
+
self.link = self._getLink()
-
+
if not self.link.startswith('http://'):
self.link = "http://fileshare.in.ua" + self.link
- self.download(self.link)
+ self.download(self.link)
def _checkOnline(self):
if re.search(self.PATTERN_OFFLINE, self.html):
return False
else:
return True
-
+
def _getName(self):
name = re.search(self.PATTERN_FILENAME, self.html)
if name is None:
self.fail("%s: Plugin broken." % self.__name__)
return name.group(1)
-
- def _getLink(self):
+
+ def _getLink(self):
return re.search("<a href=\"(/get/.+)\" class=\"b-button m-blue m-big\" >", self.html).group(1)
+
def getInfo(urls):
result = []
-
- for url in urls:
+
+ for url in urls:
html = getURL(url)
-
+
if re.search(FileshareInUa.PATTERN_OFFLINE, html):
result.append((url, 0, 1, url))
else:
name = re.search(FileshareInUa.PATTERN_FILENAME, html)
-
+
if name is None:
result.append((url, 0, 1, url))
continue
-
+
name = name.group(1)
size = re.search(FileshareInUa.PATTERN_FILESIZE, html)
- size = parseFileSize(size.group(1))
-
+ size = parseFileSize(size.group(1))
+
result.append((name, size, 3, url))
yield result