aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorEvgeny Kuznetsov <evgeny@kuznetsov.md>2019-06-23 15:08:20 +0300
committerEvgeny Kuznetsov <evgeny@kuznetsov.md>2019-06-23 15:08:20 +0300
commit6692e82ad3326e6179f286fc625aa4793b1c55c8 (patch)
tree0322a87aabb59a6cb48b44049adf8a359a3a0f30 /main.go
parente7fb1caf33a31af9af4a65363289ce29d512a1cf (diff)
downloadradiorus-rss-6692e82ad3326e6179f286fc625aa4793b1c55c8.tar.gz
radiorus-rss-6692e82ad3326e6179f286fc625aa4793b1c55c8.zip
add check for non-audio-containing episode
Diffstat (limited to 'main.go')
-rw-r--r--main.go3
1 files changed, 3 insertions, 0 deletions
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])