[kwuo] Remove _sort_formats() from KuwoBaseIE._get_formats()
authorYen Chi Hsuan <yan12125@gmail.com>
Wed, 30 Mar 2016 18:11:21 +0000 (02:11 +0800)
committerYen Chi Hsuan <yan12125@gmail.com>
Wed, 30 Mar 2016 18:11:21 +0000 (02:11 +0800)
Following the idea proposed in 19dbaeece321c51fa336ef142507adf440e22e22

youtube_dl/extractor/kuwo.py

index 84c0f363d762a465ece06c44d68faf340858b11d..f09436332e7891e3878ac8bb1b045f21fb9c3b5e 100644 (file)
@@ -44,11 +44,6 @@ class KuwoBaseIE(InfoExtractor):
                     'abr': file_format.get('abr'),
                 })
 
-        # XXX _sort_formats fails if there are not formats, while it's not the
-        # desired behavior if 'IPDeny' is ignored
-        # This check can be removed if https://github.com/rg3/youtube-dl/pull/8051 is merged
-        if not tolerate_ip_deny:
-            self._sort_formats(formats)
         return formats
 
 
@@ -103,6 +98,7 @@ class KuwoIE(KuwoBaseIE):
             lrc_content = None
 
         formats = self._get_formats(song_id)
+        self._sort_formats(formats)
 
         album_id = self._html_search_regex(
             r'<p[^>]+class="album"[^<]+<a[^>]+href="http://www\.kuwo\.cn/album/(\d+)/"',