Code Monkey home page Code Monkey logo

airplaytv's Introduction

airplayTV

项目说明

  • 该项目是研究web安全衍生物
  • 通过一系列技术获取视频网站的播放列表以及播放地址等数据
  • 涉及:js加解密/数据加解密/使用websocket加解密数据/CORS跨域/COOKIE认证/人机认证等
  • 请勿使用该项目用于任何非法用途!!!

配置前端代码

  • 拉取前端代码git clone [email protected]:lixiang4u/airplayTV-web.git
  • 找到文件src/main.js 替换 axios.defaults.baseURL后的服务器地址

前端构建

npm install
npm run build

配置nginx

  • server模块配置web根目录指向 dist/ 目录
root '/path/to/airplayTV-web/dist';
  • http模块配置websocket upgradeupstream
#添加反向代理websocket相关map
map $http_upgrade $connection_upgrade {
    default upgrade;
    '' close;
}

# 定义反向的上游
upstream airplayTV {
    server 127.0.0.1:8089;
}
  • server模块配置location接口、websocket、m3u8资源请求转发

# 添加默认请求文件
location / {
    try_files $uri $uri/ /index.html last;
}
# 代理/api/到后端
location /api/ {
    proxy_pass http://airplayTV;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header REMOTE-HOST $remote_addr;

    #Set Nginx Cache
    add_header Cache-Control no-cache;
    expires 12h;
}
# 代理websocket到后端
location /api/ws {
    proxy_pass http://airplayTV;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header REMOTE-HOST $remote_addr;

    # 升级websocket
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection $connection_upgrade;

    #Set Nginx Cache
    add_header Cache-Control no-cache;
    expires 12h;
}
# 代理资源文件到后端
location /m3u8/ {
    proxy_pass http://airplayTV;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header REMOTE-HOST $remote_addr;

    #Set Nginx Cache
    add_header Cache-Control no-cache;
    expires 12h;
}

启动api服务

  • 拉取接口代码git clone [email protected]:lixiang4u/airplayTV.git
  • 构建并启动服务
go get
go build
chmod +x ./airplayTV
./airplayTV serve

访问nginx配置的域名测试

说明

  • HLS.js更新到(V1.2.3)会导致部分视频无法播放
  • 如果部分m3u8视频在本软件播放失败但是其他播放器可以播放,那么需要降级HLS.js更新到V12.0
  • 编码时将第三方插件变量赋值给Vue的数据变量可能导致不可预期问题(Vue数据变量的Proxy机制引起)

免责声明

  • 本软件仅作学习研究,请勿用于其它任何场景。作者不承担一切不正当使用本软件的责任。

airplaytv's People

Contributors

lixiang4u avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.