use local timezone for youtube-dl, even though its not certain
This commit is contained in:
parent
70ad891dfa
commit
a05864404d
1 changed files with 3 additions and 1 deletions
|
@ -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) {
|
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 {
|
if err != nil {
|
||||||
return nil, errors.Err(err)
|
return nil, errors.Err(err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue