[xhamster] Improve initials regex (#26526) (closes #26353)
authorTheRealDude2 <the.real.dude@gmx.de>
Sun, 6 Sep 2020 04:10:27 +0000 (06:10 +0200)
committerGitHub <noreply@github.com>
Sun, 6 Sep 2020 04:10:27 +0000 (11:10 +0700)
youtube_dl/extractor/xhamster.py

index 902a3ed338e914c9e20edc3c643d0e5274d71fe7..76aeaf9a46a6f67a054bfbc3313b8e6d4309a7f2 100644 (file)
@@ -138,7 +138,8 @@ class XHamsterIE(InfoExtractor):
 
         initials = self._parse_json(
             self._search_regex(
-                r'window\.initials\s*=\s*({.+?})\s*;', webpage, 'initials',
+                (r'window\.initials\s*=\s*({.+?})\s*;\s*</script>',
+                 r'window\.initials\s*=\s*({.+?})\s*;'), webpage, 'initials',
                 default='{}'),
             video_id, fatal=False)
         if initials: