[bilibili] quick hack for bangumi URLs (fix #1226)

This commit is contained in:
Mort Yao 2016-06-26 16:50:28 +02:00
parent 9c8d8b0023
commit d8aca8f542
No known key found for this signature in database
GPG Key ID: 07DA00CB78203251

View File

@ -120,6 +120,11 @@ def bilibili_live_download_by_cid(cid, title, output_dir='.', merge=True, info_o
def bilibili_download(url, output_dir='.', merge=True, info_only=False, **kwargs): def bilibili_download(url, output_dir='.', merge=True, info_only=False, **kwargs):
html = get_content(url) html = get_content(url)
if re.match(r'https?://bangumi\.bilibili\.com/', url):
# quick hack for bangumi URLs
url = r1(r'"([^"]+)" class="v-av-link"', html)
html = get_content(url)
title = r1_of([r'<meta name="title" content="([^<>]{1,999})" />', title = r1_of([r'<meta name="title" content="([^<>]{1,999})" />',
r'<h1[^>]*>([^<>]+)</h1>'], html) r'<h1[^>]*>([^<>]+)</h1>'], html)
if title: if title: