diff options
author | Evgeny Kuznetsov <evgeny@kuznetsov.md> | 2019-06-23 15:08:20 +0300 |
---|---|---|
committer | Evgeny Kuznetsov <evgeny@kuznetsov.md> | 2019-06-23 15:08:20 +0300 |
commit | 6692e82ad3326e6179f286fc625aa4793b1c55c8 (patch) | |
tree | 0322a87aabb59a6cb48b44049adf8a359a3a0f30 /main.go | |
parent | e7fb1caf33a31af9af4a65363289ce29d512a1cf (diff) | |
download | radiorus-rss-6692e82ad3326e6179f286fc625aa4793b1c55c8.tar.gz radiorus-rss-6692e82ad3326e6179f286fc625aa4793b1c55c8.zip |
add check for non-audio-containing episode
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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]) |