]> git.bitcoin.ninja Git - youtube-dl/commitdiff
Improve some id regexes
authorstepshal <nessento@openmailbox.org>
Wed, 14 Sep 2016 16:03:26 +0000 (23:03 +0700)
committerSergey M․ <dstftw@gmail.com>
Thu, 15 Sep 2016 16:12:58 +0000 (23:12 +0700)
youtube_dl/extractor/canvas.py
youtube_dl/extractor/nfl.py
youtube_dl/extractor/npo.py

index ef0691dcd8aee5dc7ffce16791b2db1fb61adb9a..d183d5d527fb8ab4163b16fcaffd0aeedbf0dd0c 100644 (file)
@@ -71,7 +71,7 @@ class CanvasIE(InfoExtractor):
             webpage)).strip()
 
         video_id = self._html_search_regex(
-            r'data-video=(["\'])(?P<id>.+?)\1', webpage, 'video id', group='id')
+            r'data-video=(["\'])(?P<id>(?:(?!\1).)+)\1', webpage, 'video id', group='id')
 
         data = self._download_json(
             'https://mediazone.vrt.be/api/v1/%s/assets/%s'
index 200874d68e765e43a6b9787473c6d2b5af54cfb2..3930d16f16e4d295e9afeb84f88eb36dc7ffc30b 100644 (file)
@@ -165,7 +165,7 @@ class NFLIE(InfoExtractor):
             group='config'))
         # For articles, the id in the url is not the video id
         video_id = self._search_regex(
-            r'(?:<nflcs:avplayer[^>]+data-content[Ii]d\s*=\s*|content[Ii]d\s*:\s*)(["\'])(?P<id>.+?)\1',
+            r'(?:<nflcs:avplayer[^>]+data-content[Ii]d\s*=\s*|content[Ii]d\s*:\s*)(["\'])(?P<id>(?:(?!\1).)+)\1',
             webpage, 'video id', default=video_id, group='id')
         config = self._download_json(config_url, video_id, 'Downloading player config')
         url_template = NFLIE.prepend_host(
index 87f5675c7ff8b14169291420feb9bcf85edf894d..3293bdb17bbf75c5bfb96d0da7b72df8a6591057 100644 (file)
@@ -429,7 +429,7 @@ class SchoolTVIE(InfoExtractor):
         display_id = self._match_id(url)
         webpage = self._download_webpage(url, display_id)
         video_id = self._search_regex(
-            r'data-mid=(["\'])(?P<id>.+?)\1', webpage, 'video_id', group='id')
+            r'data-mid=(["\'])(?P<id>(?:(?!\1).)+)\1', webpage, 'video_id', group='id')
         return {
             '_type': 'url_transparent',
             'ie_key': 'NPO',