瀏覽代碼

Fix videos widget channel URL

Svilen Markov 11 月之前
父節點
當前提交
f76e06ec57
共有 1 個文件被更改,包括 3 次插入5 次删除
  1. 3 5
      internal/feed/youtube.go

+ 3 - 5
internal/feed/youtube.go

@@ -11,10 +11,8 @@ import (
 
 
 type youtubeFeedResponseXml struct {
 type youtubeFeedResponseXml struct {
 	Channel     string `xml:"author>name"`
 	Channel     string `xml:"author>name"`
-	ChannelLink struct {
-		Href string `xml:"href,attr"`
-	} `xml:"link"`
-	Videos []struct {
+	ChannelLink string `xml:"author>uri"`
+	Videos      []struct {
 		Title     string `xml:"title"`
 		Title     string `xml:"title"`
 		Published string `xml:"published"`
 		Published string `xml:"published"`
 		Link      struct {
 		Link      struct {
@@ -97,7 +95,7 @@ func FetchYoutubeChannelUploads(channelIds []string, videoUrlTemplate string, in
 				Title:        video.Title,
 				Title:        video.Title,
 				Url:          videoUrl,
 				Url:          videoUrl,
 				Author:       response.Channel,
 				Author:       response.Channel,
-				AuthorUrl:    response.ChannelLink.Href + "/videos",
+				AuthorUrl:    response.ChannelLink + "/videos",
 				TimePosted:   parseYoutubeFeedTime(video.Published),
 				TimePosted:   parseYoutubeFeedTime(video.Published),
 			})
 			})
 		}
 		}