[extractor/common] Add id and title helpers for generic IEs
[youtube-dl] / youtube_dl / extractor / generic.py
index 9ea306e3a4313bbc78f43b5d6fce7c6216996561..1f18cbfe955c1046648c970d74125356e5fa6368 100644 (file)
@@ -1412,6 +1412,18 @@ class GenericIE(InfoExtractor):
             },
             'playlist_mincount': 3,
         },
+        {
+            # Direct MMS link
+            'url': 'mms://kentro.kaist.ac.kr/200907/MilesReid(0709).wmv',
+            'info_dict': {
+                'id': 'MilesReid(0709)',
+                'ext': 'wmv',
+                'title': 'MilesReid(0709)',
+            },
+            'params': {
+                'skip_download': True,  # rtsp downloads, requiring mplayer or mpv
+            },
+        },
         # {
         #     # TODO: find another test
         #     # http://schema.org/VideoObject
@@ -1551,6 +1563,13 @@ class GenericIE(InfoExtractor):
         else:
             video_id = compat_urllib_parse_unquote(os.path.splitext(url.rstrip('/').split('/')[-1])[0])
 
+        if parsed_url.scheme == 'mms':
+            return {
+                'id': video_id,
+                'title': video_id,
+                'url': url,
+            }
+
         self.to_screen('%s: Requesting header' % video_id)
 
         head_req = HEADRequest(url)
@@ -1754,9 +1773,9 @@ class GenericIE(InfoExtractor):
         if matches:
             return _playlist_from_matches(matches, ie='RtlNl')
 
-        vimeo_url = VimeoIE._extract_vimeo_url(url, webpage)
-        if vimeo_url is not None:
-            return self.url_result(vimeo_url)
+        vimeo_urls = VimeoIE._extract_urls(url, webpage)
+        if vimeo_urls:
+            return _playlist_from_matches(vimeo_urls, ie=VimeoIE.ie_key())
 
         vid_me_embed_url = self._search_regex(
             r'src=[\'"](https?://vid\.me/[^\'"]+)[\'"]',