summaryrefslogtreecommitdiffstats
path: root/module/plugins
diff options
context:
space:
mode:
authorGravatar sebdelsol <seb.morin@gmail.com> 2015-03-09 21:42:19 +0100
committerGravatar sebdelsol <seb.morin@gmail.com> 2015-03-09 21:42:19 +0100
commit678f488777a94522ce8ba68f106428eefa037f50 (patch)
tree13adf09ab3472b1580985fe5851f8cd7990067f6 /module/plugins
parentRename fileUrl to getFileURL (diff)
downloadpyload-678f488777a94522ce8ba68f106428eefa037f50.tar.xz
[ZippyShare] Bug #1238 correction
* remove non ascii character from the id part in the js variable name. * change the RE so that it works for any character in the id name
Diffstat (limited to 'module/plugins')
-rw-r--r--module/plugins/hoster/ZippyshareCom.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/module/plugins/hoster/ZippyshareCom.py b/module/plugins/hoster/ZippyshareCom.py
index 9d7c6949f..f2c99de7b 100644
--- a/module/plugins/hoster/ZippyshareCom.py
+++ b/module/plugins/hoster/ZippyshareCom.py
@@ -11,7 +11,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class ZippyshareCom(SimpleHoster):
__name__ = "ZippyshareCom"
__type__ = "hoster"
- __version__ = "0.74"
+ __version__ = "0.75"
__pattern__ = r'http://www\d{0,2}\.zippyshare\.com/v(/|iew\.jsp.*key=)(?P<KEY>[\w^_]+)'
@@ -64,7 +64,7 @@ class ZippyshareCom(SimpleHoster):
id = element.group(1)
attr = element.group(4) #: attr might be None
- varName = '%s_%s' % (id, attr)
+ varName = '%s_%s' % (re.sub(r'\W', '', id), attr)
initValues = filter(None, [elt.get(attr, None) for elt in soup.findAll(id=id)])
initValue = '"%s"' % initValues[-1] if initValues else 'null'
@@ -72,7 +72,7 @@ class ZippyshareCom(SimpleHoster):
return varName
# handle all getElementById
- reVar = r'document.getElementById\([\'"](\w+)[\'"]\)(\.)?(getAttribute\([\'"])?(\w+)?([\'"]\))?'
+ reVar = r'document.getElementById\([\'"](.+)[\'"]\)(\.)?(getAttribute\([\'"])?(\w+)?([\'"]\))?'
scripts = [re.sub(reVar, replElementById, script) for script in scripts]
# add try/catch in JS to handle deliberate errors