Skip to content
This repository has been archived by the owner on Feb 21, 2020. It is now read-only.

Commit

Permalink
Ignore missing podcasts
Browse files Browse the repository at this point in the history
  • Loading branch information
josh committed Nov 23, 2018
1 parent 7a6d425 commit 41c80db
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions overcast.php
Expand Up @@ -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();
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 41c80db

Please sign in to comment.