master
string1995 5 years ago
parent b1e2ddc271
commit d89cb6c63d
  1. 2
      etc/api/video.php
  2. 10
      etc/api/video_dogecloud_api.php
  3. 16
      etc/aplayer/setup.js
  4. 9
      etc/aplayer/setup_mini.js
  5. 130
      etc/dplayer/setup.js
  6. 131
      etc/dplayer/setup_once.js
  7. 182
      functions.php
  8. 12
      google/index.php
  9. 12
      google/search/index.php
  10. 7
      test/curl.php
  11. 10
      test/google.php
  12. 2
      test/index.php

@ -8,5 +8,5 @@ $conn=db__connect();
$result=db__getData($conn,"video","id",$id);
header('Content-type: text/json');
echo json_encode(array(id=>$result[0]['id'],series=>$result[0]['series'],name=>$result[0]['name'],type=>$result[0]['type'],url1=>$result[0]['url1'],url2=>$result[0]['url2'],idd=>$result[0]['idd']));
echo json_encode(array(id=>$result[0]['id'],series=>$result[0]['series'],name=>$result[0]['name'],type=>$result[0]['type'],url1=>$result[0]['url1'],url2=>$result[0]['url2'],idd=>$result[0]['idd'],vcode=>$result[0]['vcode']));
die();

@ -0,0 +1,10 @@
<?php
include '../../functions.php';
$vcode= $_REQUEST[vcode];
$ip= $_REQUEST[ip];
header('Content-type: text/json');
echo api__dogecloud("pch5",$vcode,$ip,$GLOBALS['dc_AccessKey'],$GLOBALS['dc_SecretKey']);

@ -0,0 +1,16 @@
// JavaScript Document
const ap = new APlayer({
container: document.getElementById('aplayer'),
mini: false,
autoplay: false,
theme: '#FADFA3',
loop: 'all',
order: 'random',
preload: 'auto',
volume: 0.7,
mutex: true,
listFolded: false,
listMaxHeight: 90,
lrcType: 3,
audio: []
});

@ -0,0 +1,9 @@
// JavaScript Document
const ap = new APlayer({
container: document.getElementById('aplayer'),
fixed: true,
loop: 'all',
order: 'random',
volume: 0.7,
audio: []
});

@ -0,0 +1,130 @@
// JavaScript Document
//global var for storing current video info
var g_vId=0;
var g_vName='';
var g_vSeries='';
var g_vType='';
var g_vUrl1='';
var g_vUrl2='';
var g_idd=0;
const dp = new DPlayer({
container: document.getElementById('dplayer'),
autoplay: false,
theme: '#1E90FF',
loop: false,
lang: 'zh-cn',
hotkey: true,
preload: 'auto',
logo: 'https://cn.yimian.xyz/etc/img/logo/logo_white.png',
volume: 0.7,
mutex: true,
video: {
url: 'https://obs-410c.obs.myhwclouds.com/video/404.mp4'
},
danmaku: {
id: 'null',
api: 'https://dans.yimian.ac.cn/',
bottom: '10%'
}
});
//lstn for recording play time to cookie
var timeUpdate_count=0;
dp.on('timeupdate',function dpTimeRecord(){if(g_vId!=234&&g_vId!=0)cookie.set('vTime_'+g_vId,dp.video.currentTime);if(timeUpdate_count++>15){ $.post("/etc/api/video_fp.php",{"fp":fp,"id":g_vId,"seek":dp.video.currentTime,"ip":returnCitySN.cip});timeUpdate_count=0;}});
//lstn for the video to the end
dp.on('ended',function dpEnd(){cookie.del('vTime_'+g_vId);nextVideo();});
//lstn error
dp.on('error',function dpError(){newVideo(234,1,6);});
//functuion for switch video by id and url
function newVideo_detail(id,url,next,seek)
{
dp.switchVideo({
url: url
},
{
id: id,
api: 'https://dans.yimian.ac.cn/',
bottom: '10%'
});
if(seek) {dp.seek(seek);dp.notice('已跳转至上次播放位置..', 3000);}
if(next) dp.play();
}
//function for create a new video
function newVideo(id,next,seek)
{
$.ajax({
type: "POST",
url: '/etc/api/video.php',
data: { "id": id},
traditional: true,
dataType: 'json',
success: function (msg){
g_vId=parseInt(msg.id);
g_vName=msg.name;
g_vSeries=msg.series;
g_vType=msg.type;
g_vUrl1=msg.url1;
g_vUrl2=msg.url2;
g_vIdd=parseInt(msg.idd);
videotoUrl(id);
if(!seek){seek=cookie.get('vTime_'+g_vId)}
newVideo_detail(msg.id,msg.url1,next,seek);
cookie.set('vWatching',g_vId);
//record video for usr
timeUpdate_count=0;
$.post("/etc/api/video_fp.php",{"fp":fp,"id":g_vId,"seek":0,"ip":returnCitySN.cip});
},
error: function (data,type, err) {
alert('Can not Get Video!');
}
});
}
//fnct for playing the next video
function nextVideo()
{
var id=g_vId;
$.ajax({
type: "POST",
url: '/etc/api/video_redirect.php',
data: { "id": id},
traditional: true,
dataType: 'json',
success: function (msg){
if(msg.id) id=msg.toid;
else id++;
newVideo(id,1);
}
});
}
//for video to redirect to other website
function videotoUrl(id)
{
$.ajax({
type: "POST",
url: '/etc/api/video_toUrl.php',
data: { "id": id},
traditional: true,
dataType: 'json',
success: function (msg){
if(!msg.id) return 0;
dp.notice(msg.hint, 4000);
setTimeout('window.location.href=\''+msg.url+'\'',4000);
}
});
}

@ -0,0 +1,131 @@
// JavaScript Document
//global var for storing current video info
var g_vName='';
var g_vSeries='';
var g_vType='';
var g_vUrl1='';
var g_vUrl2='';
var g_idd=0;
var g_vCode='';
var seek=0;
$.ajax({
type: "POST",
url: '/etc/api/video.php',
data: { "id": g_vId},
traditional: true,
dataType: 'json',
success: function (msg){
g_vId=parseInt(msg.id);
g_vName=msg.name;
g_vSeries=msg.series;
g_vType=msg.type;
g_vUrl1=msg.url1;
g_vUrl2=msg.url2;
g_vIdd=parseInt(msg.idd);
g_vCode=msg.vcode;
if(!seek){seek=cookie.get('vTime_'+g_vId)}
if(g_vCode)
{
$.ajax({
type: "POST",
url: '/etc/api/video_dogecloud_api.php',
data: { "vcode": g_vCode,"ip":returnCitySN.cip},
traditional: true,
dataType: 'json',
success: function (msg1){
var Aquality=new Array();
Aquality[0]={name:'原视频',url:g_vUrl1,type:'normal'}
for(var i=0;i<msg1.data.stream.length;i++)
Aquality[i+1]={
name:msg1.data.stream[i].name,
url:msg1.data.stream[i].url,
type:msg1.data.stream[i].format
};
const dp = new DPlayer({
container: document.getElementById('dplayer'),
autoplay: false,
theme: '#1E90FF',
loop: true,
lang: 'zh-cn',
hotkey: true,
preload: 'auto',
logo: 'https://cn.yimian.xyz/etc/img/logo/logo_white.png',
volume: 0.7,
mutex: true,
video: { quality: Aquality,
defaultQuality: 1
},
danmaku: {
id: g_vId,
api: 'https://dans.yimian.ac.cn/',
bottom: '10%'
}
});
//lstn for recording play time to cookie
var timeUpdate_count=0;
dp.on('timeupdate',function dpTimeRecord(){if(g_vId!=234&&g_vId!=0)cookie.set('vTime_'+g_vId,dp.video.currentTime);if(timeUpdate_count++>15){ $.post("/etc/api/video_fp.php",{"fp":fp,"id":g_vId,"seek":dp.video.currentTime,"ip":returnCitySN.cip});timeUpdate_count=0;}});
//lstn error
dp.on('error',function dpError(){newVideo(234,1,6);});
//record video for usr
timeUpdate_count=0;
$.post("/etc/api/video_fp.php",{"fp":fp,"id":g_vId,"seek":0,"ip":returnCitySN.cip});
}
});
}
else
{
const dp = new DPlayer({
container: document.getElementById('dplayer'),
autoplay: false,
theme: '#1E90FF',
loop: true,
lang: 'zh-cn',
hotkey: true,
preload: 'auto',
logo: 'https://cn.yimian.xyz/etc/img/logo/logo_white.png',
volume: 0.7,
mutex: true,
video: {
url: g_vUrl1
},
danmaku: {
id: g_vId,
api: 'https://dans.yimian.ac.cn/',
bottom: '10%'
}
});
//lstn for recording play time to cookie
var timeUpdate_count=0;
dp.on('timeupdate',function dpTimeRecord(){if(g_vId!=234&&g_vId!=0)cookie.set('vTime_'+g_vId,dp.video.currentTime);if(timeUpdate_count++>15){ $.post("/etc/api/video_fp.php",{"fp":fp,"id":g_vId,"seek":dp.video.currentTime,"ip":returnCitySN.cip});timeUpdate_count=0;}});
//lstn error
dp.on('error',function dpError(){newVideo(234,1,6);});
//record video for usr
timeUpdate_count=0;
$.post("/etc/api/video_fp.php",{"fp":fp,"id":g_vId,"seek":0,"ip":returnCitySN.cip});
}
},
error: function (data,type, err) {
alert('Can not Get Video!');
}
});

@ -11,6 +11,7 @@ $jquery=0;
//print a html header
function yimian__header($title="Yimian",$keywords="yimian",$description="Yimian Website")
{
echo "<!--
___ ___
@ -26,10 +27,11 @@ function yimian__header($title="Yimian",$keywords="yimian",$description="Yimian
\|__| \|__| \|__| |__| |__| \|__| \|___________| \|__| |__|
-->
";
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">
";
echo "<!doctype html>
<head>
echo "<head>
<meta charset=\"utf-8\">
<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge,chrome=1\">
<title>".$title."</title>
@ -258,23 +260,7 @@ function aplayer__setup()
{
echo "<link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/aplayer@1.10/dist/APlayer.min.css\">
<script src=\"https://cdn.jsdelivr.net/npm/aplayer@1.10/dist/APlayer.min.js\"></script>";
echo "<script>//script for setup the aplayer
const ap = new APlayer({
container: document.getElementById('aplayer'),
mini: false,
autoplay: false,
theme: '#FADFA3',
loop: 'all',
order: 'random',
preload: 'auto',
volume: 0.7,
mutex: true,
listFolded: false,
listMaxHeight: 90,
lrcType: 3,
audio: []
});
</script>";
echo "<script src=\"/etc/aplayer/setup.js\"></script>";
}
@ -284,16 +270,7 @@ function aplayer__setup_mini()
{
echo "<link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/aplayer@1.10/dist/APlayer.min.css\">
<script src=\"https://cdn.jsdelivr.net/npm/aplayer@1.10/dist/APlayer.min.js\"></script>";
echo "<script>//script for setup the aplayer
const ap = new APlayer({
container: document.getElementById('aplayer'),
fixed: true,
loop: 'all',
order: 'random',
volume: 0.7,
audio: []
});
</script>";
echo "<script src=\"/etc/aplayer/setup_mini.js\"></script>";
}
//the should put behind the setup function
@ -359,143 +336,30 @@ function dplayer__setup()
";
echo "<link rel=\"stylesheet\" href=\"https://cn.yimian.xyz/etc/dplayer/DPlayer.min.css\">
<script src=\"https://cn.yimian.xyz/etc/dplayer/DPlayer.min.js\"></script>";
echo "<script type=\"text/javascript\">//script for set up the dplayer
//global var for storing current video info
var g_vId=0;
var g_vName='';
var g_vSeries='';
var g_vType='';
var g_vUrl1='';
var g_vUrl2='';
var g_idd=0;
const dp = new DPlayer({
container: document.getElementById('dplayer'),
autoplay: false,
theme: '#1E90FF',
loop: false,
lang: 'zh-cn',
hotkey: true,
preload: 'auto',
logo: 'https://cn.yimian.xyz/etc/img/logo/logo_white.png',
volume: 0.7,
mutex: true,
video: {
url: 'https://obs-410c.obs.myhwclouds.com/video/404.mp4'
},
danmaku: {
id: 'null',
api: 'https://dans.yimian.ac.cn/',
bottom: '10%'
}
});
//lstn for recording play time to cookie
var timeUpdate_count=0;
dp.on('timeupdate',function dpTimeRecord(){if(g_vId!=234&&g_vId!=0)cookie.set('vTime_'+g_vId,dp.video.currentTime);if(timeUpdate_count++>15){ $.post(\"/etc/api/video_fp.php\",{\"fp\":fp,\"id\":g_vId,\"seek\":dp.video.currentTime,\"ip\":returnCitySN.cip});timeUpdate_count=0;}});
//lstn for the video to the end
dp.on('ended',function dpEnd(){cookie.del('vTime_'+g_vId);nextVideo();});
//lstn error
dp.on('error',function dpError(){newVideo(234,1,6);});
//functuion for switch video by id and url
function newVideo_detail(id,url,next,seek)
{
dp.switchVideo({
url: url
},
{
id: id,
api: 'https://dans.yimian.ac.cn/',
bottom: '10%'
});
if(seek) {dp.seek(seek);dp.notice('已跳转至上次播放位置..', 3000);}
if(next) dp.play();
}
//function for create a new video
function newVideo(id,next,seek)
{
$.ajax({
type: \"POST\",
url: '/etc/api/video.php',
data: { \"id\": id},
traditional: true,
dataType: 'json',
success: function (msg){
g_vId=parseInt(msg.id);
g_vName=msg.name;
g_vSeries=msg.series;
g_vType=msg.type;
g_vUrl1=msg.url1;
g_vUrl2=msg.url2;
g_vIdd=parseInt(msg.idd);
videotoUrl(id);
if(!seek){seek=cookie.get('vTime_'+g_vId)}
newVideo_detail(msg.id,msg.url1,next,seek);
cookie.set('vWatching',g_vId);
//record video for usr
timeUpdate_count=0;
$.post(\"/etc/api/video_fp.php\",{\"fp\":fp,\"id\":g_vId,\"seek\":0,\"ip\":returnCitySN.cip});
},
error: function (data,type, err) {
alert('Can not Get Video!');
}
});
echo "<script type=\"text/javascript\" src=\"/etc/dplayer/setup.js\"></script>
";
echo "<script src=\"https://pv.sohu.com/cityjson?ie=utf-8\"></script>";
}
//fnct for playing the next video
function nextVideo()
{
var id=g_vId;
$.ajax({
type: \"POST\",
url: '/etc/api/video_redirect.php',
data: { \"id\": id},
traditional: true,
dataType: 'json',
success: function (msg){
if(msg.id) id=msg.toid;
else id++;
newVideo(id,1);
}
});
}
//for video to redirect to other website
function videotoUrl(id)
//this should put at the near the need of a body,
//the js object name is dp.
function dplayer__setup_once($id)
{
$.ajax({
type: \"POST\",
url: '/etc/api/video_toUrl.php',
data: { \"id\": id},
traditional: true,
dataType: 'json',
success: function (msg){
if(!msg.id) return 0;
dp.notice(msg.hint, 4000);
setTimeout('window.location.href=\''+msg.url+'\'',4000);
}
});
}
echo "<script src=\"https://pv.sohu.com/cityjson?ie=utf-8\"></script>
<script src=\"https://cdn.bootcss.com/hls.js/0.10.1/hls.min.js\"></script>
";
echo "<link rel=\"stylesheet\" href=\"https://cn.yimian.xyz/etc/dplayer/DPlayer.min.css\">
<script src=\"https://cn.yimian.xyz/etc/dplayer/DPlayer.min.js\"></script>";
echo "<script type=\"text/javascript\">//script for set up the dplayer
//global var for storing current video info
var g_vId=$id;
</script>
<script src=\"/etc/dplayer/setup_once.js\"></script>
";
echo "<script src=\"https://pv.sohu.com/cityjson?ie=utf-8\"></script>";
}
//this should put behind the setup function
function dplayer__add($id="234")
{
@ -515,7 +379,7 @@ function api__dogecloud($platform,$vcode,$ip,$AccessKey,$SecretKey){
$url="https://api.dogecloud.com/video/streams.json?platform=$platform&vcode=$vcode&ip=$ip";
$str="/video/streams.json?platform=pch5&vcode=7119902f856c85a0&ip=49.64.195.241"."\n";
$str="/video/streams.json?platform=$platform&vcode=$vcode&ip=$ip"."\n";
$str = hash_hmac("sha1", $str, $SecretKey);
@ -540,5 +404,3 @@ function api__dogecloud($platform,$vcode,$ip,$AccessKey,$SecretKey){

@ -0,0 +1,12 @@
<?php
$url="https://www.google.com";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, TRUE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, TRUE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
echo curl_exec($ch);
curl_close($ch);

@ -0,0 +1,12 @@
<?php
$url="https://www.google.com/search";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, TRUE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, TRUE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
echo curl_exec($ch);
curl_close($ch);

@ -2,18 +2,19 @@
$AccessKey = "caa81f2271eeeb10";
$SecretKey = "91e74d006107bee0ea9ba99f5e657853";
include '../functions.php';
echo api__dogecloud("pch5","7119902f856c85a0","49.64.195.241",$AccessKey,$SecretKey);
echo api__dogecloud("pch5","667ff10c1dcbcb6f","49.64.195.241",$AccessKey,$SecretKey);
//fnct for dogecloud API
function api__dogecloud($platform,$vcode,$ip,$AccessKey,$SecretKey){
$url="https://api.dogecloud.com/video/streams.json?platform=$platform&vcode=$vcode&ip=$ip";
$str="/video/streams.json?platform=pch5&vcode=7119902f856c85a0&ip=49.64.195.241"."\n";
$str="/video/streams.json?platform=$platform&vcode=$vcode&ip=$ip"."\n";
$str = hash_hmac("sha1", $str, $SecretKey);

@ -0,0 +1,10 @@
<?php
$url="https://www.google.com";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, TRUE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, TRUE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
echo curl_exec($ch);
curl_close($ch);

@ -7,7 +7,7 @@
<script>$(document).pjax('a', '#content');//alert(fp);</script>
<?php dplayer__element()?>
<?php dplayer__setup()?>
<?php dplayer__add($_GET['id'])?>
<?php dplayer__add(324)?>
<button onClick="nextVideo()">hhh</button>
<?php aplayer__element()?>

Loading…
Cancel
Save