瀏覽代碼

[cnet] Fix title extraction

URLs are still missing
Philipp Hagemeister 11 年之前
父節點
當前提交
6f5342a201
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      youtube_dl/extractor/cnet.py

+ 5 - 1
youtube_dl/extractor/cnet.py

@@ -43,7 +43,11 @@ class CNETIE(InfoExtractor):
             raise ExtractorError('Cannot find video data')
 
         video_id = vdata['id']
-        title = vdata['headline']
+        title = vdata.get('headline')
+        if title is None:
+            title = vdata.get('title')
+        if title is None:
+            raise ExtractorError('Cannot find title!')
         description = vdata.get('dek')
         thumbnail = vdata.get('image', {}).get('path')
         author = vdata.get('author')