Ignore more downloaded files
[youtube-dl] / youtube_dl / extractor / mdr.py
index 366352dbe7033bb0827f098e837e81ea1e934c14..7aa0080d735fe811d6babf110156f4ab895edbdd 100644 (file)
@@ -8,29 +8,13 @@ from ..utils import (
 
 class MDRIE(InfoExtractor):
     _VALID_URL = r'^(?P<domain>(?:https?://)?(?:www\.)?mdr\.de)/mediathek/(?:.*)/(?P<type>video|audio)(?P<video_id>[^/_]+)_.*'
-
-    _TESTS = [{
-        u'url': u'http://www.mdr.de/mediathek/themen/nachrichten/video165624_zc-c5c7de76_zs-3795826d.html',
-        u'file': u'165624.mp4',
-        u'md5': u'ae785f36ecbf2f19b42edf1bc9c85815',
-        u'info_dict': {
-            u"title": u"MDR aktuell Eins30 09.12.2013, 22:48 Uhr"
-        },
-    },
-    {
-        u'url': u'http://www.mdr.de/mediathek/radio/mdr1-radio-sachsen/audio718370_zc-67b21197_zs-1b9b2483.html',
-        u'file': u'718370.mp3',
-        u'md5': u'a9d21345a234c7b45dee612f290fd8d7',
-        u'info_dict': {
-            u"title": u"MDR 1 RADIO SACHSEN 10.12.2013, 05:00 Uhr"
-        },
-    }]
+    
+    # No tests, MDR regularily deletes its videos
 
     def _real_extract(self, url):
         m = re.match(self._VALID_URL, url)
         video_id = m.group('video_id')
         domain = m.group('domain')
-        mediatype = m.group('type')
 
         # determine title and media streams from webpage
         html = self._download_webpage(url, video_id)
@@ -68,9 +52,10 @@ class MDRIE(InfoExtractor):
                     'format_id': u'%s-%d' % (media_type, vbr),
                 })
             formats.append(format)
-        formats.sort(key=lambda f: (f.get('vbr'), f['abr']))
         if not formats:
-            raise ValueError('Could not find any valid formats')
+            raise ExtractorError(u'Could not find any valid formats')
+
+        self._sort_formats(formats)
 
         return {
             'id': video_id,