From 46fc02fa06dd2bdca637a8fda66fccc5491e4410 Mon Sep 17 00:00:00 2001 From: ayanamist Date: Mon, 16 Oct 2017 14:02:55 +0800 Subject: [PATCH] modify bilibili title fetch --- src/you_get/extractors/bilibili.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/you_get/extractors/bilibili.py b/src/you_get/extractors/bilibili.py index 4642a621..10154c33 100644 --- a/src/you_get/extractors/bilibili.py +++ b/src/you_get/extractors/bilibili.py @@ -123,13 +123,17 @@ class Bilibili(VideoExtractor): self.url = 'http://www.bilibili.com/video/av{}/index_{}.html'.format(aid, page) self.referer = self.url self.page = get_content(self.url) - try: - self.title = re.search(r'', self.page) + 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: self.movie_entry(**kwargs)