speed up api

master
IoTgod 5 years ago
parent ac89de3334
commit a464e90ade
  1. 62
      server/cn/etc/nginx/nginx.conf
  2. 6
      server/cn/home/www/cdn/clever-login/clever-login.min.js
  3. 10
      server/cn/home/www/cdn/dplayer/setup.js
  4. 16
      server/cn/home/www/cdn/dplayer/setup_once.js
  5. 2
      server/cn/home/www/etc/video/mainlist.html

@ -627,6 +627,68 @@ http {
}
server {
listen 443 ssl;
listen 80;
server_name video.api.yimian.xyz; #1
root /home/www/api/video;
index index.php index.html;
client_max_body_size 1000M;
ssl_certificate /etc/letsencrypt/live/video.api.yimian.xyz/fullchain.pem; #2
ssl_certificate_key /etc/letsencrypt/live/video.api.yimian.xyz/privkey.pem; #3
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
error_page 404 = /404.php;
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
server {
listen 443 ssl;
listen 80;
server_name login.api.yimian.xyz; #1
root /home/www/api/clever-login;
index index.php index.html;
client_max_body_size 1000M;
ssl_certificate /etc/letsencrypt/live/login.api.yimian.xyz/fullchain.pem; #2
ssl_certificate_key /etc/letsencrypt/live/login.api.yimian.xyz/privkey.pem; #3
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
error_page 404 = /404.php;
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
server {
listen 443 ssl;
listen 80;

@ -116,7 +116,7 @@ function reg()
}
$.ajax({
url: 'https://api.yimian.xyz/clever-login/record_usr.php',
url: 'https://login.api.yimian.xyz/record_usr.php',
type: 'post',
dataType: 'json',
async: true,
@ -157,7 +157,7 @@ function reg()
{
$.ajax({
url: 'https://api.yimian.xyz/clever-login/record_usrName.php',
url: 'https://login.api.yimian.xyz/record_usrName.php',
type: 'post',
dataType: 'json',
async: true,
@ -317,7 +317,7 @@ function check_verCode(phone,code,from)
g_can_click=0;
$.ajax({
url: 'https://api.yimian.xyz/clever-login/check_verCode.php',
url: 'https://login.api.yimian.xyz/check_verCode.php',
type: "POST",
data: {
"tel": _phone,

@ -34,7 +34,7 @@ const dp = new DPlayer({
//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;window.history.replaceState(null, null, "https://cn.yimian.xyz/video/video.php?id="+g_vId);}
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("https://video.api.yimian.xyz/video_fp.php",{"fp":fp,"id":g_vId,"seek":dp.video.currentTime,"ip":returnCitySN.cip});timeUpdate_count=0;window.history.replaceState(null, null, "https://cn.yimian.xyz/video/video.php?id="+g_vId);}
if(typeof attach==="function") attach();});
//lstn for the video to the end
@ -88,7 +88,7 @@ function newVideo(id,next,seek)
{
$.ajax({
type: "POST",
url: 'https://api.yimian.xyz/video/video.php',
url: 'https://video.api.yimian.xyz/video.php',
data: { "id": id},
traditional: true,
dataType: 'json',
@ -112,7 +112,7 @@ function newVideo(id,next,seek)
cookie.set('vWatching',g_vId);
//record video for usr
timeUpdate_count=0;
$.post("https://api.yimian.xyz/video/video_fp.php",{"fp":fp,"id":g_vId,"seek":0,"ip":returnCitySN.cip});
$.post("https://video.api.yimian.xyz/video_fp.php",{"fp":fp,"id":g_vId,"seek":0,"ip":returnCitySN.cip});
},
error: function (data,type, err) {
alert('Can not Get Video!');
@ -127,7 +127,7 @@ function nextVideo()
$.ajax({
type: "POST",
url: 'https://api.yimian.xyz/video/video_redirect.php',
url: 'https://video.api.yimian.xyz/video_redirect.php',
data: { "id": id},
traditional: true,
dataType: 'json',
@ -146,7 +146,7 @@ function videotoUrl(id)
{
$.ajax({
type: "POST",
url: 'https://api.yimian.xyz/video/video_toUrl.php',
url: 'https://video.api.yimian.xyz/video_toUrl.php',
data: { "id": id},
traditional: true,
dataType: 'json',

@ -13,7 +13,7 @@ var seek=0;
$.ajax({
type: "POST",
url: '/etc/api/video.php',
url: 'https://video.api.yimian.xyz/video.php',
data: { "id": g_vId},
traditional: true,
dataType: 'json',
@ -34,7 +34,7 @@ $.ajax({
{
$.ajax({
type: "POST",
url: '/etc/api/video_dogecloud_api.php',
url: 'https://video.api.yimian.xyz/video_dogecloud_api.php',
data: { "vcode": g_vCode,"ip":returnCitySN.cip},
traditional: true,
dataType: 'json',
@ -57,7 +57,7 @@ $.ajax({
lang: 'zh-cn',
hotkey: true,
preload: 'auto',
logo: 'https://cn.yimian.xyz/etc/img/logo/logo_white.png',
logo: 'https://cdn.yimian.xyz/img/logo/logo_white.png',
volume: 0.7,
mutex: true,
video: { quality: Aquality,
@ -83,7 +83,7 @@ $.ajax({
//record video for usr
timeUpdate_count=0;
$.post("/etc/api/video_fp.php",{"fp":fp,"id":g_vId,"seek":0,"ip":returnCitySN.cip});
$.post("https://video.api.yimian.xyz/video_fp.php",{"fp":fp,"id":g_vId,"seek":0,"ip":returnCitySN.cip});
}
});
@ -98,11 +98,11 @@ $.ajax({
lang: 'zh-cn',
hotkey: true,
preload: 'auto',
logo: 'https://cn.yimian.xyz/etc/img/logo/logo_white.png',
logo: 'https://cdn.yimian.xyz/img/logo/logo_white.png',
volume: 0.7,
mutex: true,
video: {
url: 'https://cn.yimian.xyz/video/video_address.php?fp='+fp+'&id='+g_vId
url: 'https://video.yimian.xyz/video_address.php?fp='+fp+'&id='+g_vId
},
danmaku: {
id: g_vId,
@ -114,7 +114,7 @@ $.ajax({
//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;}});
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("https://video.api.yimian.xyz/video_fp.php",{"fp":fp,"id":g_vId,"seek":dp.video.currentTime,"ip":returnCitySN.cip});timeUpdate_count=0;}});
//lstn error
@ -124,7 +124,7 @@ $.ajax({
//record video for usr
timeUpdate_count=0;
$.post("/etc/api/video_fp.php",{"fp":fp,"id":g_vId,"seek":0,"ip":returnCitySN.cip});
$.post("https://video.api.yimian.xyz/video_fp.php",{"fp":fp,"id":g_vId,"seek":0,"ip":returnCitySN.cip});
}
},
error: function (data,type, err) {

@ -18,7 +18,7 @@
<script>
var watching=0;
$.post("https://api.yimian.xyz/video/fpcheck.php",{
$.post("https://video.api.yimian.xyz/fpcheck.php",{
fp: fp
},
function(msg){

Loading…
Cancel
Save