aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2021-01-17 20:53:07 -0500
committerJesús <heckyel@hyperbola.info>2021-01-17 20:53:07 -0500
commit412456c1e57efda8a11dd16af18d3b452622d9b3 (patch)
treefba12a3764616b26ff7925697c04cb9b854cf59c
parent8cd5713c496aff7f2f5880c01562627da1d7f156 (diff)
downloadytexplode-412456c1e57efda8a11dd16af18d3b452622d9b3.tar.lz
ytexplode-412456c1e57efda8a11dd16af18d3b452622d9b3.tar.xz
ytexplode-412456c1e57efda8a11dd16af18d3b452622d9b3.zip
Fix streams duplicate
-rw-r--r--index.php15
1 files changed, 3 insertions, 12 deletions
diff --git a/index.php b/index.php
index 2ab73e8..ad6fdb1 100644
--- a/index.php
+++ b/index.php
@@ -491,9 +491,8 @@ if (isset($_GET['id'])) {
foreach ($strF as $stream) {
if (isset( $stream['url'] )) {
if (preg_match('/video/', $stream['mimeType'])) {
- $url = $stream['url'];
$values = array(
- 'url' => $url,
+ 'url' => $stream['url'],
'itag' => $stream['itag'],
'type' => $stream['mimeType'],
'quality' => $stream['quality'],
@@ -503,7 +502,7 @@ if (isset($_GET['id'])) {
'format' => exformat($stream['itag']),
'size' => $stream['width'].'x'.$stream['height'],
);
- array_push($vid, $values);
+ array_push($vdef, $values);
}
}
}
@@ -529,9 +528,8 @@ if (isset($_GET['id'])) {
}
if (preg_match('/video/', $stream['mimeType'])) {
- $url = $stream['url'];
$values = array(
- 'url' => $url,
+ 'url' => $stream['url'],
'itag' => $stream['itag'],
'type' => $stream['mimeType'],
'quality' => $stream['quality'],
@@ -547,21 +545,14 @@ if (isset($_GET['id'])) {
}
$json['adaptiveFormats'] = array_merge($vid, $aud);
$json['formatStreams'] = $vdef;
- // $json['audio']=$aud;
- // $json['video']=$vid;
} else {
$vdef = array();
$aud = array();
$vid = array();
-
$json['adaptiveFormats'] = array_merge($vid, $aud);
$json['formatStreams'] = $vdef;
- // $json['audio']=$aud;
- // $json['video']=$vid;
}
- // echo json_encode($json, JSON_FORCE_OBJECT);
echo json_encode($json);
- // echo json_encode($streamin_data_json, JSON_FORCE_OBJECT);
} else {
$json = array(
'query' => 'none',