diff --git a/sources/youtubeVideo.go b/sources/youtubeVideo.go index fd85bf1..b7cf793 100644 --- a/sources/youtubeVideo.go +++ b/sources/youtubeVideo.go @@ -90,7 +90,9 @@ var youtubeCategories = map[string]string{ } func NewYoutubeVideo(directory string, videoData *ytdl.YtdlVideo, playlistPosition int64, awsConfig aws.Config, stopGroup *stop.Group, pool *ip_manager.IPPool) (*YoutubeVideo, error) { - publishedAt, err := time.Parse("20060102", videoData.UploadDate) + // youtube-dl returns times in local timezone sometimes. this could break in the future + // maybe we can file a PR to choose the timezone we want from youtube-dl + publishedAt, err := time.ParseInLocation("20060102", videoData.UploadDate, time.Local) if err != nil { return nil, errors.Err(err) }