diff options
Diffstat (limited to 'pyload/plugins/hoster/ShareplaceCom.py')
| -rw-r--r-- | pyload/plugins/hoster/ShareplaceCom.py | 19 | 
1 files changed, 13 insertions, 6 deletions
| diff --git a/pyload/plugins/hoster/ShareplaceCom.py b/pyload/plugins/hoster/ShareplaceCom.py index f4ade5760..ec59d061c 100644 --- a/pyload/plugins/hoster/ShareplaceCom.py +++ b/pyload/plugins/hoster/ShareplaceCom.py @@ -8,14 +8,15 @@ from pyload.plugins.base.Hoster import Hoster  class ShareplaceCom(Hoster): -    __name__ = "ShareplaceCom" -    __type__ = "hoster" +    __name__    = "ShareplaceCom" +    __type__    = "hoster"      __version__ = "0.11" -    __pattern__ = r'(http://)?(?:www\.)?shareplace\.(com|org)/\?[a-zA-Z0-9]+' +    __pattern__ = r'(http://)?(?:www\.)?shareplace\.(com|org)/\?\w+'      __description__ = """Shareplace.com hoster plugin""" -    __authors__ = [("ACCakut", None)] +    __license__     = "GPLv3" +    __authors__     = [("ACCakut", None)]      def process(self, pyfile): @@ -23,6 +24,7 @@ class ShareplaceCom(Hoster):          self.prepare()          self.download(self.get_file_url()) +      def prepare(self):          if not self.file_exists():              self.offline() @@ -31,9 +33,10 @@ class ShareplaceCom(Hoster):          wait_time = self.get_waiting_time()          self.setWait(wait_time) -        self.logDebug("%s: Waiting %d seconds." % (self.__name__, wait_time)) +        self.logDebug("Waiting %d seconds." % wait_time)          self.wait() +      def get_waiting_time(self):          if not self.html:              self.download_html() @@ -47,10 +50,12 @@ class ShareplaceCom(Hoster):          return sec +      def download_html(self):          url = re.sub("shareplace.com\/\?", "shareplace.com//index1.php/?a=", self.pyfile.url)          self.html = self.load(url, decode=True) +      def get_file_url(self):          """ returns the absolute downloadable filepath          """ @@ -63,7 +68,8 @@ class ShareplaceCom(Hoster):              self.logDebug("URL: %s" % url)              return url          else: -            self.fail("absolute filepath could not be found. offline? ") +            self.error(_("Absolute filepath not found")) +      def get_file_name(self):          if not self.html: @@ -71,6 +77,7 @@ class ShareplaceCom(Hoster):          return re.search("<title>\s*(.*?)\s*</title>", self.html).group(1) +      def file_exists(self):          """ returns True or False          """ | 
