projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9f01c1a
)
[kuwo:song] Give warnings for unavailable optional fields
author
Yen Chi Hsuan
<yan12125@gmail.com>
Fri, 10 Jul 2015 16:03:49 +0000
(
00:03
+0800)
committer
Yen Chi Hsuan
<yan12125@gmail.com>
Fri, 10 Jul 2015 16:03:49 +0000
(
00:03
+0800)
youtube_dl/extractor/kuwo.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/kuwo.py
b/youtube_dl/extractor/kuwo.py
index 18bf66404c5c0c16f37b10909f958329a0c4f82f..a021f3cdf49b02bc88afbf05412f255885d74f49 100644
(file)
--- a/
youtube_dl/extractor/kuwo.py
+++ b/
youtube_dl/extractor/kuwo.py
@@
-80,7
+80,7
@@
class KuwoIE(KuwoBaseIE):
r'<h1[^>]+title="([^"]+)">', webpage, 'song name')
singer_name = self._html_search_regex(
r'<div[^>]+class="s_img">\s*<a[^>]+title="([^>]+)"',
r'<h1[^>]+title="([^"]+)">', webpage, 'song name')
singer_name = self._html_search_regex(
r'<div[^>]+class="s_img">\s*<a[^>]+title="([^>]+)"',
- webpage, 'singer name',
default=Non
e)
+ webpage, 'singer name',
fatal=Fals
e)
lrc_content = clean_html(get_element_by_id('lrcContent', webpage))
if lrc_content == '暂无': # indicates no lyrics
lrc_content = None
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'<p[^>]+class="album"[^<]+<a[^>]+href="http://www\.kuwo\.cn/album/(\d+)/"',
album_id = self._html_search_regex(
r'<p[^>]+class="album"[^<]+<a[^>]+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:
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 = self._html_search_regex(
r'发行时间:(\d{4}-\d{2}-\d{2})', album_info_page,
- 'publish time',
default=Non
e)
+ 'publish time',
fatal=Fals
e)
if publish_time:
publish_time = publish_time.replace('-', '')
if publish_time:
publish_time = publish_time.replace('-', '')