From 45323c2b2f99986628d3a69e8a32316b1330a8c1 Mon Sep 17 00:00:00 2001 From: Thomas Dalichow <2012-02-05.github.com@thomasdalichow.de> Date: Fri, 1 Dec 2017 17:28:57 +0100 Subject: [PATCH] Fake user agent as Mixcloud blocks certain User-Agents --- bridges/MixCloudBridge.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bridges/MixCloudBridge.php b/bridges/MixCloudBridge.php index aa6340a1..e145e047 100644 --- a/bridges/MixCloudBridge.php +++ b/bridges/MixCloudBridge.php @@ -4,7 +4,7 @@ class MixCloudBridge extends BridgeAbstract { const MAINTAINER = 'Alexis CHEMEL'; const NAME = 'MixCloud'; - const URI = 'https://mixcloud.com/'; + const URI = 'https://www.mixcloud.com/'; const CACHE_TIMEOUT = 3600; // 1h const DESCRIPTION = 'Returns latest musics on user stream'; @@ -24,7 +24,8 @@ class MixCloudBridge extends BridgeAbstract { } public function collectData(){ - + ini_set('user_agent', 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0'); + $html = getSimpleHTMLDOM(self::URI . $this->getInput('u')) or returnServerError('Could not request MixCloud.');