diff --git a/README.md b/README.md index 05ba7d51b..c1d137a08 100644 --- a/README.md +++ b/README.md @@ -225,6 +225,13 @@ You can use the `-start`, `-end` or `-items` option to specify the download rang Playlist video items to download. Separated by commas like: 1,5,6,8-10 ``` +For bilibili playlists only: + +``` +-eto + File name of each bilibili episode doesn't include the playlist title +``` + ### Multiple inputs You can also download multiple URLs at once: diff --git a/config/config.go b/config/config.go index 81f88bdf9..be215c370 100644 --- a/config/config.go +++ b/config/config.go @@ -41,6 +41,8 @@ var ( ItemEnd int // Items Define wanted items from a file or playlist. Separated by commas like: 1,5,6,8-10 Items string + // File name of each bilibili episode doesn't include the playlist title + EpisodeTitleOnly bool // Caption download captions Caption bool // YoukuCcode youku ccode diff --git a/extractors/bilibili/bilibili.go b/extractors/bilibili/bilibili.go index c40d14679..05627bb33 100644 --- a/extractors/bilibili/bilibili.go +++ b/extractors/bilibili/bilibili.go @@ -328,7 +328,11 @@ func bilibiliDownload(options bilibiliOptions) downloader.Data { } title := parser.Title(doc) if options.subtitle != "" { - title = fmt.Sprintf("%s P%d %s", title, options.page, options.subtitle) + if config.EpisodeTitleOnly { + title = fmt.Sprintf("P%d %s", options.page, options.subtitle) + } else { + title = fmt.Sprintf("%s P%d %s", title, options.page, options.subtitle) + } } err = downloader.Caption( diff --git a/main.go b/main.go index 63edfe6ab..22af618f3 100644 --- a/main.go +++ b/main.go @@ -68,6 +68,7 @@ func init() { &config.Items, "items", "", "Define wanted items from a file or playlist. Separated by commas like: 1,5,6,8-10", ) + flag.BoolVar(&config.EpisodeTitleOnly, "eto", false, "File name of each bilibili episode doesn't include the playlist title") flag.BoolVar(&config.Caption, "C", false, "Download captions") flag.IntVar( &config.RetryTimes, "retry", 10, "How many times to retry when the download failed",