1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-07-30 21:30:14 +02:00

bridges: remove redundant "or returnServerError" after getContents/getSimpleHTMLDom/getSimpleHTMLDomCached (#2398)

When fetching website contents, exceptions already raise on fetching error
This commit is contained in:
Eugene Molotov
2022-01-02 14:36:09 +05:00
committed by GitHub
parent fc51c6753d
commit 37cb4091d4
201 changed files with 262 additions and 513 deletions

View File

@@ -39,8 +39,7 @@ class SoundCloudBridge extends BridgeAbstract {
private $widgetRegex = '/widget-.+?\.js/';
public function collectData() {
$res = $this->getUser($this->getInput('u'))
or returnServerError('No results for this query');
$res = $this->getUser($this->getInput('u'));
$this->feedTitle = $res->username;
$this->feedIcon = $res->avatar_url;
@@ -136,8 +135,7 @@ HTML;
private function refreshClientID(){
$this->initClientIDCache();
$playerHTML = getContents($this->playerUrl)
or returnServerError('Unable to get player page.');
$playerHTML = getContents($this->playerUrl);
// Extract widget JS filenames from player page
if(preg_match_all($this->widgetRegex, $playerHTML, $matches) == false)
@@ -149,8 +147,7 @@ HTML;
foreach ($matches[0] as $widgetFile) {
$widgetURL = $this->widgetUrl . $widgetFile;
$widgetJS = getContents($widgetURL)
or returnServerError('Unable to get widget JS page.');
$widgetJS = getContents($widgetURL);
if(preg_match($this->clientIdRegex, $widgetJS, $matches)) {
$clientID = $matches[1];