From 094790d2c963ef7ee9f5861e0458174ddd15ed87 Mon Sep 17 00:00:00 2001 From: Yen Chi Hsuan Date: Sat, 11 Jul 2015 00:03:49 +0800 Subject: [PATCH] [kuwo:song] Give warnings for unavailable optional fields --- youtube_dl/extractor/kuwo.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/youtube_dl/extractor/kuwo.py b/youtube_dl/extractor/kuwo.py index 18bf66404..a021f3cdf 100644 --- a/youtube_dl/extractor/kuwo.py +++ b/youtube_dl/extractor/kuwo.py @@ -80,7 +80,7 @@ class KuwoIE(KuwoBaseIE): r']+title="([^"]+)">', webpage, 'song name') singer_name = self._html_search_regex( r']+class="s_img">\s*]+title="([^>]+)"', - webpage, 'singer name', default=None) + webpage, 'singer name', fatal=False) lrc_content = clean_html(get_element_by_id('lrcContent', webpage)) if lrc_content == '暂无': # indicates no lyrics lrc_content = None @@ -89,7 +89,7 @@ class KuwoIE(KuwoBaseIE): album_id = self._html_search_regex( r']+class="album"[^<]+]+href="http://www\.kuwo\.cn/album/(\d+)/"', - webpage, 'album id', default=None, fatal=False) + webpage, 'album id', fatal=False) publish_time = None if album_id is not None: @@ -100,7 +100,7 @@ class KuwoIE(KuwoBaseIE): publish_time = self._html_search_regex( r'发行时间:(\d{4}-\d{2}-\d{2})', album_info_page, - 'publish time', default=None) + 'publish time', fatal=False) if publish_time: publish_time = publish_time.replace('-', '')