测试地址:
http://stream.guihet.com/t/fjtv.php?id=4
Python版本:
import requests import time import hashlib #时间戳 timesp = str(time.time())[:10] def fjtv(cid): fjtv_url = "http://www.fjtv.net/m2o/channel/channel_info.php?id={}".format( cid) fjtv_header = { "X-API-KEY": "97143b56f8c6b165201dfbabebc11592", "X-API-SIGNATURE": gmd5("97143b56f8c6b165201dfbabebc11592&YTE3Nzc0NmE5ODYzNWNiYWY2ODAwNmViNzk1M2VmZDM=&1.0.0&" + timesp), "X-API-TIMESTAMP": "{}".format(timesp), "X-API-VERSION": "1.0.0", "X-AUTH-TYPE": "md5", "user-agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25" } m3u8 = requests.get(fjtv_url, headers=fjtv_header).json()[0] print(m3u8['id'], m3u8['name'], m3u8['m3u8']) return m3u8 def gmd5(str): hl = hashlib.md5() hl.update(str.encode(encoding="utf-8")) return hl.hexdigest()
gmd5即是md5加密,PHP直接用md5函数即可。
2021-04-19 资源失效
放在骆驼壳里面无法播放?