mirror of https://github.com/IoTcat/acg.watch.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
743 B
48 lines
743 B
4 years ago
|
<?php
|
||
|
include '../functions.php';
|
||
|
|
||
|
$url = $_REQUEST['url'];
|
||
|
|
||
|
if(!isset($url)) die();
|
||
|
|
||
|
$conn = db__connect();
|
||
|
|
||
|
if(!db__rowNum($conn, "video", "url", $url)) {
|
||
|
echo json_encode(array(
|
||
|
quality => array(
|
||
|
name => "首选",
|
||
|
url => $url
|
||
|
),
|
||
|
danmaku => substr(md5($url), 0, 8)
|
||
|
));
|
||
|
die();
|
||
|
}
|
||
|
|
||
|
|
||
|
$res = db__getData($conn, "video", "url", $url);
|
||
|
|
||
|
$arr = Array();
|
||
|
|
||
|
array_push($arr, array(
|
||
|
name => "首选",
|
||
|
url => $url
|
||
|
|
||
|
));
|
||
|
|
||
|
for($i = 1; $i <= 3; $i ++){
|
||
|
if($res[0]["url".$i] !== ""){
|
||
|
array_push($arr, array(
|
||
|
name => "备选".$i,
|
||
|
url => $res[0]["url".$i]
|
||
|
));
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
echo json_encode(Array(
|
||
|
quality => $arr,
|
||
|
danmaku => substr(md5($res[0]['vid']),0, 8)
|
||
|
));
|