浏览代码

[yahoo] Support https and -uploader URLs (Fixes #2701)

Philipp Hagemeister 11 年之前
父节点
当前提交
c8edf47b3a
共有 2 个文件被更改,包括 7 次插入1 次删除
  1. 6 0
      test/test_all_urls.py
  2. 1 1
      youtube_dl/extractor/yahoo.py

+ 6 - 0
test/test_all_urls.py

@@ -157,5 +157,11 @@ class TestAllURLsMatching(unittest.TestCase):
             'http://thedailyshow.cc.com/guests/michael-lewis/3efna8/exclusive---michael-lewis-extended-interview-pt--3',
             ['ComedyCentralShows'])
 
+    def test_yahoo_https(self):
+        # https://github.com/rg3/youtube-dl/issues/2701
+        self.assertMatch(
+            'https://screen.yahoo.com/smartwatches-latest-wearable-gadgets-163745379-cbs.html',
+            ['Yahoo'])
+
 if __name__ == '__main__':
     unittest.main()

+ 1 - 1
youtube_dl/extractor/yahoo.py

@@ -15,7 +15,7 @@ from ..utils import (
 
 class YahooIE(InfoExtractor):
     IE_DESC = 'Yahoo screen'
-    _VALID_URL = r'http://screen\.yahoo\.com/.*?-(?P<id>\d*?)\.html'
+    _VALID_URL = r'https?://screen\.yahoo\.com/.*?-(?P<id>[0-9]+)(?:-[a-z]+)?\.html'
     _TESTS = [
         {
             'url': 'http://screen.yahoo.com/julian-smith-travis-legg-watch-214727115.html',