From 623a5971d96bd0c4237003dcbc5948caa525ac74 Mon Sep 17 00:00:00 2001 From: Niko Storni Date: Wed, 25 Apr 2018 15:43:20 -0400 Subject: [PATCH] human readable video names --- ytsync/sources/youtubeVideo.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ytsync/sources/youtubeVideo.go b/ytsync/sources/youtubeVideo.go index 15c87a2..8004357 100644 --- a/ytsync/sources/youtubeVideo.go +++ b/ytsync/sources/youtubeVideo.go @@ -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]+`)