<fix>(<bilibili>): 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
This commit is contained in:
xiaoma20082008 2021-08-25 11:05:28 +08:00
parent 5498c377ff
commit ae587135b8
2 changed files with 8 additions and 1 deletions

View File

@ -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']

View File

@ -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(