diff options
author | mkaay <mkaay@mkaay.de> | 2009-12-27 00:20:21 +0100 |
---|---|---|
committer | mkaay <mkaay@mkaay.de> | 2009-12-27 00:20:21 +0100 |
commit | 8e87787753b2e049917a5491727d285b1c5a7095 (patch) | |
tree | 9b23fb14b0f1270edc4582758bcf3a39cfd97b67 /module/plugins/CCF.py | |
parent | closes #42 (diff) | |
download | pyload-8e87787753b2e049917a5491727d285b1c5a7095.tar.xz |
closes #13
Diffstat (limited to 'module/plugins/CCF.py')
-rw-r--r-- | module/plugins/CCF.py | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/module/plugins/CCF.py b/module/plugins/CCF.py deleted file mode 100644 index 88b567904..000000000 --- a/module/plugins/CCF.py +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import os.path -import random -import re -import tempfile -import urllib2 - -from module.Plugin import Plugin -from module.network.MultipartPostHandler import MultipartPostHandler - -class CCF(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "CCF" - props['type'] = "container" - props['pattern'] = r"(?!http://).*\.ccf" - props['version'] = "0.1" - props['description'] = """CCF Container Convert Plugin""" - props['author_name'] = ("Willnix") - props['author_mail'] = ("Willnix@pyload.org") - self.props = props - self.parent = parent - self.multi_dl = True - self.links = [] - - def proceed(self, url, location): - infile = url.replace("\n", "") - - opener = urllib2.build_opener(MultipartPostHandler) - params = {"src": "ccf", - "filename": "test.ccf", - "upload": open(infile, "rb")} - tempdlc_content = opener.open('http://service.jdownloader.net/dlcrypt/getDLC.php', params).read() - - random.seed() - tempdir = tempfile.gettempdir() - if tempdir[0] == '/': - delim = '/' - else: - delim = '\\' - tempdlc_name = tempdir + delim + str(random.randint(0, 100)) + '-tmp.dlc' - while os.path.exists(tempdlc_name): - tempdlc_name = tempfile.gettempdir() + '/' + str(random.randint(0, 100)) + '-tmp.dlc' - - tempdlc = open(tempdlc_name, "w") - tempdlc.write(re.search(r'<dlc>(.*)</dlc>', tempdlc_content, re.DOTALL).group(1)) - tempdlc.close - - self.links.append(tempdlc_name) - - return True |