From 41c80dbd23229444676afbccba23d662ee785d26 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Fri, 23 Nov 2018 14:44:18 -0800 Subject: [PATCH] Ignore missing podcasts --- overcast.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/overcast.php b/overcast.php index 861a8b4..8884c77 100644 --- a/overcast.php +++ b/overcast.php @@ -138,6 +138,12 @@ function fetchPodcast($id) { $body = fetch("https://overcast.fm/" . $id); + preg_match('/Sorry, not found\./', $body, $matches); + if (isset($matches[0])) { + $memcache->set($key, serialize(NULL), time() + 86400); + return NULL; + } + libxml_use_internal_errors(true); $dom = new DOMDocument(); @@ -185,6 +191,7 @@ function fetchEpisode($id) { preg_match('/Sorry, not found\./', $body, $matches); if (isset($matches[0])) { + $memcache->set($key, serialize(NULL)); return NULL; }