[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.
This commit is contained in:
logmanoriginal 2016-11-05 12:48:58 +01:00
parent 5790ebc6ba
commit 8924722b93
1 changed files with 6 additions and 5 deletions

View File

@ -60,15 +60,16 @@
$url = self::URI.'guide/'.$lang.'/plus7/'.$category; $url = self::URI.'guide/'.$lang.'/plus7/'.$category;
$input = getContents($url) or die('Could not request ARTE.'); $input = getContents($url) or die('Could not request ARTE.');
if(strpos($input, 'categoryVideoSet') !== FALSE){ if(strpos($input, 'categoryVideoSet') !== FALSE){
$input = explode('categoryVideoSet: ', $input); $input = explode('categoryVideoSet="', $input);
$input = explode('}},', $input[1]); $input = explode('}}', $input[1]);
$input = $input[0].'}}'; $input = $input[0].'}}';
}else{ }else{
$input = explode('videoSet: ', $input); $input = explode('videoSet="', $input);
$input = explode('}]},', $input[1]); $input = explode('}]}', $input[1]);
$input = $input[0].'}]}'; $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) { foreach($input_json['videos'] as $element) {
$item = array(); $item = array();