解析轮询并发程序,支持IP防盗输出防盗视频

解析轮询并发程序,支持IP防盗输出防盗视频

小洋人博客
2023-12-15 / 1 评论 / 46 阅读 / 正在检测是否收录...
温馨提示:
本文最后更新于2023年12月15日,已超过224天没有更新,若内容或图片失效,请留言反馈。

教程

在config.php配置json接口和授权调用ip

缓存时间:官方资源建议三个小时以下,10800秒 切片资源理论上可以随便写久点

m3u8 会直接缓存内容,mp4或者其他格式会缓存url

清理缓存功能配置,在宝塔定时任务添加 访问url,url写 你的网站/clear.php,调用时间周期按你个人所需

在config.php 配置当前网站的域名$web

如果缓存资源需要让网站播放,需要配置跨域

nginx:

在 网站->配置文件 中间任意部分添加

add_header Access-Control-Allow-Origin ‘*’;

add_header Access-Control-Allow-Methods ‘POST,PUT,GET,DELETE’;

add_header Access-Control-Allow-Headers ‘version, access-token, user-token, Accept, apiAuth, User-Agent, Keep-Alive, Origin, No-Cache, X-Requested-With, If-Modified-Since, Pragma, Last-Modified, Cache-Control, Expires, Content-Type, X-E4M-With’;

apache:

在 网站->配置文件 中间任意部分添加

Header set Access-Control-Allow-Origin *

Header set Access-Control-Allow-Credentials true

Header set Access-Control-Allow-Headers “Origin, X-Requested-With, Content-Type, Accept”

如果网站有多个端口,需要在对应端口代码中间添加,尤其是80和443端口

说明

可设置轮询和并发两种功能,轮询就是挨个接口调用直到出结果,并发就是同时调用所有接口,取最先出结果的,建议大家用轮询,并发有点费钱

下载地址:

0

评论 (1)

取消
  1. 头像
    爸爸
    Windows 10 · Google Chrome

    1

    回复