summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-03-07 15:31:20 +0100
committerGravatar Stefano <l.stickell@yahoo.it> 2014-04-21 17:02:32 +0200
commitbf935de30be4a3b407ad4443f6445386dfacda21 (patch)
tree21cb15d7974bc8d7221be08bba46af048b3ca843
parentMerge pull request #535 from vuolter/s/mark_dead (diff)
downloadpyload-bf935de30be4a3b407ad4443f6445386dfacda21.tar.xz
PutlockerCom (Firedrive now) and SockshareCom updated.
Merged #515 Fixed: #501 (cherry picked from commit 171af764df8cbd54e869f0a5e375e8292fc2cfec)
-rw-r--r--pyload/plugins/hoster/PutlockerCom.py100
-rw-r--r--pyload/plugins/hoster/SockshareCom.py110
2 files changed, 116 insertions, 94 deletions
diff --git a/pyload/plugins/hoster/PutlockerCom.py b/pyload/plugins/hoster/PutlockerCom.py
index afe084028..002783bfd 100644
--- a/pyload/plugins/hoster/PutlockerCom.py
+++ b/pyload/plugins/hoster/PutlockerCom.py
@@ -1,96 +1,54 @@
# -*- 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 <http://www.gnu.org/licenses/>.
-
- @author: jeix
-"""
+###############################################################################
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero 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 Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+# @author: Walter Purcaro
+###############################################################################
import re
-from os import rename
-from module.plugins.internal.SimpleHoster import SimpleHoster
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class PutlockerCom(SimpleHoster):
__name__ = "PutlockerCom"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?putlocker\.com/(mobile/)?(file|embed)/(?P<ID>[a-zA-Z0-9]+)'
- __version__ = "0.32"
- __description__ = """Putlocker.Com"""
- __author_name__ = ("jeix", "stickell", "Walter Purcaro")
- __author_mail__ = ("", "l.stickell@yahoo.it", "vuolter@gmail.com")
+ __pattern__ = r'https?://(?:www\.)?(firedrive|putlocker)\.com/(mobile/)?(file|embed)/(?P<ID>\w+)'
+ __version__ = "0.33"
+ __description__ = """Firedrive.com hoster plugin"""
+ __author_name__ = "Walter Purcaro"
+ __author_mail__ = "vuolter@gmail.com"
- FILE_OFFLINE_PATTERN = r"This file doesn't exist, or has been removed."
- FILE_INFO_PATTERN = r'site-content">\s*<h1>(?P<N>.+)<strong>\( (?P<S>[^)]+) \)</strong></h1>'
+ FILE_NAME_PATTERN = r'<b>Name:</b> (?P<N>.+) <br>'
+ FILE_SIZE_PATTERN = r'<b>Size:</b> (?P<S>[\d.]+) (?P<U>[a-zA-Z]+) <br>'
+ FILE_OFFLINE_PATTERN = r"<div class=\"sad_face_image\">"
- FILE_URL_REPLACEMENTS = [(__pattern__, r'http://www.putlocker.com/file/\g<ID>')]
- HOSTER_NAME = "putlocker.com"
+ FILE_URL_REPLACEMENTS = [(__pattern__, r'http://www.firedrive.com/file/\g<ID>')]
def setup(self):
self.multiDL = self.resumeDownload = True
self.chunkLimit = -1
def handleFree(self):
- name = self.pyfile.name
link = self._getLink()
self.logDebug("Direct link: " + link)
self.download(link, disposition=True)
- self.processName(name)
def _getLink(self):
- hash_data = re.search(r'<input type="hidden" value="([a-z0-9]+)" name="hash">', self.html)
- if not hash_data:
- self.parseError('Unable to detect hash')
-
- post_data = {"hash": hash_data.group(1), "confirm": "Continue+as+Free+User"}
- self.html = self.load(self.pyfile.url, post=post_data)
- if (">You have exceeded the daily stream limit for your country\\. You can wait until tomorrow" in self.html or
- "(>This content server has been temporarily disabled for upgrades|Try again soon\\. You can still download it below\\.<)" in self.html):
- self.retry(wait_time=60 * 60 * 2, reason="Download limit exceeded or server disabled") # 2 hours wait
-
- patterns = (r'(/get_file\.php\?id=[A-Z0-9]+&key=[a-zA-Z0-9=]+&original=1)',
- r'(/get_file\.php\?download=[A-Z0-9]+&key=[a-z0-9]+)',
- r'(/get_file\.php\?download=[A-Z0-9]+&key=[a-z0-9]+&original=1)',
- r'<a href="/gopro\.php">Tired of ads and waiting\? Go Pro!</a>[\t\n\rn ]+</div>[\t\n\rn ]+<a href="(/.*?)"')
- for pattern in patterns:
- link = re.search(pattern, self.html)
- if link:
- break
- else:
- link = re.search(r"playlist: '(/get_file\.php\?stream=[a-zA-Z0-9=]+)'", self.html)
- if link:
- self.html = self.load("http://www.%s%s" % (self.HOSTER_NAME, link.group(1)))
- link = re.search(r'media:content url="(http://.*?)"', self.html)
- if not link:
- pattern = "\"(http://media\\-b\\d+\\.%s\\.%s/download/\\d+/.*?)\"" % self.HOSTER_NAME.rsplit(".")
- link = re.search(pattern, self.html)
- else:
- self.parseError('Unable to detect a download link')
+ self.html = self.load(self.pyfile.url, post={"confirm": re.search(r'name="confirm" value="(.*)"', self.html).group(1)})
+ return re.search(r'<a href="(https?://dl\.firedrive\.com/.*?)"', self.html).group(1)
- link = link.group(1).replace("&amp;", "&")
- if link.startswith("http://"):
- return link
- else:
- return "http://www.%s%s" % (self.HOSTER_NAME, link)
- def processName(self, name_old):
- name = self.pyfile.name
- if name <= name_old:
- return
- name_new = re.sub(r'\.[^.]+$', "", name_old) + name[len(name_old):]
- filename = self.lastDownload
- self.pyfile.name = name_new
- rename(filename, filename.rsplit(name)[0] + name_new)
- self.logInfo("%(name)s renamed to %(newname)s" % {"name": name, "newname": name_new})
+getInfo = create_getInfo(PutlockerCom)
diff --git a/pyload/plugins/hoster/SockshareCom.py b/pyload/plugins/hoster/SockshareCom.py
index b2635d8bc..fd0e5aa91 100644
--- a/pyload/plugins/hoster/SockshareCom.py
+++ b/pyload/plugins/hoster/SockshareCom.py
@@ -1,33 +1,97 @@
# -*- 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 free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero 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 Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+# @author: Walter Purcaro
+###############################################################################
- 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.
+import re
+from os import rename
- You should have received a copy of the GNU General Public License
- along with this program; if not, see <http://www.gnu.org/licenses/>.
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
- @author: Walter Purcaro
-"""
-from module.plugins.hoster.PutlockerCom import PutlockerCom
-
-
-class SockshareCom(PutlockerCom):
+class SockshareCom(SimpleHoster):
__name__ = "SockshareCom"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?sockshare\.com/(mobile/)?(file|embed)/(?P<ID>[A-Z0-9]+)'
- __version__ = "0.01"
- __description__ = """Sockshare.Com"""
- __author_name__ = ("Walter Purcaro")
- __author_mail__ = ("vuolter@gmail.com")
+ __pattern__ = r'http://(?:www\.)?sockshare\.com/(mobile/)?(file|embed)/(?P<ID>\w+)'
+ __version__ = "0.02"
+ __description__ = """Sockshare.com hoster plugin"""
+ __author_name__ = ("jeix", "stickell", "Walter Purcaro")
+ __author_mail__ = ("", "l.stickell@yahoo.it", "vuolter@gmail.com")
+
+ FILE_INFO_PATTERN = r'site-content">\s*<h1>(?P<N>.+)<strong>\( (?P<S>[^)]+) \)</strong></h1>'
+ FILE_OFFLINE_PATTERN = r'>This file doesn\'t exist, or has been removed.<'
FILE_URL_REPLACEMENTS = [(__pattern__, r'http://www.sockshare.com/file/\g<ID>')]
- HOSTER_NAME = "sockshare.com"
+
+ def setup(self):
+ self.multiDL = self.resumeDownload = True
+ self.chunkLimit = -1
+
+ def handleFree(self):
+ name = self.pyfile.name
+ link = self._getLink()
+ self.logDebug("Direct link: " + link)
+ self.download(link, disposition=True)
+ self.processName(name)
+
+ def _getLink(self):
+ hash_data = re.search(r'<input type="hidden" value="([a-z0-9]+)" name="hash">', self.html)
+ if not hash_data:
+ self.parseError("Unable to detect hash")
+
+ post_data = {"hash": hash_data.group(1), "confirm": "Continue+as+Free+User"}
+ self.html = self.load(self.pyfile.url, post=post_data)
+ if (">You have exceeded the daily stream limit for your country\\. You can wait until tomorrow" in self.html or
+ "(>This content server has been temporarily disabled for upgrades|Try again soon\\. You can still download it below\\.<)" in self.html):
+ self.retry(wait_time=60 * 60 * 2, reason="Download limit exceeded or server disabled") # 2 hours wait
+
+ patterns = (r'(/get_file\.php\?id=[A-Z0-9]+&key=[a-zA-Z0-9=]+&original=1)',
+ r'(/get_file\.php\?download=[A-Z0-9]+&key=[a-z0-9]+)',
+ r'(/get_file\.php\?download=[A-Z0-9]+&key=[a-z0-9]+&original=1)',
+ r'<a href="/gopro\.php">Tired of ads and waiting\? Go Pro!</a>[\t\n\rn ]+</div>[\t\n\rn ]+<a href="(/.*?)"')
+ for pattern in patterns:
+ link = re.search(pattern, self.html)
+ if link:
+ break
+ else:
+ link = re.search(r"playlist: '(/get_file\.php\?stream=[a-zA-Z0-9=]+)'", self.html)
+ if link:
+ self.html = self.load("http://www.sockshare.com" + link.group(1))
+ link = re.search(r'media:content url="(http://.*?)"', self.html)
+ if not link:
+ link = re.search(r'\"(http://media\\-b\\d+\\.sockshare\\.com/download/\\d+/.*?)\"', self.html)
+ else:
+ self.parseError('Unable to detect a download link')
+
+ link = link.group(1).replace("&amp;", "&")
+ if link.startswith("http://"):
+ return link
+ else:
+ return "http://www.sockshare.com" + link
+
+ def processName(self, name_old):
+ name = self.pyfile.name
+ if name <= name_old:
+ return
+ name_new = re.sub(r'\.[^.]+$', "", name_old) + name[len(name_old):]
+ filename = self.lastDownload
+ self.pyfile.name = name_new
+ rename(filename, filename.rsplit(name)[0] + name_new)
+ self.logInfo("%(name)s renamed to %(newname)s" % {"name": name, "newname": name_new})
+
+
+getInfo = create_getInfo(SockshareCom)