summaryrefslogtreecommitdiffstats
path: root/module/plugins/decrypter/SerienjunkiesOrg.py
diff options
context:
space:
mode:
authorGravatar spoob <spoob@gmx.de> 2010-01-15 15:03:00 +0100
committerGravatar spoob <spoob@gmx.de> 2010-01-15 15:03:00 +0100
commit2edf36eb45d427262e9f83af90b8b4fc2f69aab8 (patch)
tree5cadf5d76f3784512973244194b19fbade2c1a4b /module/plugins/decrypter/SerienjunkiesOrg.py
parentmerge + fix (diff)
downloadpyload-2edf36eb45d427262e9f83af90b8b4fc2f69aab8.tar.xz
Better Argument Parsing in Core, littel fixes
Diffstat (limited to 'module/plugins/decrypter/SerienjunkiesOrg.py')
-rw-r--r--module/plugins/decrypter/SerienjunkiesOrg.py22
1 files changed, 3 insertions, 19 deletions
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)