跳到主要内容

myTV SUPER 直播代理

  • 新帖
  • 热门
  • 精选

myTV SUPER 直播代理

coding 2y ago in IPTV · 0 views

Update:

现已在 Docker 支持: https://pixman.io/topics/31


myTV SUPER 是香港的流媒体平台,注册用户可以看免费的一些频道,比如翡翠台、TVB Plus 等,如果要在 iptv 软件里播放的话,需要使用程序做一个转换,下面是使用 cloudflare workers 来代理的方法,这个代码也支持付费频道,但是需要你自己开通了会员。

代码

addEventListener("fetch", event => {
  event.respondWith(handleRequest(event.request))
})

const api_token = '你的 TOKEN';
async function get_mytvsuper(channel) {
  const headers = {
    'Accept': 'application/json',
    'Authorization': `Bearer ${api_token}`,
    'Accept-Language': 'zh-CN,zh-Hans;q=0.9',
    'Host': 'user-api.mytvsuper.com',
    'Origin': 'https://www.mytvsuper.com',
    'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.5.2 Safari/605.1.15',
    'Referer': 'https://www.mytvsuper.com/',
    'X-Forwarded-For': '210.6.4.148', 
  }

  const params = new URLSearchParams();
  params.append('platform', 'android_tv');
  params.append('network_code', channel);

  const response = await fetch(`https://user-api.mytvsuper.com/v1/channel/checkout?${params}`, { headers });
  if (response.status != 200) {
    return null;
  }

  const json = await response.json();
  const profiles = json.profiles || [];
  let play_url = '';
  for (let i of profiles) {
    if (i.quality === 'high') {
      play_url = i.streaming_path;
      break;
    }
  }

  if (!play_url) {
    return null;
  }
  return play_url.split('&p=')[0];
}

async function handleRequest(request) {
  const url = new URL(request.url);
  const path = url.pathname.split('/');
  const id = path.pop();

  const redirect_url = await get_mytvsuper(id) || 'https://nolive.livednow.com/nolive.m3u8';

  let cacheControl = 'public, max-age=10'
  if (redirect_url !== 'https://nolive.livednow.com/nolive.m3u8') {
    cacheControl = 'public, max-age=43200' 
  }

  const response = new Response(null, {
    status: 302,
    headers: {
      Location: redirect_url,
      'Cache-Control': cacheControl,
    },
  });
  return response;
}

播放链接类似:https://DOMAIN/{ID},例如翡翠台 4k: https://DOMAIN/JUHD

完整的 m3u 文件可以访问 https://assets.livednow.com/m3u/mytvsuper.m3u 获取,注意将里边的 https://mytvsuper.livednow.com 替换成你自己的域名。

Token 的获取

登录 myTV SUPER 官网后,打开开发者工具 - Network,过滤 https://www.mytvsuper.com/api/auth/getSession/self/ 这个 api 的请求,查看 Response 中的 token 字段,如下图

  • 引用文章
  • 被文章引用
pixman 已支持 MytvSuper 直播源
pixman 已支持 MytvSuper 直播源
cutepan #91 2024年07月26日

请问哪里能找到 NOW 新闻台呢,讲粤语的,谢谢各位大神!

回复此楼 修改
574509027 #92 2024年09月26日
对 coding #90 回复

老大帮忙看看这个是怎么回事,谢谢

[root@OpenWrt:08:27 PM ~] # docker exec pixman sh -c 'flask mytvsuper_tivimate' [2024-09-26 20:27:49,584] ERROR in core: Request failed: 403 Client Error: Forbidden for url: https://user-api.mytvsuper.com/v1/channel/checkout?platform=android_tv&network_code=C18, retrying... [2024-09-26 20:27:50,533] ERROR in core: Request failed: 403 Client Error: Forbidden for url: https://user-api.mytvsuper.com/v1/channel/checkout?platform=android_tv&network_code=C18, retrying... [2024-09-26 20:27:51,521] ERROR in core: Request failed: 403 Client Error: Forbidden for url: https://user-api.mytvsuper.com/v1/channel/checkout?platform=android_tv&network_code=C18, retrying... [2024-09-26 20:27:51,522] ERROR in core: Request failed after retrying [2024-09-26 20:27:53,897] ERROR in core: Request failed: 403 Client Error: Forbidden for url: https://user-api.mytvsuper.com/v1/channel/checkout?platform=android_tv&network_code=CTVC, retrying...

回复此楼 修改
ykca #93 2024年11月01日
对 coding #17 回复

大佬 链接失效了 还有没有此类工具 谢谢

回复此楼 修改
ykca #94 2024年11月01日
对 Captain #68 回复

后来解决没 同样的情况

回复此楼 修改
pakson #95 2024年12月08日

大哥,如果小白看不懂,有没有教学,有酬劳

回复此楼 修改
dhxdl #96 2025年05月20日
对 JIMKUN #36 回复

我也是播放不了,但我的错误代码是242600

回复此楼 修改
  • 上一页
  • 1
  • 2
  • 3
  • 4
收到新回复,点击立即加载
需要 登录 后方可回复, 如果你还没有账号请 注册新账号
Coding
@coding
有事请发帖 @coding 或 联系 [email protected]
统计信息
会员
1,786
话题
259
回帖
2,955
活跃会员 查看排行
Devin
Koguan
nt01xp
jmk92
859876741
kewycjy
cnvc
kkk00011
0xyyyy
wayne630
zf7222749
zmy123
Unlovely
bos5201314
scjxx
once
wykds
LeoXD
a15ban
gally

A digital lifestyle community co-maintained by Pixer

本网站服务器由 提供,CDN 由 提供,基于 Homeland 构建,采用 Docker 部署。