human readable video names

This commit is contained in:
Niko Storni 2018-04-25 15:43:20 -04:00
parent e976cd0fa0
commit 623a5971d9

View file

@ -59,10 +59,10 @@ func (v YoutubeVideo) PublishedAt() time.Time {
}
func (v YoutubeVideo) getFilename() string {
return v.dir + "/" + v.id + ".mp4"
return v.dir + "/" + v.getClaimName() + ".mp4"
}
func (v YoutubeVideo) getClaimName(attempt int) string {
func (v YoutubeVideo) getClaimName() string {
maxLen := 40
reg := regexp.MustCompile(`[^a-zA-Z0-9]+`)