一般IPTV只能实现单个设备播放,一个宽带也只能接入一个IPTV,如果加中有多个设备需要同时播放电视直播,就无法实现了。

当然可以通过在网上找一些有人精心维护的m3u直播源来实现直播,下面的开放源用过一段时间,维护的及时性不错, m3u源地址

但是使用过程中经常会有卡顿的现象,还是决定使用运营商提供的直播源。

运营商提供的直播只能使用IPTV电视盒子,并且电视盒子是直接插在光猫的iTV接口,所以要实现局域网播放需要:

  • 路由器认证IPTV
  • 抓包获取直播源
  • 路由器路由配置
  • 直播源实现多设备播放

1. 路由器认证IPTV

因为杭州电信光猫宽带和ITV是采用VLAN进行划分的,光猫到路由器也可以通过划分VLAN单线连接实现宽带和iTV同时数据传输,奈何联系电信客服和外线师傅都没有成功拿到电信光猫的超级管理员账号密码,无法从光猫端配置VLAN接口。只能采用双线的方式,前提是光猫的宽带和iTV已经配置成桥接模式,配置桥接模式可以直接联系电信客服,可以远程配置。

连接

双线的配置比VLAN更简单,只是会多占用路由器的一个网口而已,具体的连接方式就是

光猫宽带 -> 软路由WAN1
光猫ITV -> 软路由WAN2

具体电视盒子的认证方式需要先进行抓包,将WAN2口和LAN2口直接配置桥接模式,不配置协议,开启电视盒子,然后从LAN2口进行抓包。

tcpdump -i [LAN2网卡] -w lan2.pcap

由于两个网卡只是进行了桥接,电视盒子认证方式不变。

抓包

通过抓包获取到电视盒子的认证方式是DHCP option认证方式,配置路由器DHCP。

配置DHCP

vi /etc/config/network

config interface 'IPTV'
	option proto 'dhcp'
	option ifname 'eth2'
	option metric '20'
	option delegate '0'
	option macaddr '盒子mac地址'
	option hostname '上面抓包的option host name字段'
	option sendopts '0x3c:xxxxxx' 上面抓包的option 60字段,以16进制复制出来,格式如下3c XX YY YY YY YY YY YY YY YY YY YY YY YY,把3c xx去掉,贴上后面的的内容
	option multipath 'on'

修改udhcpc脚本

vi /lib/netifd/proto/dhcp.sh

	proto_run_command "$config" udhcpc \
		-p /var/run/udhcpc-$iface.pid \
		-s /lib/netifd/dhcp.script \
		-f -t 0 -i "$iface" \
		${ipaddr:+-r $ipaddr} \
		${hostname:+-x "hostname:$hostname"} \
		${vendorid:+-V "$vendorid"} \
		$clientid $defaultreqopts $broadcast $release $dhcpopts

修改为

	proto_run_command "$config" udhcpc \
		-p /var/run/udhcpc-$iface.pid \
		-s /lib/netifd/dhcp.script \
		-f -t 0 -i "$iface" \
		${ipaddr:+-r $ipaddr} \
		${hostname:+-x "hostname:$hostname"} \
		-V "" \
		$clientid $defaultreqopts $broadcast $release $dhcpopts

重启网络或直接重启路由器

/etc/init.d/network restart

注意给IPTV网卡单独创建防火墙区域并设置转发出站入栈规则,并且需要开启IP动态伪装和NAT。

2. 抓包分析播放源

可以在使用第一步的抓包结果,过滤出http协议,然后搜索关键字’SetConfig’,可以定位到相应的HTTP请求

右键选择Follow http stream,就可以看到具体的直播地址列表。

格式化成m3u格式列表如下,这里用的rtsp单播地址:

#EXTM3U
#EXTINF:-1,中央一套高清
rtsp://115.233.40.247/PLTV/88888913/224/3221228078/10000100000000060000000002460690_0.smil
#EXTINF:-1,浙江卫视高清
rtsp://115.233.40.247/PLTV/88888913/224/3221228012/10000100000000060000000000794032_0.smil
#EXTINF:-1,钱江频道高清
rtsp://115.233.40.247/PLTV/88888913/224/3221229041/10000100000000060000000004799139_0.smil
#EXTINF:-1,浙江经视高清
rtsp://115.233.40.247/PLTV/88888913/224/3221229115/10000100000000060000000004799165_0.smil
#EXTINF:-1,教科影视高清
rtsp://115.233.40.247/PLTV/88888913/224/3221229111/10000100000000060000000004799164_0.smil
#EXTINF:-1,浙江新闻高清
rtsp://115.233.40.247/PLTV/88888913/224/3221229034/10000100000000060000000004799161_0.smil
#EXTINF:-1,民生休闲高清
rtsp://115.233.40.247/PLTV/88888913/224/3221229045/10000100000000060000000004799162_0.smil
#EXTINF:-1,浙江少儿高清
rtsp://115.233.40.247/PLTV/88888913/224/3221229030/10000100000000060000000004799160_0.smil
#EXTINF:-1,好易购1高清
rtsp://115.233.40.247/PLTV/88888913/224/3221229213/53485722.smil
#EXTINF:-1,杭州综合高清
rtsp://115.233.40.247/PLTV/88888913/224/3221229189/52579603.smil
#EXTINF:-1,西湖明珠高清
rtsp://115.233.40.247/PLTV/88888913/224/3221229152/52579496.smil
#EXTINF:-1,杭州生活高清
rtsp://115.233.40.247/PLTV/88888913/224/3221229156/52579500.smil
#EXTINF:-1,杭州影视高清
rtsp://115.233.40.247/PLTV/88888913/224/3221229142/52579609.smil
#EXTINF:-1,青少体育高清
rtsp://115.233.40.247/PLTV/88888913/224/3221229217/57567111.smil
#EXTINF:-1,好易购2
rtsp://115.233.40.247/PLTV/88888913/224/3221228010/10000100000000060000000000806450_0.smil
#EXTINF:-1,好莱坞电影
rtsp://115.233.40.247/PLTV/88888913/224/3221229212/62452820.smil
#EXTINF:-1,院线大片
rtsp://115.233.40.247/PLTV/88888913/224/3221229295/62452796.smil
#EXTINF:-1,喜剧电影
rtsp://115.233.40.247/PLTV/88888913/224/3221229220/62452846.smil
#EXTINF:-1,经典港片
rtsp://115.233.40.247/PLTV/88888913/224/3221229291/62452842.smil
#EXTINF:-1,快乐购
rtsp://115.233.40.247/PLTV/88888913/224/3221229247/10000100000000060000000005425938_0.smil
#EXTINF:-1,杭州导视高清
rtsp://115.233.40.247/PLTV/88888913/224/3221229263/52579543.smil
#EXTINF:-1,中央少儿高清
rtsp://115.233.40.247/PLTV/88888913/224/3221228088/10000100000000060000000002633381_0.smil
#EXTINF:-1,聚鲨环球精选
rtsp://115.233.40.247/PLTV/88888913/224/3221228984/10000100000000060000000004366615_0.smil
#EXTINF:-1,央广购物
rtsp://115.233.40.247/PLTV/88888913/224/3221229017/10000100000000060000000004414507_0.smil
#EXTINF:-1,中央二套高清
rtsp://115.233.40.247/PLTV/88888913/224/3221228083/10000100000000060000000002633372_0.smil
#EXTINF:-1,中央三套高清
rtsp://115.233.40.247/PLTV/88888913/224/3221229136/10000100000000060000000005809121_0.smil
#EXTINF:-1,中央四套
rtsp://115.233.40.247/PLTV/88888913/224/3221227806/10000100000000060000000000304159_0.smil
#EXTINF:-1,中央五套高清
rtsp://115.233.40.247/PLTV/88888913/224/3221229114/10000100000000060000000005809143_0.smil
#EXTINF:-1,中央六套高清
rtsp://115.233.40.247/PLTV/88888913/224/3221229161/10000100000000060000000005809142_0.smil
#EXTINF:-1,中央七套高清
rtsp://115.233.40.247/PLTV/88888913/224/3221228093/10000100000000060000000002633385_0.smil
#EXTINF:-1,中央八套高清
rtsp://115.233.40.247/PLTV/88888913/224/3221229157/10000100000000060000000005809141_0.smil
#EXTINF:-1,中央纪录高清
rtsp://115.233.40.247/PLTV/88888913/224/3221228112/10000100000000060000000002633384_0.smil
#EXTINF:-1,中央科教高清
rtsp://115.233.40.247/PLTV/88888913/224/3221228131/10000100000000060000000002633383_0.smil
#EXTINF:-1,中央戏曲
rtsp://115.233.40.247/PLTV/88888913/224/3221227777/10000100000000060000000000304164_0.smil
#EXTINF:-1,中央十二高清
rtsp://115.233.40.247/PLTV/88888913/224/3221228130/10000100000000060000000002633382_0.smil
#EXTINF:-1,中央新闻高清
rtsp://115.233.40.247/PLTV/88888913/224/3221229154/52628615.smil
#EXTINF:-1,中央音乐
rtsp://115.233.40.247/PLTV/88888913/224/3221227993/10000100000000060000000000794054_0.smil
#EXTINF:-1,CCTV5+高清
rtsp://115.233.40.247/PLTV/88888913/224/3221229201/52583204.smil
#EXTINF:-1,中央十七套
rtsp://115.233.40.247/PLTV/88888913/224/3221229176/54864243.smil
#EXTINF:-1,好享购
rtsp://115.233.40.247/PLTV/88888913/224/3221229120/10000100000000060000000005353087_0.smil
#EXTINF:-1,优购物
rtsp://115.233.40.247/PLTV/88888913/224/3221229203/10000100000000060000000005107585_0.smil
#EXTINF:-1,家有购物
rtsp://115.233.40.247/PLTV/88888913/224/3221228988/10000100000000060000000004366616_0.smil
#EXTINF:-1,芒果热综
rtsp://115.233.40.247/PLTV/88888913/224/3221229224/62452850.smil
#EXTINF:-1,首映电影
rtsp://115.233.40.247/PLTV/88888913/224/3221229117/10000100000000060000000005237026_0.smil
#EXTINF:-1,环球电影
rtsp://115.233.40.247/PLTV/88888913/224/3221229084/10000100000000060000000005237035_0.smil
#EXTINF:-1,动作影院
rtsp://115.233.40.247/PLTV/88888913/224/3221229078/10000100000000060000000005237034_0.smil
#EXTINF:-1,欧美影院
rtsp://115.233.40.247/PLTV/88888913/224/3221229121/10000100000000060000000005237037_0.smil
#EXTINF:-1,华语影院
rtsp://115.233.40.247/PLTV/88888913/224/3221229113/10000100000000060000000005237025_0.smil
#EXTINF:-1,黄金剧场
rtsp://115.233.40.247/PLTV/88888913/224/3221229066/10000100000000060000000005237023_0.smil
#EXTINF:-1,白金剧场
rtsp://115.233.40.247/PLTV/88888913/224/3221229074/10000100000000060000000005237031_0.smil
#EXTINF:-1,谍战剧场
rtsp://115.233.40.247/PLTV/88888913/224/3221229070/10000100000000060000000005237030_0.smil
#EXTINF:-1,古装剧场
rtsp://115.233.40.247/PLTV/88888913/224/3221229211/10000100000000060000000005237029_0.smil
#EXTINF:-1,情感剧场
rtsp://115.233.40.247/PLTV/88888913/224/3221229109/10000100000000060000000005237022_0.smil
#EXTINF:-1,东方卫视高清
rtsp://115.233.40.247/PLTV/88888913/224/3221228140/10000100000000060000000002670196_0.smil
#EXTINF:-1,湖南卫视高清
rtsp://115.233.40.247/PLTV/88888913/224/3221227983/10000100000000060000000000794037_0.smil
#EXTINF:-1,安徽卫视高清
rtsp://115.233.40.247/PLTV/88888913/224/3221228120/10000100000000060000000002242150_0.smil
#EXTINF:-1,江苏卫视高清
rtsp://115.233.40.247/PLTV/88888913/224/3221228067/10000100000000060000000001063212_0.smil
#EXTINF:-1,北京卫视高清
rtsp://115.233.40.247/PLTV/88888913/224/3221228080/10000100000000060000000001063209_0.smil
#EXTINF:-1,重庆卫视高清
rtsp://115.233.40.247/PLTV/88888913/224/3221229061/10000100000000060000000004835834_0.smil
#EXTINF:-1,贵州卫视高清
rtsp://115.233.40.247/PLTV/88888913/224/3221229044/10000100000000060000000004835835_0.smil
#EXTINF:-1,四川卫视高清
rtsp://115.233.40.247/PLTV/88888913/224/3221229046/10000100000000060000000004835838_0.smil
#EXTINF:-1,广东卫视高清
rtsp://115.233.40.247/PLTV/88888913/224/3221228011/10000100000000060000000000794034_0.smil
#EXTINF:-1,吉林卫视
rtsp://115.233.40.247/PLTV/88888913/224/3221227802/10000100000000060000000000304236_0.smil
#EXTINF:-1,动漫新番
rtsp://115.233.40.247/PLTV/88888913/224/3221229206/62452889.smil
#EXTINF:-1,天津卫视高清
rtsp://115.233.40.247/PLTV/88888913/224/3221228016/10000100000000060000000000794035_0.smil
#EXTINF:-1,云南卫视
rtsp://115.233.40.247/PLTV/88888913/224/3221227830/10000100000000060000000000304238_0.smil
#EXTINF:-1,河北卫视高清
rtsp://115.233.40.247/PLTV/88888913/224/3221229050/10000100000000060000000004836297_0.smil
#EXTINF:-1,黑龙江高清
rtsp://115.233.40.247/PLTV/88888913/224/3221228068/10000100000000060000000002242148_0.smil
#EXTINF:-1,海南卫视
rtsp://115.233.40.247/PLTV/88888913/224/3221227803/10000100000000060000000000304212_0.smil
#EXTINF:-1,山东卫视高清
rtsp://115.233.40.247/PLTV/88888913/224/3221227978/10000100000000060000000000794036_0.smil
#EXTINF:-1,东南卫视高清
rtsp://115.233.40.247/PLTV/88888913/224/3221229040/10000100000000060000000004835831_0.smil
#EXTINF:-1,湖北卫视高清
rtsp://115.233.40.247/PLTV/88888913/224/3221228102/10000100000000060000000002242149_0.smil
#EXTINF:-1,辽宁卫视高清
rtsp://115.233.40.247/PLTV/88888913/224/3221229042/10000100000000060000000004835836_0.smil
#EXTINF:-1,江西卫视高清
rtsp://115.233.40.247/PLTV/88888913/224/3221229127/10000100000000060000000004835832_0.smil
#EXTINF:-1,青海卫视
rtsp://115.233.40.247/PLTV/88888913/224/3221227765/10000100000000060000000000304132_0.smil
#EXTINF:-1,西藏卫视
rtsp://115.233.40.247/PLTV/88888913/224/3221228005/10000100000000060000000000793620_0.smil
#EXTINF:-1,陕西卫视
rtsp://115.233.40.247/PLTV/88888913/224/3221227826/10000100000000060000000000304223_0.smil
#EXTINF:-1,兵团卫视
rtsp://115.233.40.247/PLTV/88888913/224/3221228006/10000100000000060000000000789241_0.smil
#EXTINF:-1,山西卫视
rtsp://115.233.40.247/PLTV/88888913/224/3221227787/10000100000000060000000000304213_0.smil
#EXTINF:-1,宁夏卫视
rtsp://115.233.40.247/PLTV/88888913/224/3221227855/10000100000000060000000000304710_0.smil
#EXTINF:-1,河南卫视高清
rtsp://115.233.40.247/PLTV/88888913/224/3221229057/10000100000000060000000004835833_0.smil
#EXTINF:-1,广西卫视
rtsp://115.233.40.247/PLTV/88888913/224/3221227840/10000100000000060000000000304250_0.smil
#EXTINF:-1,金鹰卡通
rtsp://115.233.40.247/PLTV/88888913/224/3221229202/59229692.smil
#EXTINF:-1,咕噜动画
rtsp://115.233.40.247/PLTV/88888913/224/3221229080/10000100000000060000000005237027_0.smil
#EXTINF:-1,哈哈炫动
rtsp://115.233.40.247/PLTV/88888913/224/3221227973/10000100000000060000000000789247_0.smil
#EXTINF:-1,第二课堂
rtsp://115.233.40.247/PLTV/88888913/224/3221229153/10000100000000060000000005780940_0.smil
#EXTINF:-1,中国教育一套
rtsp://115.233.40.247/PLTV/88888913/224/3221227968/10000100000000060000000000789246_0.smil
#EXTINF:-1,中国教育四套
rtsp://115.233.40.247/PLTV/88888913/224/3221229128/10000100000000060000000005781889_0.smil
#EXTINF:-1,CIBN斗牛财经
rtsp://115.233.40.247/PLTV/88888913/224/3221229172/53606920.smil
#EXTINF:-1,深圳卫视高清
rtsp://115.233.40.247/PLTV/88888913/224/3221227988/10000100000000060000000000794038_0.smil
#EXTINF:-1,内蒙古卫视
rtsp://115.233.40.247/PLTV/88888913/224/3221229147/10000100000000060000000004969231_0.smil
#EXTINF:-1,甘肃卫视
rtsp://115.233.40.247/PLTV/88888913/224/3221229052/10000100000000060000000004969230_0.smil
#EXTINF:-1,新视觉
rtsp://115.233.40.247/PLTV/88888913/224/3221229145/10000100000000060000000005663523_0.smil
#EXTINF:-1,中央一套
rtsp://115.233.40.247/PLTV/88888913/224/3221227767/10000100000000060000000000304156_0.smil
#EXTINF:-1,浙江卫视
rtsp://115.233.40.247/PLTV/88888913/224/3221227817/10000100000000060000000000304248_0.smil
#EXTINF:-1,钱江频道
rtsp://115.233.40.247/PLTV/88888913/224/3221227790/10000100000000060000000000304158_0.smil
#EXTINF:-1,浙江经视
rtsp://115.233.40.247/PLTV/88888913/224/3221227778/10000100000000060000000000304143_0.smil
#EXTINF:-1,教科影视
rtsp://115.233.40.247/PLTV/88888913/224/3221227851/10000100000000060000000000304818_0.smil
#EXTINF:-1,浙江新闻
rtsp://115.233.40.247/PLTV/88888913/224/3221227816/10000100000000060000000000304167_0.smil
#EXTINF:-1,民生休闲
rtsp://115.233.40.247/PLTV/88888913/224/3221227800/10000100000000060000000000304166_0.smil
#EXTINF:-1,浙江少儿
rtsp://115.233.40.247/PLTV/88888913/224/3221227801/10000100000000060000000000304155_0.smil
#EXTINF:-1,杭州综合
rtsp://115.233.40.247/PLTV/88888913/224/3221228040/10000100000000060000000000979371_0.smil
#EXTINF:-1,西湖明珠
rtsp://115.233.40.247/PLTV/88888913/224/3221228052/10000100000000060000000000987759_0.smil
#EXTINF:-1,杭州生活
rtsp://115.233.40.247/PLTV/88888913/224/3221228035/10000100000000060000000000979320_0.smil
#EXTINF:-1,杭州影视
rtsp://115.233.40.247/PLTV/88888913/224/3221228023/10000100000000060000000000979322_0.smil
#EXTINF:-1,杭州青少体育
rtsp://115.233.40.247/PLTV/88888913/224/3221228018/10000100000000060000000000979313_0.smil
#EXTINF:-1,杭州导视
rtsp://115.233.40.247/PLTV/88888913/224/3221229124/10000100000000060000000005446941_0.smil
#EXTINF:-1,热门综艺
rtsp://115.233.40.247/PLTV/88888913/224/3221229215/10000100000000060000000005237033_0.smil
#EXTINF:-1,健康养生
rtsp://115.233.40.247/PLTV/88888913/224/3221229207/10000100000000060000000005237028_0.smil
#EXTINF:-1,高分剧场
rtsp://115.233.40.247/PLTV/88888913/224/3221229210/62452792.smil
#EXTINF:-1,探索解密
rtsp://115.233.40.247/PLTV/88888913/224/3221229261/62452854.smil
#EXTINF:-1,精品纪录
rtsp://115.233.40.247/PLTV/88888913/224/3221229216/62452928.smil
#EXTINF:-1,美味厨房
rtsp://115.233.40.247/PLTV/88888913/224/3221229228/62452858.smil
#EXTINF:-1,中央二套
rtsp://115.233.40.247/PLTV/88888913/224/3221227795/10000100000000060000000000304162_0.smil
#EXTINF:-1,中央三套
rtsp://115.233.40.247/PLTV/88888913/224/3221229140/10000100000000060000000005809140_0.smil
#EXTINF:-1,中央五套
rtsp://115.233.40.247/PLTV/88888913/224/3221229122/10000100000000060000000005809146_0.smil
#EXTINF:-1,中央六套
rtsp://115.233.40.247/PLTV/88888913/224/3221229165/10000100000000060000000005809145_0.smil
#EXTINF:-1,中央七套
rtsp://115.233.40.247/PLTV/88888913/224/3221227782/10000100000000060000000000304168_0.smil
#EXTINF:-1,中央八套
rtsp://115.233.40.247/PLTV/88888913/224/3221229118/10000100000000060000000005809144_0.smil
#EXTINF:-1,中央科教
rtsp://115.233.40.247/PLTV/88888913/224/3221227773/10000100000000060000000000304139_0.smil
#EXTINF:-1,中央十二套
rtsp://115.233.40.247/PLTV/88888913/224/3221227810/10000100000000060000000000304202_0.smil
#EXTINF:-1,中央新闻
rtsp://115.233.40.247/PLTV/88888913/224/3221227811/10000100000000060000000000304163_0.smil
#EXTINF:-1,中央少儿
rtsp://115.233.40.247/PLTV/88888913/224/3221227747/10000100000000060000000000304138_0.smil
#EXTINF:-1,CGTN
rtsp://115.233.40.247/PLTV/88888913/224/3221228108/10000100000000060000000002707382_0.smil
#EXTINF:-1,CGTN-Español
rtsp://115.233.40.247/PLTV/88888913/224/3221229180/54864297.smil
#EXTINF:-1,CGTN-Français
rtsp://115.233.40.247/PLTV/88888913/224/3221229271/54864338.smil
#EXTINF:-1,CGTN-العربية
rtsp://115.233.40.247/PLTV/88888913/224/3221229158/54864306.smil
#EXTINF:-1,CGTN-Pусский
rtsp://115.233.40.247/PLTV/88888913/224/3221229162/54864352.smil
#EXTINF:-1,东方卫视
rtsp://115.233.40.247/PLTV/88888913/224/3221227788/10000100000000060000000000304153_0.smil
#EXTINF:-1,湖南卫视
rtsp://115.233.40.247/PLTV/88888913/224/3221227791/10000100000000060000000000304141_0.smil
#EXTINF:-1,安徽卫视
rtsp://115.233.40.247/PLTV/88888913/224/3221227783/10000100000000060000000000304148_0.smil
#EXTINF:-1,江苏卫视
rtsp://115.233.40.247/PLTV/88888913/224/3221227797/10000100000000060000000000304232_0.smil
#EXTINF:-1,北京卫视
rtsp://115.233.40.247/PLTV/88888913/224/3221227813/10000100000000060000000000304237_0.smil
#EXTINF:-1,重庆卫视
rtsp://115.233.40.247/PLTV/88888913/224/3221227836/10000100000000060000000000304231_0.smil
#EXTINF:-1,贵州卫视
rtsp://115.233.40.247/PLTV/88888913/224/3221227828/10000100000000060000000000304253_0.smil
#EXTINF:-1,四川卫视
rtsp://115.233.40.247/PLTV/88888913/224/3221227822/10000100000000060000000000304252_0.smil
#EXTINF:-1,广东卫视
rtsp://115.233.40.247/PLTV/88888913/224/3221227821/10000100000000060000000000304214_0.smil
#EXTINF:-1,天津卫视
rtsp://115.233.40.247/PLTV/88888913/224/3221227805/10000100000000060000000000304190_0.smil
#EXTINF:-1,河北卫视
rtsp://115.233.40.247/PLTV/88888913/224/3221227812/10000100000000060000000000304244_0.smil
#EXTINF:-1,黑龙江卫视
rtsp://115.233.40.247/PLTV/88888913/224/3221227825/10000100000000060000000000304234_0.smil
#EXTINF:-1,山东卫视
rtsp://115.233.40.247/PLTV/88888913/224/3221227820/10000100000000060000000000304230_0.smil
#EXTINF:-1,东南卫视
rtsp://115.233.40.247/PLTV/88888913/224/3221227831/10000100000000060000000000304227_0.smil
#EXTINF:-1,湖北卫视
rtsp://115.233.40.247/PLTV/88888913/224/3221227823/10000100000000060000000000304249_0.smil
#EXTINF:-1,辽宁卫视
rtsp://115.233.40.247/PLTV/88888913/224/3221227841/10000100000000060000000000304251_0.smil
#EXTINF:-1,江西卫视
rtsp://115.233.40.247/PLTV/88888913/224/3221227807/10000100000000060000000000304239_0.smil
#EXTINF:-1,河南卫视
rtsp://115.233.40.247/PLTV/88888913/224/3221227835/10000100000000060000000000304242_0.smil
#EXTINF:-1,深圳卫视
rtsp://115.233.40.247/PLTV/88888913/224/3221227772/10000100000000060000000000304160_0.smil
#EXTINF:-1,体育赛事
rtsp://115.233.40.247/PLTV/88888913/224/3221229196/59016223.smil
#EXTINF:-1,4K超清
rtsp://115.233.40.247/PLTV/88888913/224/3221229105/10000100000000060000000005237021_0.smil
#EXTINF:-1,浙江之声
rtsp://115.233.40.247/PLTV/88888913/224/3221228218/10000100000000060000000003102657_0.smil
#EXTINF:-1,经济频道
rtsp://115.233.40.247/PLTV/88888913/224/3221228223/10000100000000060000000003102668_0.smil
#EXTINF:-1,音乐调频
rtsp://115.233.40.247/PLTV/88888913/224/3221228228/10000100000000060000000003102672_0.smil
#EXTINF:-1,民生资讯
rtsp://115.233.40.247/PLTV/88888913/224/3221228233/10000100000000060000000003102678_0.smil
#EXTINF:-1,交通之声
rtsp://115.233.40.247/PLTV/88888913/224/3221228265/10000100000000060000000003102675_0.smil
#EXTINF:-1,城市之声
rtsp://115.233.40.247/PLTV/88888913/224/3221228291/10000100000000060000000003102680_0.smil
#EXTINF:-1,旅游之声
rtsp://115.233.40.247/PLTV/88888913/224/3221228327/10000100000000060000000003102677_0.smil
#EXTINF:-1,浙江新闻广播
rtsp://115.233.40.247/PLTV/88888913/224/3221228332/10000100000000060000000003102947_0.smil
#EXTINF:-1,极速体育
rtsp://115.233.40.247/PLTV/88888913/224/3221229001/10000100000000060000000004307486_0.smil
#EXTINF:-1,超凡体育
rtsp://115.233.40.247/PLTV/88888913/224/3221228999/10000100000000060000000004308257_0.smil
#EXTINF:-1,新威体育
rtsp://115.233.40.247/PLTV/88888913/224/3221229003/10000100000000060000000004308259_0.smil
#EXTINF:-1,久看体育
rtsp://115.233.40.247/PLTV/88888913/224/3221229007/10000100000000060000000004308260_0.smil
#EXTINF:-1, 赛事直播-1
rtsp://115.233.40.247/PLTV/88888913/224/3221229011/10000100000000060000000004308262_0.smil
#EXTINF:-1,赛事直播-2
rtsp://115.233.40.247/PLTV/88888913/224/3221229015/10000100000000060000000004308263_0.smil
#EXTINF:-1,赛事直播-3
rtsp://115.233.40.247/PLTV/88888913/224/3221229019/10000100000000060000000004308265_0.smil
#EXTINF:-1,极速体育HD
rtsp://115.233.40.247/PLTV/88888913/224/3221229023/10000100000000060000000004308269_0.smil
#EXTINF:-1,超凡体育HD
rtsp://115.233.40.247/PLTV/88888913/224/3221229027/10000100000000060000000004308271_0.smil
#EXTINF:-1,新威体育HD
rtsp://115.233.40.247/PLTV/88888913/224/3221229031/10000100000000060000000004308273_0.smil
#EXTINF:-1,久看体育HD
rtsp://115.233.40.247/PLTV/88888913/224/3221229035/10000100000000060000000004308275_0.smil
#EXTINF:-1,赛事直播-1HD
rtsp://115.233.40.247/PLTV/88888913/224/3221229039/10000100000000060000000004308277_0.smil
#EXTINF:-1,赛事直播-2HD
rtsp://115.233.40.247/PLTV/88888913/224/3221229043/10000100000000060000000004308278_0.smil
#EXTINF:-1,赛事直播-3HD
rtsp://115.233.40.247/PLTV/88888913/224/3221229047/10000100000000060000000004308279_0.smil
#EXTINF:-1,广电体育频道1
rtsp://115.233.40.247/PLTV/88888913/224/3221228980/10000100000000060000000004224830_0.smil
#EXTINF:-1,广电体育频道2
rtsp://115.233.40.247/PLTV/88888913/224/3221228976/10000100000000060000000004224829_0.smil
#EXTINF:-1,测试SD4
rtsp://115.233.40.247/PLTV/88888913/224/3221228990/10000100000000060000000004414502_0.smil
#EXTINF:-1,在线执法
rtsp://115.233.40.247/PLTV/88888913/224/3221229181/50701500.smil
#EXTINF:-1,4K测试1
rtsp://115.233.40.247/PLTV/88888913/224/3221229167/10000100000000060000000005029497_0.smil
#EXTINF:-1,珠峰直播1
rtsp://115.233.40.247/PLTV/88888913/224/3221229177/49384090.smil
#EXTINF:-1,珠峰直播2
rtsp://115.233.40.247/PLTV/88888913/224/3221229068/10000100000000060000000005029495_0.smil
#EXTINF:-1,导视频道
rtsp://115.233.40.247/PLTV/88888913/224/3221228087/10000100000000060000000001432912_0.smil
#EXTINF:-1,高清导视
rtsp://115.233.40.247/PLTV/88888913/224/3221228038/10000100000000060000000001122729_0.smil

3. 增加路由

由于上面的地址是公共IP地址,如果不加路由的话,会走宽带的网络,是无法访问的。具体地址按自己真实的网段和网关地址进行配置。

ip rule flush table 100
ip route flush table 100
ip rule add from 192.168.31.0/24 to 61.130.57.0/24 table 100
ip rule add from 192.168.31.0/24 to 61.130.250.0/24 table 100
ip rule add from 192.168.31.0/24 to 61.130.56.0/24 table 100
ip rule add from 192.168.31.0/24 to 115.233.40.0/24 table 100
ip rule add from 192.168.31.0/24 to 115.233.41.0/24 table 100
ip rule add from 192.168.31.0/24 to 115.233.45.0/24 table 100
ip rule add from 192.168.31.0/24 to 122.229.6.0/24 table 100
ip rule add from 192.168.31.0/24 to 122.229.17.0/24 table 100
ip rule add from 192.168.31.0/24 to 220.191.136.0/24 table 100
ip rule add from 192.168.31.0/24 to 115.233.1.0/24 table 100
ip rule add from 192.168.31.0/24 to 115.233.200.0/24 table 100
ip route add default via 10.234.192.1 dev eth2 table 100

为了使上面的路由规则能够不丢失,在路由器重新启动或者在iptv网口产生了上下线事件后仍然能够自动应用上述规则,需要将上述规则添加到文件/lib/netifd/dhcp.script

vi /lib/netifd/dhcp.script

//在函数setup_interface()最后增加如下代码
	# add telecom iptv route
	if [ "$INTERFACE" = "IPTV" -a "$1" = "bound" ]; then
		ip rule flush table 100
		ip route flush table 100
		ip rule add from 192.168.31.0/24 to 61.130.57.0/24 table 100 prio 900
		ip rule add from 192.168.31.0/24 to 61.130.250.0/24 table 100 prio 901
		ip rule add from 192.168.31.0/24 to 61.130.56.0/24 table 100 prio 902
		ip rule add from 192.168.31.0/24 to 115.233.40.0/24 table 100 prio 903
		ip rule add from 192.168.31.0/24 to 115.233.41.0/24 table 100 prio 904
		ip rule add from 192.168.31.0/24 to 115.233.45.0/24 table 100 prio 905
		ip rule add from 192.168.31.0/24 to 122.229.6.0/24 table 100 prio 906
		ip rule add from 192.168.31.0/24 to 122.229.17.0/24 table 100 prio 907
		ip rule add from 192.168.31.0/24 to 220.191.136.0/24 table 100 prio 908
		ip rule add from 192.168.31.0/24 to 115.233.1.0/24 table 100 prio 909
		ip rule add from 192.168.31.0/24 to 115.233.200.0/24 table 100 prio 910
		ip route add default via 10.234.192.1 dev eth2 table 100
		echo "refresh iptv iptable rules"
	fi


// 在函数外,找到调用上面函数的入口,将参数传入,传入renew还是bound事件类型,避免频繁添加路由
case "$1" in
	deconfig)
		deconfig_interface
	;;
	renew|bound)
		setup_interface $1
	;;
esac

4. 多设备播放

多设备播放采用了Plex + xteve(ffmpeg) + docker,具体可以搜索相关内容。

Plex的优点是跨平台,界面优美,多设备同步,可玩性强,不过Plex需要Plex pass会员,有条件的可以直接购买终生会员。

参考

  1. https://github.com/luckyyyyy/blog/issues/44
  2. https://www.znds.com/tv-1137126-1-1.html
  3. https://guihet.com/tvlistconvert.html#zbyjg
  4. http://epg.51zmt.top:8000/
  5. https://github.com/xteve-project/xTeVe/issues/227