[brightcove] Always return lists from _extract_brightcove_urls
authorYen Chi Hsuan <yan12125@gmail.com>
Wed, 15 Apr 2015 16:27:39 +0000 (00:27 +0800)
committerYen Chi Hsuan <yan12125@gmail.com>
Wed, 15 Apr 2015 16:27:39 +0000 (00:27 +0800)
In Python 3, filter() returns an iterable object, which is equivalently
to True even for an empty result set. It causes false positive playlists
in generic extraction logic.

youtube_dl/extractor/brightcove.py

index 117cb00e6e563a620d551b7363ed95e03246e9e0..4f60d53660fa7777b9e1b6152967ce2e7e567ec9 100644 (file)
@@ -188,7 +188,7 @@ class BrightcoveIE(InfoExtractor):
                 [^>]*?>\s*<param\s+name="movie"\s+value="https?://[^/]*brightcove\.com/
             ).+?>\s*</object>''',
             webpage)
-        return filter(None, [cls._build_brighcove_url(m) for m in matches])
+        return list(filter(None, [cls._build_brighcove_url(m) for m in matches]))
 
     def _real_extract(self, url):
         url, smuggled_data = unsmuggle_url(url, {})