summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-10-10 14:41:06 +0200
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-10-10 14:41:06 +0200
commit2d613459035663ecc517988db3b96d3cd9531d7a (patch)
tree15d869100824ce35dfbfdfe7491bac8b4ba6446f /module/plugins/hoster
parent[XFSPHoster] Update LINK_PATTERN (diff)
downloadpyload-2d613459035663ecc517988db3b96d3cd9531d7a.tar.xz
[FiredriveCom][SockshareCom] Mark dead
Diffstat (limited to 'module/plugins/hoster')
-rw-r--r--module/plugins/hoster/FiredriveCom.py40
-rw-r--r--module/plugins/hoster/SockshareCom.py77
2 files changed, 6 insertions, 111 deletions
diff --git a/module/plugins/hoster/FiredriveCom.py b/module/plugins/hoster/FiredriveCom.py
index b68868a66..66a67ffff 100644
--- a/module/plugins/hoster/FiredriveCom.py
+++ b/module/plugins/hoster/FiredriveCom.py
@@ -1,14 +1,12 @@
# -*- coding: utf-8 -*-
-import re
+from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo
-from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
-
-class FiredriveCom(SimpleHoster):
+class FiredriveCom(DeadHoster):
__name__ = "FiredriveCom"
__type__ = "hoster"
- __version__ = "0.04"
+ __version__ = "0.05"
__pattern__ = r'https?://(?:www\.)?(firedrive|putlocker)\.com/(mobile/)?(file|embed)/(?P<ID>\w+)'
@@ -17,36 +15,4 @@ class FiredriveCom(SimpleHoster):
__authors__ = [("Walter Purcaro", "vuolter@gmail.com")]
- 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>'
- OFFLINE_PATTERN = r'class="sad_face_image"|>No such page here.<'
- TEMP_OFFLINE_PATTERN = r'Please try again in a few minutes.<'
-
- FILE_URL_REPLACEMENTS = [(__pattern__, r'http://www.firedrive.com/file/\g<ID>')]
-
- LINK_PATTERN = r'<a href="(https?://dl\.firedrive\.com/\?key=.+?)"'
-
-
- def setup(self):
- self.multiDL = self.resumeDownload = True
- self.chunkLimit = -1
-
- def handleFree(self):
- link = self._getLink()
- self.logDebug("Direct link: " + link)
- self.download(link, disposition=True)
-
- def _getLink(self):
- f = re.search(self.LINK_PATTERN, self.html)
- if f:
- return f.group(1)
- else:
- self.html = self.load(self.pyfile.url, post={"confirm": re.search(r'name="confirm" value="(.+?)"', self.html).group(1)})
- f = re.search(self.LINK_PATTERN, self.html)
- if f:
- return f.group(1)
- else:
- self.parseError("Direct download link not found")
-
-
getInfo = create_getInfo(FiredriveCom)
diff --git a/module/plugins/hoster/SockshareCom.py b/module/plugins/hoster/SockshareCom.py
index 930d63ad8..2f33ad94d 100644
--- a/module/plugins/hoster/SockshareCom.py
+++ b/module/plugins/hoster/SockshareCom.py
@@ -1,17 +1,12 @@
# -*- coding: utf-8 -*-
-import re
+from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo
-from os import rename
-from module.plugins.hoster.UnrestrictLi import secondsToMidnight
-from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
-
-
-class SockshareCom(SimpleHoster):
+class SockshareCom(DeadHoster):
__name__ = "SockshareCom"
__type__ = "hoster"
- __version__ = "0.04"
+ __version__ = "0.05"
__pattern__ = r'http://(?:www\.)?sockshare\.com/(mobile/)?(file|embed)/(?P<ID>\w+)'
@@ -22,70 +17,4 @@ class SockshareCom(SimpleHoster):
("Walter Purcaro", "vuolter@gmail.com")]
- FILE_INFO_PATTERN = r'site-content">\s*<h1>(?P<N>.+)<strong>\( (?P<S>[^)]+) \)</strong></h1>'
- OFFLINE_PATTERN = r'>This file doesn\'t exist, or has been removed.<'
- TEMP_OFFLINE_PATTERN = r'(>This content server has been temporarily disabled for upgrades|Try again soon\\. You can still download it below\\.<)'
-
- FILE_URL_REPLACEMENTS = [(__pattern__, r'http://www.sockshare.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:
- self.logWarning("You have exceeded your daily stream limit for today")
- self.wait(secondsToMidnight(gmt=2), True)
- elif re.search(self.TEMP_OFFLINE_PATTERN, self.html):
- self.retry(wait_time=2 * 60 * 60, reason="Server temporarily offline") # 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 link is None:
- 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)