From 8924722b934e9a59f848fda9aedfab1550cf3978 Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Sat, 5 Nov 2016 12:48:58 +0100 Subject: [PATCH] [Arte7] Fix content parsing Elements are now put into separate JSON containers. As such assignment changed from : to = and as only one container is present in each element, the final , is omitted. JSON data is html encoded and requires decoding before decoding via json_decode. --- bridges/Arte7Bridge.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/bridges/Arte7Bridge.php b/bridges/Arte7Bridge.php index 0fcb793..442ef71 100644 --- a/bridges/Arte7Bridge.php +++ b/bridges/Arte7Bridge.php @@ -60,15 +60,16 @@ $url = self::URI.'guide/'.$lang.'/plus7/'.$category; $input = getContents($url) or die('Could not request ARTE.'); if(strpos($input, 'categoryVideoSet') !== FALSE){ - $input = explode('categoryVideoSet: ', $input); - $input = explode('}},', $input[1]); + $input = explode('categoryVideoSet="', $input); + $input = explode('}}', $input[1]); $input = $input[0].'}}'; }else{ - $input = explode('videoSet: ', $input); - $input = explode('}]},', $input[1]); + $input = explode('videoSet="', $input); + $input = explode('}]}', $input[1]); $input = $input[0].'}]}'; } - $input_json = json_decode($input, TRUE); + + $input_json = json_decode(html_entity_decode($input, ENT_QUOTES), TRUE); foreach($input_json['videos'] as $element) { $item = array();