From ae587135b8bb6bf633bcf4a1c082ddcd592b6a78 Mon Sep 17 00:00:00 2001 From: xiaoma20082008 Date: Wed, 25 Aug 2021 11:05:28 +0800 Subject: [PATCH] (): fix file disappeared when the title was too long than 80 characters 1. the title will be truncated by utils.fs.legitimize to 80 characters --- src/you_get/extractors/bilibili.py | 5 ++++- tests/test.py | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/you_get/extractors/bilibili.py b/src/you_get/extractors/bilibili.py index edb656c7..abdfecac 100644 --- a/src/you_get/extractors/bilibili.py +++ b/src/you_get/extractors/bilibili.py @@ -210,7 +210,10 @@ class Bilibili(VideoExtractor): '1') # use URL to decide p-number, not initial_state['p'] if pn > 1: part = initial_state['videoData']['pages'][p - 1]['part'] - self.title = '%s (P%s. %s)' % (self.title, p, part) + """ + title's length is limited max 80 characters defined in `utils.fs.legitimize`. + """ + self.title = 'P%s. %s' % (p, part) # construct playinfos avid = initial_state['aid'] diff --git a/tests/test.py b/tests/test.py index 4a2a117c..e0def1d7 100644 --- a/tests/test.py +++ b/tests/test.py @@ -40,6 +40,10 @@ class YouGetTests(unittest.TestCase): def test_acfun(self): acfun.download('https://www.acfun.cn/v/ac11701912', info_only=True) + def test_bilibili(self): + bilibili.download_playlist('https://www.bilibili.com/video/BV1Zv411G7ty', output_dir='.', playlist=True, + merge=True, is_only=True) + #def test_soundcloud(self): ## single song #soundcloud.download(