diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2014-11-23 21:33:31 +0100 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2014-11-23 21:33:31 +0100 |
commit | 784b6d3a9bc79fe55a8b132fd10555c1e9a61c31 (patch) | |
tree | e9a7996c44fd8d07f0bef5cdebbafdbe9c0b7bb4 /youtube_dl/extractor/appletrailers.py | |
parent | f3a34072266c0a7595f73fa032685cf8a50d2ab4 (diff) | |
parent | 2514d2635e0c8ff0fb72d00a093a849001df2bdd (diff) | |
download | hypervideo-pre-784b6d3a9bc79fe55a8b132fd10555c1e9a61c31.tar.lz hypervideo-pre-784b6d3a9bc79fe55a8b132fd10555c1e9a61c31.tar.xz hypervideo-pre-784b6d3a9bc79fe55a8b132fd10555c1e9a61c31.zip |
Merge remote-tracking branch 'jtwaleson/master'
Diffstat (limited to 'youtube_dl/extractor/appletrailers.py')
-rw-r--r-- | youtube_dl/extractor/appletrailers.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/youtube_dl/extractor/appletrailers.py b/youtube_dl/extractor/appletrailers.py index 4359b88d1..567a76cf0 100644 --- a/youtube_dl/extractor/appletrailers.py +++ b/youtube_dl/extractor/appletrailers.py @@ -70,11 +70,13 @@ class AppleTrailersIE(InfoExtractor): uploader_id = mobj.group('company') playlist_url = compat_urlparse.urljoin(url, 'includes/playlists/itunes.inc') + def fix_html(s): s = re.sub(r'(?s)<script[^<]*?>.*?</script>', '', s) s = re.sub(r'<img ([^<]*?)>', r'<img \1/>', s) # The ' in the onClick attributes are not escaped, it couldn't be parsed # like: http://trailers.apple.com/trailers/wb/gravity/ + def _clean_json(m): return 'iTunes.playURL(%s);' % m.group(1).replace('\'', ''') s = re.sub(self._JSON_RE, _clean_json, s) |