From caac0ec869eea84e18f3978d47fd0de5e5786757 Mon Sep 17 00:00:00 2001 From: Jeix Date: Sun, 12 Feb 2012 20:15:49 +0100 Subject: putlocker.com plugin beta (only free user) --- module/plugins/hoster/PutlockerCom.py | 126 ++++++++++++++++++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 module/plugins/hoster/PutlockerCom.py (limited to 'module/plugins/hoster/PutlockerCom.py') diff --git a/module/plugins/hoster/PutlockerCom.py b/module/plugins/hoster/PutlockerCom.py new file mode 100644 index 000000000..4de0ca218 --- /dev/null +++ b/module/plugins/hoster/PutlockerCom.py @@ -0,0 +1,126 @@ +# -*- 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 + the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see . + + @author: jeix +""" + +import re +from module.plugins.Hoster import Hoster +from module.network.RequestFactory import getURL + +def getInfo(urls): + result = [] + + for url in urls: + + html = getURL(url) + if re.search(PutlockerCom.PATTERN_OFFLINE, html): + result.append((url, 0, 1, url)) + else: + name = re.search(PutlockerCom.PATTERN_FILENAME_1, html) + if name is None: + name = re.search(PutlockerCom.PATTERN_FILENAME_2, html) + if name is None: + result.append((url, 0, 1, url)) + continue + + name = name.group(1) + + # size = re.search(PutlockerCom.PATTERN_FILESIZE, html) + # if size is None: + # result.append((url, 0, 1, url)) + # continue + + # size = size.group(1) + + result.append((name, 0, 2, url)) + yield result + +class PutlockerCom(Hoster): + __name__ = "PutlockerCom" + __type__ = "hoster" + __pattern__ = r'http://(www\.)?putlocker\.com/(file|embed)/[A-Z0-9]+' + __version__ = "0.1" + __description__ = """Putlocker.Com""" + __author_name__ = ("jeix") + + PATTERN_OFFLINE = r"This file doesn't exist, or has been removed." + PATTERN_FILENAME_1 = "site-content.*?

(.*?)", self.html) + # if self.hash is None: + # self.fail("%s: Plugin broken." % self.__name__) + + self.param = "hash=" + self.hash.group(1) + "&confirm=Continue+as+Free+User" + self.html2 = self.load(self.pyfile.url, post=self.param) + if ">You have exceeded the daily stream limit for your country\\. You can wait until tomorrow" in self.html2 or "(>This content server has been temporarily disabled for upgrades|Try again soon\\. You can still download it below\\.<)" in self.html2: + self.waittime = 2 * 60 * 60 + self.retry(wait_time=self.waittime, reason="Waiting %s seconds" % self.waittime) + + self.link = re.search("Tired of ads and waiting\\? Go Pro\\![\t\n\rn ]+[\t\n\rn ]+