aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2021-01-16 00:04:21 -0500
committerJesús <heckyel@hyperbola.info>2021-01-16 00:04:21 -0500
commit8cd5713c496aff7f2f5880c01562627da1d7f156 (patch)
treed451c15356748c4520b907aed1e913a67bc48f78
parent0f994b7555d03af75dd2fef578aacca4d9139d9d (diff)
downloadytexplode-8cd5713c496aff7f2f5880c01562627da1d7f156.tar.lz
ytexplode-8cd5713c496aff7f2f5880c01562627da1d7f156.tar.xz
ytexplode-8cd5713c496aff7f2f5880c01562627da1d7f156.zip
Fix json_encode and add size
-rw-r--r--index.php13
1 files changed, 8 insertions, 5 deletions
diff --git a/index.php b/index.php
index cf9d396..2ab73e8 100644
--- a/index.php
+++ b/index.php
@@ -470,7 +470,8 @@ if (isset($_GET['id'])) {
'fps' => $stream['fps'],
'resolution' => $stream['qualityLabel'],
'qualityLabel' => $stream['qualityLabel'],
- 'format' => exformat($stream['itag'])
+ 'format' => exformat($stream['itag']),
+ 'size' => $stream['width'].'x'.$stream['height'],
);
array_push($vdef, $values);
} else {
@@ -500,6 +501,7 @@ if (isset($_GET['id'])) {
'resolution' => $stream['qualityLabel'],
'qualityLabel' => $stream['qualityLabel'],
'format' => exformat($stream['itag']),
+ 'size' => $stream['width'].'x'.$stream['height'],
);
array_push($vid, $values);
}
@@ -537,13 +539,14 @@ if (isset($_GET['id'])) {
'resolution' => $stream['qualityLabel'],
'qualityLabel' => $stream['qualityLabel'],
'format' => exformat($stream['itag']),
+ 'size' => $stream['width'].'x'.$stream['height'],
);
array_push($vid, $values);
}
}
}
$json['adaptiveFormats'] = array_merge($vid, $aud);
- $json['formatStreams']=$vdef;
+ $json['formatStreams'] = $vdef;
// $json['audio']=$aud;
// $json['video']=$vid;
} else {
@@ -552,12 +555,12 @@ if (isset($_GET['id'])) {
$vid = array();
$json['adaptiveFormats'] = array_merge($vid, $aud);
- $json['formatStreams']=$vdef;
+ $json['formatStreams'] = $vdef;
// $json['audio']=$aud;
// $json['video']=$vid;
}
-
- echo json_encode($json, JSON_FORCE_OBJECT);
+ // echo json_encode($json, JSON_FORCE_OBJECT);
+ echo json_encode($json);
// echo json_encode($streamin_data_json, JSON_FORCE_OBJECT);
} else {
$json = array(