diff options
author | Walter Purcaro <vuolter@gmail.com> | 2013-12-13 11:20:19 +0100 |
---|---|---|
committer | Stefano <l.stickell@yahoo.it> | 2013-12-13 11:20:39 +0100 |
commit | 7f239b41cb29ee95c878f78a6e9cacd55f301a8d (patch) | |
tree | 6fdb219256a3fa2c6de6f858197d91c829f73ff2 /module/plugins/hoster/IcyFilesCom.py | |
parent | Merge pull request #434 from kmarty/stable (diff) | |
download | pyload-7f239b41cb29ee95c878f78a6e9cacd55f301a8d.tar.xz |
Some hosters marked as dead
Merged #375
Diffstat (limited to 'module/plugins/hoster/IcyFilesCom.py')
-rw-r--r-- | module/plugins/hoster/IcyFilesCom.py | 88 |
1 files changed, 4 insertions, 84 deletions
diff --git a/module/plugins/hoster/IcyFilesCom.py b/module/plugins/hoster/IcyFilesCom.py index 53c934675..d0b101717 100644 --- a/module/plugins/hoster/IcyFilesCom.py +++ b/module/plugins/hoster/IcyFilesCom.py @@ -16,97 +16,17 @@ @author: godofdream """ -import re -from module.plugins.Hoster import Hoster -from module.network.RequestFactory import getURL +from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo -def getInfo(urls): - result = [] - for url in urls: - html = getURL(url, decode=True) - if re.search(IcyFilesCom.FILE_OFFLINE_PATTERN, html): - # File offline - result.append((url, 0, 1, url)) - else: - # Get file info - name = re.search(IcyFilesCom.FILE_NAME_PATTERN, html) - size = re.search(IcyFilesCom.SIZE_PATTERN, html) - if name is not None: - name = name.group(1) - size = (int(size.group(1)) * 1000000) - result.append((name, size, 2, url)) - yield result - - -class IcyFilesCom(Hoster): +class IcyFilesCom(DeadHoster): __name__ = "IcyFilesCom" __type__ = "hoster" __pattern__ = r"http://(?:www\.)?icyfiles\.com/(.*)" - __version__ = "0.05" + __version__ = "0.06" __description__ = """IcyFiles.com plugin - free only""" __author_name__ = ("godofdream") __author_mail__ = ("soilfiction@gmail.com") - FILE_NAME_PATTERN = r'<div id="file">(.*?)</div>' - SIZE_PATTERN = r'<li>(\d+) <span>Size/mb' - FILE_OFFLINE_PATTERN = r'The requested File cant be found' - WAIT_LONGER_PATTERN = r'All download tickets are in use\. please try it again in a few seconds' - WAIT_PATTERN = r'<div class="counter">(\d+)</div>' - TOOMUCH_PATTERN = r'Sorry dude, you have downloaded too much\. Please wait (\d+) seconds' - - def setup(self): - self.multiDL = False - - def process(self, pyfile): - self.html = self.load(pyfile.url, decode=True) - # check if offline - if re.search(self.FILE_OFFLINE_PATTERN, self.html): - self.offline() - # All Downloadtickets in use - timmy = re.search(self.WAIT_LONGER_PATTERN, self.html) - if timmy: - self.logDebug("waitforfreeslot") - self.waitForFreeSlot() - # Wait the waittime - timmy = re.search(self.WAIT_PATTERN, self.html) - if timmy: - self.logDebug("waiting", timmy.group(1)) - self.setWait(int(timmy.group(1)) + 2, False) - self.wait() - # Downloaded to much - timmy = re.search(self.TOOMUCH_PATTERN, self.html) - if timmy: - self.logDebug("too much", timmy.group(1)) - self.setWait(int(timmy.group(1)), True) - self.wait() - # Find Name - found = re.search(self.FILE_NAME_PATTERN, self.html) - if found is None: - self.fail("Parse error (NAME)") - pyfile.name = found.group(1) - # Get the URL - url = pyfile.url - found = re.search(self.__pattern__, url) - if found is None: - self.fail("Parse error (URL)") - download_url = "http://icyfiles.com/download.php?key=" + found.group(1) - self.download(download_url) - # check download - check = self.checkDownload({ - "notfound": re.compile(r"^<head><title>404 Not Found</title>$"), - "skippedcountdown": re.compile(r"^Dont skip the countdown$"), - "waitforfreeslots": re.compile(self.WAIT_LONGER_PATTERN), - "downloadedtoomuch": re.compile(self.TOOMUCH_PATTERN) - }) - if check == "skippedcountdown": - self.fail("Countdown error") - elif check == "notfound": - self.fail("404 Not found") - elif check == "waitforfreeslots": - self.waitForFreeSlot() - elif check == "downloadedtoomuch": - self.retry() - def waitForFreeSlot(self): - self.retry(60, 60, "Wait for free slot") +getInfo = create_getInfo(IcyFilesCom) |