]> git.bitcoin.ninja Git - youtube-dl/commitdiff
[worldstarhiphop] Small cleanup
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Tue, 30 Jul 2013 09:10:17 +0000 (11:10 +0200)
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Tue, 30 Jul 2013 09:10:17 +0000 (11:10 +0200)
The second check for the Vevo id is not necessary.

youtube_dl/extractor/worldstarhiphop.py

index 8a52c7a99147c4c871ac1cdf97272941effbc104..3237596a3ace9796001f8ab78921ca9b6c84d2d1 100644 (file)
@@ -21,23 +21,16 @@ class WorldStarHipHopIE(InfoExtractor):
 
         webpage_src = self._download_webpage(url, video_id)
 
-        video_url = re.search(r'videoId=(.*?)&amp?',
+        m_vevo_id = re.search(r'videoId=(.*?)&amp?',
             webpage_src)
         
-        if video_url:
+        if m_vevo_id is not None:
             self.to_screen(u'Vevo video detected:')
-            return self.url_result('vevo:%s' % video_url.group(1), ie='Vevo')
+            return self.url_result('vevo:%s' % m_vevo_id.group(1), ie='Vevo')
 
         video_url = self._search_regex(r'so\.addVariable\("file","(.*?)"\)',
             webpage_src, u'video URL')
 
-        if video_url is None:
-            video_url = self._search_regex(r'videoId=(.*?)&amp?',
-                webpage_src, u'video URL')
-            self.to_screen(u'Vevo video detected:')
-            vevo_id = 'vevo:%s' % video_url
-            return self.url_result(vevo_id, ie='Vevo')
-
         if 'youtube' in video_url:
             self.to_screen(u'Youtube video detected:')
             return self.url_result(video_url, ie='Youtube')