[appletrailers] Improve regex for fixing '<img>' tags (#7953)
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Wed, 23 Dec 2015 13:48:40 +0000 (14:48 +0100)
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Wed, 23 Dec 2015 13:48:40 +0000 (14:48 +0100)
youtube_dl/extractor/appletrailers.py

index ca9a7092488166d7b20c5e5f11d7c77120f0e272..82beed2ce4ac4dfc12c5fb292a46228fb1907eb1 100644 (file)
@@ -80,7 +80,7 @@ class AppleTrailersIE(InfoExtractor):
 
         def fix_html(s):
             s = re.sub(r'(?s)<script[^<]*?>.*?</script>', '', s)
-            s = re.sub(r'<img ([^<]*?)>', r'<img \1/>', 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/