IPTV Nginx 代理 TPTV 和 iTV

coding · 2024年06月22日 · 最后由 coding 回复于 2024年08月07日 · 7172 次阅读

pixman 最新版 (v1.3.6) 针对 iTV 和 TPTV 分别有三种解决办法:

江苏移动 TPTV

江苏移动的验证比较简单,部分 ip 段和 UA 被拉黑

  • 订阅 /tptv.m3u,如果不能播放,尝试修改播放器的 UA (User-Agent)
  • 如果播放器不支持修改 UA,那可以订阅 /tptv_proxy.m3u,pixman 将会代理请求,任何播放器都支持;
  • 假如你觉得 pixman 代理流量性能不如 nginx,那可以继续往后看,后面有 nginx 配置文件

中国移动 iTV

中国移动 iTV 的源在电信联通网络下不返回服务器 ip,解决办法也很简单,自己写入一个可用 ip 到 hosts 文件就行,但考虑到有些用户不知道怎么修改或者设备不支持修改,有三种办法:

  • 你可以修改 Hosts,那订阅 /itv.m3u 就行,修改 Hosts 或者用代理软件映射别名可以参考 https://pixman.io/topics/37
  • 无法修改 Hosts,订阅 /itv_proxy.m3u,pixman 会代理请求,三网通用
  • 与 TPTV 类似,想使用 nginx,那继续往后看

使用 Nginx

在任意目录新建一个 pixman.conf,假设路径为 /opt/pixman/pixman.conf

server {
    listen 8000 default_server;
    resolver 223.5.5.5;

    location ~ ^/tptv/(?<path>.*) {
        set $ua 'okhttp/3';
        if ($arg_ua) {
            set $ua $arg_ua;
        }
        set $target_url http://tptv.mobaibox.com/$path$is_args$args;

        proxy_pass $target_url;
        proxy_set_header User-Agent $ua;
    }

    location ~ ^/(?<cdn>ystenlive|bestlive|wasulive|fifalive|hnbblive)(?<path>.*) {
        set $target_url http://pixman.io.$cdn.dnsany.com$path$is_args$args;

        proxy_pass $target_url;
        proxy_set_header Host cache.ott.$cdn.itv.cmvideo.cn;
    }

    location / {
        return 200 'ok';
    }
}

然后使用 docker run -d --name=pixman-nginx -p 8000:8000 -v /opt/pixman/pixman.conf:/etc/nginx/conf.d/pixman.conf --restart=always nginx 启动 Nginx

订阅地址分别为:

  • /tptv_proxy.m3u?server=ip:8000
  • /itv_proxy.m3u?server=ip:8000

如果更喜欢使用 Docker Compose 的话,可以使用下面的文件

在这个例子中,docker-compose.yaml 和 pixman.conf 文件都在 /opt/pixman 下,根据你自己的调整

docker-compose.yaml

services:
  pixman:
    image: pixman/pixman
    restart: always
    container_name: pixman
    environment:
      - http_proxy=http://192.168.50.50:7890
      - https_proxy=http://192.168.50.50:7890
      - MYTVSUPER_TOKEN=YOUR_TOKEN
    ports:
      - 5000:5000
  pixman-nginx:
    image: nginx:latest
    restart: always
    container_name: pixman-nginx
    ports:
      - 8000:8000
    volumes:
       - /opt/pixman/pixman.conf:/etc/nginx/conf.d/pixman.conf 
coding 使用 nginx 负载均衡稳定收看江苏移动 IPTV 提及了此话题。 06月22日 22:17

赞一个!

谢谢,itv 又能看了

是否不在國內只能用 itv_proxy.m3u 和 tptv_proxy.m3u ?

coding Docker 镜像 pixman/pixman 使用说明 提及了此话题。 06月23日 18:19
charles 回复

可能有些慢

謝謝板主回覆 我在國外用 tptv.m3u 和 itv.m3u 改了 host 或是 nginx 都不能用 看來只能用 itv_proxy.m3u 和 tptv_proxy.m3u 了 ~如板主說的一樣 都會斷流 緩衝 再播放 ~還是謝謝板主無私的努力~

charles 回复

因为这两个都是大陆的 CDN,在海外可能速度不理想

itv.m3u 改 host 可以看 nginx 或者 itv_proxy.m3u 就是看不了,tptv 也一样,不知道家里网络哪里有问题还是设置不对 docker 日志

q273432882 回复

你的代理开启了验证,可以关闭验证或者修改为

environment:
  - http_proxy=http://user:[email protected]:7890
  - https_proxy=http://user:[email protected]:7890

user 和 pass 换成你的用户名和密码

coding 回复

谢谢提醒,折腾了好久。都可以正常观看了。使用 openclash 的用户建议取消账户密码验证

coding 江苏移动魔百盒 全国 CDN 版本 提及了此话题。 06月27日 22:01

学会了,感谢

{"error":"Failed to get play url"} {"error":"Failed to get account info"} 求救,都报错了,获取不到播放链接或者账号信息

itv 可以看,就这个 tptv 不能看,都换过代理了

coding Docker 镜像 pixman/pixman 使用说明 提及了此话题。 08月01日 09:03

{ "error": "Failed to get response" }

使用 itv_proxy.m3u 获取的地址,使用频道连接打开提示,请问是什么问题呢? tptv_proxy.m3u 是正常使用

skylark 回复

docker logs pixman 看看日志

cutepan 回复

这两个不需要代理,部署在国内服务器

coding 回复

pixman.io.wasulive.dnsany.com 这个地址 ping 是正常的。

coding 回复

你意思是,部署容器的时候不需要添加代理的参数吗?

pixman-nginx-1 | 10.1.0.2 - - [04/Aug/2024:10:11:28 +0000] "GET /wasulive/000000001000/6000000001000022313/6000000001000022313_1500000_20240804_180000_59.ts?channel-id=wasusyt&Contentid=6000000001000022313&livemode=1&stbId=3&version=1.0&owaccmark=6000000001000022313&owchid=wasusyt&owsid=9737461722766219786&AuthInfo=EWQsWs67N73tbxTvFapMNjcABjwASPmu1AUYW6yMj6zi80w1g7mnj7NmKIArDPe7zdwnvSXndfRAnjWFAe22hg%3D%3D HTTP/1.1" 499 0 "-" "'okhttp/3'" "-"

499 报错如何处理电信线路

pixman 的 itv 不管用什么方式,国内或者国外服务器搭建好了,播放都是播放几秒卡一下,请问如何解决 @coding

wx31 回复

dns 问题,重启试试

diypad 回复

最近是有 dns 变动

需要 登录 后方可回复, 如果你还没有账号请 注册新账号