diff options
author | spoob <spoob@gmx.de> | 2010-01-15 15:03:00 +0100 |
---|---|---|
committer | spoob <spoob@gmx.de> | 2010-01-15 15:03:00 +0100 |
commit | 2edf36eb45d427262e9f83af90b8b4fc2f69aab8 (patch) | |
tree | 5cadf5d76f3784512973244194b19fbade2c1a4b /module/plugins/decrypter | |
parent | merge + fix (diff) | |
download | pyload-2edf36eb45d427262e9f83af90b8b4fc2f69aab8.tar.xz |
Better Argument Parsing in Core, littel fixes
Diffstat (limited to 'module/plugins/decrypter')
-rw-r--r-- | module/plugins/decrypter/HoerbuchIn.py | 4 | ||||
-rw-r--r-- | module/plugins/decrypter/SerienjunkiesOrg.py | 22 | ||||
-rw-r--r-- | module/plugins/decrypter/YoutubeChannel.py | 2 |
3 files changed, 6 insertions, 22 deletions
diff --git a/module/plugins/decrypter/HoerbuchIn.py b/module/plugins/decrypter/HoerbuchIn.py index ae7ae9774..2c3fd4123 100644 --- a/module/plugins/decrypter/HoerbuchIn.py +++ b/module/plugins/decrypter/HoerbuchIn.py @@ -12,8 +12,8 @@ class HoerbuchIn(Plugin): props = {} props['name'] = "HoerbuchIn" props['type'] = "container" - props['pattern'] = r"http://(www\.)?hoerbuch\.in/blog\.php\?id=" - props['version'] = "0.3" + props['pattern'] = r"http://(www\.)?hoerbuch\.in/(blog\.php\?id=|download_(.*)\.html)" + props['version'] = "0.4" props['description'] = """Hoerbuch.in Container Plugin""" props['author_name'] = ("spoob") props['author_mail'] = ("spoob@pyload.org") diff --git a/module/plugins/decrypter/SerienjunkiesOrg.py b/module/plugins/decrypter/SerienjunkiesOrg.py index 7302f904e..7d45fd705 100644 --- a/module/plugins/decrypter/SerienjunkiesOrg.py +++ b/module/plugins/decrypter/SerienjunkiesOrg.py @@ -4,23 +4,7 @@ import re from module.Plugin import Plugin from module.BeautifulSoup import BeautifulSoup - -from htmlentitydefs import name2codepoint as n2cp -def substitute_entity(match): - ent = match.group(2) - if match.group(1) == "#": - return unichr(int(ent)) - else: - cp = n2cp.get(ent) - if cp: - return unichr(cp) - else: - return match.group() - -def decode_htmlentities(string): - entity_re = re.compile("&(#?)(\d{1,5}|\w{1,8});") - return entity_re.subn(substitute_entity, string)[0] - +from module.unescape import unescape class SerienjunkiesOrg(Plugin): def __init__(self, parent): @@ -100,10 +84,10 @@ class SerienjunkiesOrg(Plugin): var = p.findAll("strong") opts = {"Dauer": "", "Uploader": "", "Sprache": "", "Format": "", u"Größe": ""} for v in var: - n = decode_htmlentities(v.string) + n = unescape(v.string) val = v.nextSibling val = val.encode("utf-8") - val = decode_htmlentities(val) + val = unescape(val) val = val.replace("|", "").strip() n = n.strip() n = re.sub(r"^([:]?)(.*?)([:]?)$", r'\2', n) diff --git a/module/plugins/decrypter/YoutubeChannel.py b/module/plugins/decrypter/YoutubeChannel.py index a5751ed7c..ba2ca1472 100644 --- a/module/plugins/decrypter/YoutubeChannel.py +++ b/module/plugins/decrypter/YoutubeChannel.py @@ -44,7 +44,7 @@ class YoutubeChannel(Plugin): if max_results > 50: max_results = 50 url = "http://gdata.youtube.com/feeds/api/users/%s/%s?max-results=%i&start-index=%i" % (self.user, group, max_results, start_index) - rep = self.req.load(str(url)) + rep = self.req.load(url) new_links = re.findall(r"href\='(http:\/\/www.youtube.com\/watch\?v\=[^']+)", rep) if new_links != []: temp_links.extend(new_links) |