Skip to content

Commit

Permalink
utils: ⬆️ title escaping rules
Browse files Browse the repository at this point in the history
  • Loading branch information
iawia002 committed May 11, 2018
1 parent f4a1bfa commit 3d91639
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion extractors/bilibili/bilibili.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ func bilibiliDownload(url string, options bilibiliOptions) downloader.VideoData
}
extractedData := downloader.VideoData{
Site: "哔哩哔哩 bilibili.com",
Title: title,
Title: utils.FileName(title),
Type: "video",
Formats: format,
}
Expand Down
2 changes: 1 addition & 1 deletion utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func Domain(url string) string {

// FileName Converts a string to a valid filename
func FileName(name string) string {
rep := strings.NewReplacer("\n", " ", "/", " ", "|", "-", ": ", ":", ":", ":")
rep := strings.NewReplacer("\n", " ", "/", " ", "|", "-", ": ", ":", ":", ":", "'", "’")
name = rep.Replace(name)
if runtime.GOOS == "windows" {
rep = strings.NewReplacer("\"", " ", "?", " ", "*", " ", "\\", " ", "<", " ", ">", " ")
Expand Down

0 comments on commit 3d91639

Please sign in to comment.