diff options
| -rw-r--r-- | module/config/plugin_default.xml | 5 | ||||
| -rw-r--r-- | module/plugins/hoster/HotfileCom.py | 20 | 
2 files changed, 20 insertions, 5 deletions
| diff --git a/module/config/plugin_default.xml b/module/config/plugin_default.xml index c1261e338..d9105d5d4 100644 --- a/module/config/plugin_default.xml +++ b/module/config/plugin_default.xml @@ -21,6 +21,11 @@          <username></username>          <password></password>      </ShareonlineBiz> +    <HotfileCom> +        <premium>False</premium> +        <username></username> +        <password></password> +    </HotfileCom>      <YoutubeCom>          <quality>hd</quality><!-- hd: high definition, hq: high quality, sd: standard definition -->      </YoutubeCom> diff --git a/module/plugins/hoster/HotfileCom.py b/module/plugins/hoster/HotfileCom.py index aef761da7..5fa05e7f6 100644 --- a/module/plugins/hoster/HotfileCom.py +++ b/module/plugins/hoster/HotfileCom.py @@ -43,6 +43,10 @@ class HotfileCom(Plugin):              return False          pyfile.status.filename = self.get_file_name() + +        if self.config['premium']: +            pyfile.status.url = self.get_file_url() +            return True          self.get_wait_time()          pyfile.status.waituntil = self.time_plus_wait @@ -54,18 +58,24 @@ class HotfileCom(Plugin):          return True      def download_html(self): +        if self.config['premium']: +            self.req.add_auth(self.config['username'], self.config['password'])          self.url = self.parent.url          self.html[0] = self.req.load(self.url, cookies=True)      def get_file_url(self): -        form_content = re.search(r"<form style=.*(\n<.*>\s*)*?\n<tr>", self.html[0]).group(0) -        form_posts = re.findall(r"<input\stype=hidden\sname=(\S*)\svalue=(\S*)>", form_content) -        self.html[1] = self.req.load(self.url, post=form_posts, cookies=True) -        file_url = re.search("a href=\"(http://hotfile\.com/get/\S*?)\"", self.html[1]).group(1) +        if self.config['premium']: +            file_url_pattern = r'<td><a href="(http://hotfile.com/get/.+?)" class="click_download">' +            file_url = re.search(file_url_pattern, self.html[0]).group(1) +        else: +            form_content = re.search(r"<form style=.*(\n<.*>\s*)*?\n<tr>", self.html[0]).group(0) +            form_posts = re.findall(r"<input\stype=hidden\sname=(\S*)\svalue=(\S*)>", form_content) +            self.html[1] = self.req.load(self.url, post=form_posts, cookies=True) +            file_url = re.search("a href=\"(http://hotfile\.com/get/\S*?)\"", self.html[1]).group(1)          return file_url      def get_file_name(self): -        file_name = re.search(':</strong> (.+) <span>|</span>', self.html[0]).group(1) +        file_name = re.search(r':</strong> (.+?) <span>\|</span>', self.html[0]).group(1)          return file_name      def file_exists(self): | 
