From 034e3adabe680f973c1ba3207d27e504e07fb4c5 Mon Sep 17 00:00:00 2001 From: HeshamTB Date: Sun, 9 Jun 2024 15:05:12 +0300 Subject: [PATCH] feed: unexport utils func feedErr Signed-off-by: HeshamTB --- feed/feed.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/feed/feed.go b/feed/feed.go index 1eb3c9b..b745d14 100644 --- a/feed/feed.go +++ b/feed/feed.go @@ -17,7 +17,6 @@ import ( const ( YT_FEED_URL = "https://www.youtube.com/feeds/videos.xml?channel_id=%s" - YT_FEED_SAM = "https://www.youtube.com/feeds/videos.xml?channel_id=UC5Uxq95L6K60XVdNPmUxoYA" YT_VIDEO_URL = "https://youtube.com/watch?v=%s" __GENERATOR_NAME = "yttopodcast - H.B." ) @@ -36,7 +35,7 @@ func ConvertYtToRss(w io.Writer, channel_id string, bounce_url string, meta RSSM channelUrl := fmt.Sprintf(YT_FEED_URL, channel_id) feed, err := getFeed(channelUrl) if err != nil { - return FeedErr(err) + return feedErr(err) } t_now := time.Now().UTC() @@ -107,18 +106,19 @@ func ConvertYtToRss(w io.Writer, channel_id string, bounce_url string, meta RSSM rssTemplate.Execute(&rssResult, podFeed) _, err = gofeed.NewParser().ParseString(rssResult.String()) if err != nil { - return FeedErr(err) + return feedErr(err) } return nil } +// Convert to Yt Atom to RSS given a Reader that provides xml func convertAtomToRSS(w io.Writer, r io.Reader, meta RSSMetadata) error { var podFeed templates.FeedData feed, err := gofeed.NewParser().Parse(r) if err != nil { - return FeedErr(err) + return feedErr(err) } t_now := time.Now().UTC() @@ -189,13 +189,13 @@ func convertAtomToRSS(w io.Writer, r io.Reader, meta RSSMetadata) error { rssTemplate.Execute(&rssResult, podFeed) _, err = gofeed.NewParser().ParseString(rssResult.String()) if err != nil { - return FeedErr(err) + return feedErr(err) } return nil } -func FeedErr(err error) error { +func feedErr(err error) error { httpErr, ok := err.(gofeed.HTTPError) if ok { switch httpErr.StatusCode {