valid_rtmp module

寻找过滤有效的rtmp,or,rtsp直播地址

帮助:python pkl2csv.py -h

使用示例:python valid_rtmp.py -u https://blog.csdn.net/osle123/article/details/52757886

步骤:

1,下载页面:https://blog.csdn.net/osle123/article/details/52757886(避免使用csdn等,需点击触发显示全部的网页)

2,正则匹配:rtmp://, rtsp://等地址

3,[rtmp;//xx.com,rtsp://yy.com]使用ping+cv2.read()验证有效性

class valid_rtmp.ValidRtmp[源代码]

基类:object

采集过滤有效的rtmp,or,rtsp播放地址

get_rtmp_url(url: str) → List[str][源代码]

获取url网页内容中的rtsp,rtmp地址

参数:url (str) -- 待采集的种子url地址
Return list:种子url中的rtsp,rtmp地址
headers = {'Accept': 'application/json, text/javascript, */*; q=0.01', 'Accept-Encoding': 'gzip, deflate, br', 'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8,ja;q=0.7,tr;q=0.6,fr;q=0.5,zh-TW;q=0.4', 'Connection': 'keep-alive', 'Sec-Fetch-Dest': 'empty', 'Sec-Fetch-Mode': 'cors', 'Sec-Fetch-Site': 'same-origin', 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36'}
valid(url: str) → str[源代码]

是否是合法的rtsp,rtmp地址

:param str url:待验证的url(rtsp or rtmp)地址, :return str: 如果:是,返回入参的url,如果:不是,返回空串