MatteO-Matic / pandatvAPI

MIT License
21 stars 3 forks source link

直播流URL不能用了吗? #2

Closed yugai closed 7 years ago

yugai commented 7 years ago

m3u8 files to ts streams 这个接口 是不是不能播放了?

MatteO-Matic commented 7 years ago

It's possible. For example:

http://panda.tv/45449

Get the room info

http://www.panda.tv/api_room_v2?roomid=45449

Take out the "room_key" and "plflag"

fdf99d8c74db91a6f97ba55f69455977 4_8

Create the link

http://pl-hls[plflag].live.panda.tv/live_panda/[room_key].m3u8 http://pl-hls8.live.panda.tv/live_panda/fdf99d8c74db91a6f97ba55f69455977.m3u8

Inside of fdf99d8c74db91a6f97ba55f69455977.m3u8

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:2977
#EXT-X-TARGETDURATION:8
#EXTINF:8.333,
fdf99d8c74db91a6f97ba55f69455977-2174195970.ts
#EXTINF:7.333,
fdf99d8c74db91a6f97ba55f69455977-2174945940.ts
#EXTINF:8.334,
fdf99d8c74db91a6f97ba55f69455977-2175605910.ts

You can play the ts stream through for example VLC File -> Open Network Stream (ctrl+N) -> http://pl-hls8.live.panda.tv/live_panda/fdf99d8c74db91a6f97ba55f69455977.m3u8 -> Play