class KuwoIE(KuwoBaseIE):
IE_NAME = 'kuwo:song'
- _VALID_URL = r'http://www\.kuwo\.cn/yinyue/(?P<id>[0-9]+?)/'
+ _VALID_URL = r'http://www\.kuwo\.cn/yinyue/(?P<id>\d+?)/'
_TESTS = [{
'url': 'http://www.kuwo.cn/yinyue/635632/',
'info_dict': {
r'<h1[^>]+title="([^"]+)">', webpage, 'song name')
singer_name = self._html_search_regex(
r'<div[^>]+class="s_img">\s*<a[^>]+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
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 = 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('-', '')
class KuwoAlbumIE(InfoExtractor):
IE_NAME = 'kuwo:album'
- _VALID_URL = r'http://www\.kuwo\.cn/album/(?P<id>[0-9]+?)/'
+ _VALID_URL = r'http://www\.kuwo\.cn/album/(?P<id>\d+?)/'
_TEST = {
'url': 'http://www.kuwo.cn/album/502294/',
'info_dict': {
'info_dict': {
'id': '香港中文龙虎榜',
'title': '香港中文龙虎榜',
- 'description': 're:[0-9]{4}第[0-9]{2}期',
+ 'description': 're:\d{4}第\d{2}期',
},
'playlist_mincount': 10,
}
)
entries = []
- first_page_only = False if re.search(r'/music(?:_[0-9]+)?\.htm', url) else True
+ first_page_only = False if re.search(r'/music(?:_\d+)?\.htm', url) else True
for page_num in itertools.count(1):
webpage = self._download_webpage(
'http://www.kuwo.cn/mingxing/%s/music_%d.htm' % (singer_id, page_num),
class KuwoCategoryIE(InfoExtractor):
IE_NAME = 'kuwo:category'
- _VALID_URL = r'http://yinyue\.kuwo\.cn/yy/cinfo_(?P<id>[0-9]+?).htm'
+ _VALID_URL = r'http://yinyue\.kuwo\.cn/yy/cinfo_(?P<id>\d+?).htm'
_TEST = {
'url': 'http://yinyue.kuwo.cn/yy/cinfo_86375.htm',
'info_dict': {
class KuwoMvIE(KuwoBaseIE):
IE_NAME = 'kuwo:mv'
- _VALID_URL = r'http://www\.kuwo\.cn/mv/(?P<id>[0-9]+?)/'
+ _VALID_URL = r'http://www\.kuwo\.cn/mv/(?P<id>\d+?)/'
_TEST = {
'url': 'http://www.kuwo.cn/mv/6480076/',
'info_dict': {