Skip to content

Commit

Permalink
v1.15
Browse files Browse the repository at this point in the history
v1.15
  • Loading branch information
awirthy committed May 9, 2023
1 parent a64f4f6 commit 2d58ee9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
5 changes: 4 additions & 1 deletion DownloadYouTubeGo.go
Original file line number Diff line number Diff line change
Expand Up @@ -671,8 +671,11 @@ func Run_YTDLP(sMediaFolder string, sRSSFolder string, RSSTemplate string, HTTPH
PubDate := PubDateNow.Format("02/01/2006 03:04:05 -0700")
log.Printf("PubDate: " + PubDate)

// ~~~~~~~~~ Replace & in string ~~~~~~~~~~~~
jsonpayload_thumbnail_amp := strings.ReplaceAll(jsonpayload.thumbnail, "&", "&")

// ----- RSS Item Data -------
RSSItemsData := "\t\t<item>\n\t\t\t<title><![CDATA[" + jsonpayload.title + "]]></title>\n\t\t\t<description><![CDATA[" + jsonpayload.description + "]]></description>\n\t\t\t<link>" + jsonpayload.webpage_url + "</link>\n\t\t\t<guid isPermaLink=\"false\">" + jsonpayload.webpage_url + "</guid>\n\t\t\t<pubDate>" + PubDate + "</pubDate>\n\t\t\t<podcast:chapters url=\"[ITEM_CHAPTER_URL]\" type=\"application/json\"/>\n\t\t\t<itunes:subtitle><![CDATA[" + jsonpayload.uploader_url + "]]></itunes:subtitle>\n\t\t\t<itunes:summary><![CDATA[" + jsonpayload.uploader_url + "]]></itunes:summary>\n\t\t\t<itunes:author><![CDATA[" + jsonpayload.uploader_url + "]]></itunes:author>\n\t\t\t<author><![CDATA[" + jsonpayload.uploader_url + "]]></author>\n\t\t\t<itunes:image href=\"" + jsonpayload.thumbnail + "\"/>\n\t\t\t<itunes:explicit>No</itunes:explicit>\n\t\t\t<itunes:keywords>youtube</itunes:keywords>\n\t\t\t<enclosure url=\"" + HTTPHost + "podcasts/" + pChannelID + "/" + jsonpayload.id + ".mp4" + "\" type=\"video/mpeg\" length=\"" + jsonpayload.duration_string + "\"/>\n\t\t\t<podcast:person href=\"" + jsonpayload.channel_url + "\" img=\"" + jsonpayload.thumbnail + "\">" + jsonpayload.uploader_url + "</podcast:person>\n\t\t\t<podcast:images srcset=\"" + jsonpayload.thumbnail + " 2000w\"/>\n\t\t\t<itunes:duration>" + jsonpayload.duration_string + "</itunes:duration>\n\t\t</item>\n<!-- INSERT_ITEMS_HERE -->"
RSSItemsData := "\t\t<item>\n\t\t\t<title><![CDATA[" + jsonpayload.title + "]]></title>\n\t\t\t<description><![CDATA[" + jsonpayload.description + "]]></description>\n\t\t\t<link>" + jsonpayload.webpage_url + "</link>\n\t\t\t<guid isPermaLink=\"false\">" + jsonpayload.webpage_url + "</guid>\n\t\t\t<pubDate>" + PubDate + "</pubDate>\n\t\t\t<podcast:chapters url=\"[ITEM_CHAPTER_URL]\" type=\"application/json\"/>\n\t\t\t<itunes:subtitle><![CDATA[" + jsonpayload.uploader_url + "]]></itunes:subtitle>\n\t\t\t<itunes:summary><![CDATA[" + jsonpayload.uploader_url + "]]></itunes:summary>\n\t\t\t<itunes:author><![CDATA[" + jsonpayload.uploader_url + "]]></itunes:author>\n\t\t\t<author><![CDATA[" + jsonpayload.uploader_url + "]]></author>\n\t\t\t<itunes:image href=\"" + jsonpayload_thumbnail_amp + "\"/>\n\t\t\t<itunes:explicit>No</itunes:explicit>\n\t\t\t<itunes:keywords>youtube</itunes:keywords>\n\t\t\t<enclosure url=\"" + HTTPHost + "podcasts/" + pChannelID + "/" + jsonpayload.id + ".mp4" + "\" type=\"video/mpeg\" length=\"" + jsonpayload.duration_string + "\"/>\n\t\t\t<podcast:person href=\"" + jsonpayload.channel_url + "\" img=\"" + jsonpayload_thumbnail_amp + "\">" + jsonpayload.uploader_url + "</podcast:person>\n\t\t\t<podcast:images srcset=\"" + jsonpayload_thumbnail_amp + " 2000w\"/>\n\t\t\t<itunes:duration>" + jsonpayload.duration_string + "</itunes:duration>\n\t\t</item>\n<!-- INSERT_ITEMS_HERE -->"
RSSData = strings.ReplaceAll(RSSData, "<!-- INSERT_ITEMS_HERE -->", RSSItemsData)

// -- Add Data to RSS File -----
Expand Down
2 changes: 1 addition & 1 deletion DownloadYouTubeGo.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# /etc/cron.d/ytdl
#
# go run TEST-Go.go
go run /opt/DownloadYouTubeGo/DownloadYouTubeGo-1.14/DownloadYouTubeGo.go >> /proc/1/fd/1;
go run /opt/DownloadYouTubeGo/DownloadYouTubeGo-1.15/DownloadYouTubeGo.go >> /proc/1/fd/1;
echo "DONE" >> /proc/1/fd/1;
6 changes: 3 additions & 3 deletions dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin
RUN export GO111MODULE=on
RUN cp /usr/share/zoneinfo/Australia/Melbourne /etc/localtime
RUN echo "Australia/Melbourne" > /etc/timezone
RUN wget -O /tmp/DownloadYouTubeGo.tar.gz https://github.com/awirthy/DownloadYouTubeGo/archive/refs/tags/v1.14.tar.gz
RUN wget -O /tmp/DownloadYouTubeGo.tar.gz https://github.com/awirthy/DownloadYouTubeGo/archive/refs/tags/v1.15.tar.gz
RUN mkdir -p /opt/DownloadYouTubeGo
RUN tar zxf /tmp/DownloadYouTubeGo.tar.gz -C /opt/DownloadYouTubeGo
RUN echo "#!/bin/sh" >> /etc/periodic/15min/DownloadYouTubeGo
RUN echo "/opt/DownloadYouTubeGo/DownloadYouTubeGo-1.14/DownloadYouTubeGo.sh" >> /etc/periodic/15min/DownloadYouTubeGo
RUN chmod 755 /opt/DownloadYouTubeGo/DownloadYouTubeGo-1.14/DownloadYouTubeGo.sh
RUN echo "/opt/DownloadYouTubeGo/DownloadYouTubeGo-1.15/DownloadYouTubeGo.sh" >> /etc/periodic/15min/DownloadYouTubeGo
RUN chmod 755 /opt/DownloadYouTubeGo/DownloadYouTubeGo-1.15/DownloadYouTubeGo.sh
RUN chmod 755 /etc/periodic/15min/DownloadYouTubeGo
CMD ["crond", "-f","-l","8"]

Expand Down

0 comments on commit 2d58ee9

Please sign in to comment.