From 75b85f61e792ab99d960bf79852ad10275838b6e Mon Sep 17 00:00:00 2001 From: Joseph Date: Tue, 16 Mar 2021 13:00:26 +0000 Subject: [PATCH] [BandcampBridge] Fix title extraction on empty band pages (#1966) --- bridges/BandcampBridge.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bridges/BandcampBridge.php b/bridges/BandcampBridge.php index fa07146582a..321e1f04cd1 100644 --- a/bridges/BandcampBridge.php +++ b/bridges/BandcampBridge.php @@ -125,9 +125,11 @@ public function collectData(){ case 'By album': $html = getSimpleHTMLDOMCached($this->getURI(), 86400); - $titleElement = $html->find('head meta[name=title]', 0) - or returnServerError('Unable to find title on: ' . $this->getURI()); - $this->feedName = $titleElement->content; + if ($html->find('meta[name=title]', 0)) { + $this->feedName = $html->find('meta[name=title]', 0)->content; + } else { + $this->feedName = str_replace('Music | ', '', $html->find('title', 0)->plaintext); + } $regex = '/band_id=(\d+)/'; if(preg_match($regex, $html, $matches) == false)