Handle download lists part 1

This commit is contained in:
Uli Koeth 2017-03-07 17:24:34 +01:00
parent c9341acfb9
commit 03cf506132
3 changed files with 89 additions and 81 deletions

View file

@ -113,7 +113,14 @@ class VideoDownload
* */
public function getJSON($url, $format = null, $password = null)
{
return json_decode($this->getProp($url, $format, 'dump-json', $password));
$jsonArray = preg_split( "/\r|\n/", $this->getProp($url, $format, 'dump-json', $password), -1,
PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
$decodedJson = array();
foreach ($jsonArray as $oneJson)
{
array_push($decodedJson, json_decode($oneJson));
}
return $decodedJson;
}
/**