From 6692e82ad3326e6179f286fc625aa4793b1c55c8 Mon Sep 17 00:00:00 2001 From: Evgeny Kuznetsov Date: Sun, 23 Jun 2019 15:08:20 +0300 Subject: add check for non-audio-containing episode --- main.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'main.go') diff --git a/main.go b/main.go index 489d2bb..d52005c 100644 --- a/main.go +++ b/main.go @@ -81,6 +81,9 @@ func main() { feed.Description = string(re.ReplaceAll(programAbout, []byte(``))) for _, episode := range episodes { + if len(episodeUrlRe.FindAllSubmatch(episode, -1)) > 1 { + log.Fatal("Page looks strange. Episode in progress?") + } episodeUrl := "http://www.radiorus.ru/brand/" + string(episodeUrlRe.FindSubmatch(episode)[1]) episodeTitle := string(episodeTitleRe.FindSubmatch(episode)[1]) episodeAudioUrl := "https://audio.vgtrk.com/download?id=" + string(episodeAudioRe.FindSubmatch(episode)[1]) -- cgit v1.2.3