Merge branch 'pr' of https://github.com/ayanamist/you-get into ayanamist-pr

This commit is contained in:
Mort Yao 2017-10-18 12:07:01 +02:00
commit 907600c2de
No known key found for this signature in database
GPG Key ID: 07DA00CB78203251

View File

@ -123,13 +123,17 @@ class Bilibili(VideoExtractor):
self.url = 'http://www.bilibili.com/video/av{}/index_{}.html'.format(aid, page) self.url = 'http://www.bilibili.com/video/av{}/index_{}.html'.format(aid, page)
self.referer = self.url self.referer = self.url
self.page = get_content(self.url) self.page = get_content(self.url)
try:
self.title = re.search(r'<h1\s*title="([^"]+)"', self.page).group(1) m = re.search(r'<h1\s*title="([^"]+)"', self.page)
if 'subtitle' in kwargs: if m is not None:
subtitle = kwargs['subtitle'] self.title = m.group(1)
self.title = '{} {}'.format(self.title, subtitle) if self.title is None:
except Exception: m = re.search(r'<meta property="og:title" content="([^"]+)">', self.page)
pass if m is not None:
self.title = m.group(1)
if 'subtitle' in kwargs:
subtitle = kwargs['subtitle']
self.title = '{} {}'.format(self.title, subtitle)
if 'bangumi.bilibili.com/movie' in self.url: if 'bangumi.bilibili.com/movie' in self.url:
self.movie_entry(**kwargs) self.movie_entry(**kwargs)