diff options
author | Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com> | 2013-10-12 21:34:04 +0200 |
---|---|---|
committer | Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com> | 2013-10-12 21:34:04 +0200 |
commit | d7e66d39a040886f940f4adf444be71e50e97391 (patch) | |
tree | 5c2ff645d5e32b3ebe6662aa7a0c76e0f3c61832 /youtube_dl/utils.py | |
parent | d3f46b9aa5727323182dd845030c9d781e1824fd (diff) |
Add an extractor for internetvideoarchive.com videos
It's used by videodetective.com
Diffstat (limited to 'youtube_dl/utils.py')
-rw-r--r-- | youtube_dl/utils.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index 0457f3ded..3e81c308b 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -230,6 +230,19 @@ else: return f return None +# On python2.6 the xml.etree.ElementTree.Element methods don't support +# the namespace parameter +def xpath_with_ns(path, ns_map): + components = [c.split(':') for c in path.split('/')] + replaced = [] + for c in components: + if len(c) == 1: + replaced.append(c[0]) + else: + ns, tag = c + replaced.append('{%s}%s' % (ns_map[ns], tag)) + return '/'.join(replaced) + def htmlentity_transform(matchobj): """Transforms an HTML entity to a character. |