教你如何提取XML文件的节目源地址
应该有很多机友在找节目源的时候,会一不小心下载到XML格式的节目源文件,经常会束手无策,不知道怎么提取里面的节目源地址。本人也是小白用户,在这里分享一个比较笨的做法。以下面这一串字符为例:
<?xml version="1.0" encoding="UTF-8"?>
<xml ><tvlist label="大杂烩[国内]" ><tv ><channelid >D0001</channelid>
<name >CCTV-1</name>
<url tvsource="P2P" ><!http://vdn.apps.cntv.cn/api/getLiveUrlCommonRedirectApi.do?channel=pa://cctv_p2p_hdcctv1&type=ipad]]></url>
<url tvsource="LS1" ><!http://live.gslb.letv.com/gslb?stream_id=cctv1&tag=live&ext=m3u8&sign=live_ipad]]></url>
<url tvsource="LS2" ><!http://live.gslb.letv.com/gslb?stream_id=cctv1&tag=live&ext=m3u8]]></url>
<url tvsource="52" ><!http://ipadlive.cntv.soooner.com/cctv_p2p_hdcctv1.m3u8]]></url>
<url tvsource="源3" ><!http://119.4.250.55:1935/SRT_Live/CCTV1_M.stream/playlist.m3u8]]></url>
<url tvsource="BST" ><!http://121.58.54.150/PLTV/88888888/224/0/3221225734/iptv18195.smil]]></url>
<url tvsource="高清1" ><!rtsp://116.199.127.68/cctv1_HD]]></url>
<url tvsource="M3" ><!http://74.82.62.53:1935/liverepeater/15.stream/playlist.m3u8]]></url>
<url tvsource="FY" ><!http://hlslive1.cntv.wscdns.com/cache/1_/seg0/index=m3u8]]></url>
</tv>
<tv ><channelid >D0002</channelid>
<name >CCTV-2</name>
<url tvsource="LS1" ><!http://live.gslb.letv.com/gslb?stream_id=cctv2&tag=live&ext=m3u8&sign=live_ipad]]></url>
<url tvsource="P2P" ><!http://vdn.apps.cntv.cn/api/getLiveUrlCommonRedirectApi.do?channel=pa://cctv_p2p_hdcctv2&type=ipad]]></url>
<url tvsource="源3" ><!http://119.4.250.55:1935/SRT_Live/CCTV2_M.stream/playlist.m3u8]]></url>
<url tvsource="BST" ><!http://121.58.54.150/PLTV/88888888/224/0/3221225733/iptv18196.smil]]></url>
<url tvsource="52" ><!http://ipadlive.cntv.soooner.com/cctv_p2p_hdcctv2.m3u8]]></url>
<url tvsource="源8/8" ><!http://74.82.62.53:1935/liverepeater/14.stream/playlist.m3u8]]></url>
<url tvsource="FY" ><!http://hlslive1.cntv.wscdns.com/cache/7_/seg0/index=m3u8]]></url>
</tv>
1、在“<name >”和“</name>”之间的字符为频道名称,像上面标红的CCTV-1就是频道名称
2、频道名称下面的用“[]”框起来以“http”或者这“rtsp”开头,在上面以紫色标记部分为节目源地址
3、将节目源频道和节目源地址提取出来,有多个节目源的以同样的名称命名即可实现多源切换如:
CCTV-1 http://vdn.apps.cntv.cn/api/getLiveUrlCommonRedirectApi.do?channel=pa://cctv_p2p_hdcctv1&type=ipad
CCTV-1 http://live.gslb.letv.com/gslb?stream_id=cctv1&tag=live&ext=m3u8&sign=live_ipad
CCTV-1 http://live.gslb.letv.com/gslb?stream_id=cctv1&tag=live&ext=m3u8
CCTV-1 http://ipadlive.cntv.soooner.com/cctv_p2p_hdcctv1.m3u8
CCTV-1 http://119.4.250.55:1935/SRT_Live/CCTV1_M.stream/playlist.m3u8
CCTV-1 http://121.58.54.150/PLTV/88888888/224/0/3221225734/iptv18195.smil
CCTV-1 rtsp://116.199.127.68/cctv1_HD
CCTV-1 http://74.82.62.53:1935/liverepeater/15.stream/playlist.m3u8
CCTV-1 http://hlslive1.cntv.wscdns.com/cache/1_/seg0/index=m3u8
thanks 有用 ddddddddddddd 谢谢老师 学习了 强烈支持楼主ing……
页:
[1]