m3u8 Migu 비디오 라이브 방송 주소 TVBox APP 구성

이 도구는 Migu Video의 생방송 주소를 실시간으로 가져와 ./lives/migu.txt에 저장합니다. 바로 사용할 수 있습니다. 앱 구성.
http://127.0.0.1:9978/file/TVBoxx/MeowTV/TVBoxx/lives/migu.txt 

/storage/emulated/0/ 이 도구의 저장 경로는 /TVBoxx/MeowTV/TVBoxx/입니다. 원하는 대로 수정할 수 있습니다.
시간적 여유: 약 4시간 이상, 특정 자가 테스트
아니, 아니, 아니, 아니, 세 번이나 말하는 건 중요하거든요..

미구 비디오 ##의 m3u8에 관하여
https://blog.csdn.net/chouzhou9701/article/details/119260799

m3u8 Migu 비디오 라이브 방송 주소 TVBox APP 설정-1

urllib에서 requests,json,time,random을 가져오고 pprint에서 parse를 가져오고 pprint에서 가져오기 #모든 채널:https://m.miguvideo.com/m/home/f08583e602f846a5b870f3de3b673326?plt=sub&channelId=10010001005 def get_topVomsID(): #CCTV의 vomsID: url='https://program-sc.miguvideo.com/live/v2/tv-data/a5f78af9d160418eb679a6dd0429c920' res=requests.get(url,headers=headers) res_js=json.loads(res.text)['body'] livelist=res_js['liveList'] #all:['인기', '스포츠', 'CCTV', ['위성 TV', '지역', '영화 및 텔레비전', '뉴스', '교육', '판다', '엔터테인먼트', '어린이', '다큐멘터리', '세계의 인상', '라디오'] mychannels=['인기', '스포츠', 'CCTV', '위성 TV', '영화 및 텔레비전'] # 자체 선택 채널 #print(livelist) #nowVomsId=res_js['nowVomsId'] top_names,vomsIDs=[],[] for list in livelist: top_name,vomsID=list['name'],list['vomsID'] if top_name in mychannels: top_names.append(top_name) vomsIDs.append(vomsID) print(f'self-selected 채널:{top_names}') return top_names,vomsIDs def get_tv_id(id): #CCTV 프로그램 목록 now|next, icon, pID, name # CCTV: url=f'https://program-sc.miguvideo.com/live/v2/tv-data/{id}' #print(url) res=requests.get(url,headers=headers) res_js=json.loads(res.text)['body'] datalist=res_js['dataList'] names,pIDs=[],[] for data in data in datalist: name=data['name'] pID=data['pID'] names.append(name) pIDs.append(pID) nw=data.get('now','') if nw!='': now=nw['startTime']+'-'+nw['endTime']+' '+nw['playName'] if 'next' in data: nt=data['next'] next=nt['startTime']+'-'+nt['endTime']+' '+nt['playName'] print(name,pID,now,next) else: print(name,pID,now) return names,pIDs def get_play_url(pIDs): #print(pIDs) h5_urls=[] for id in pIDs: #print(id) #rateType=3HD #print(id)#live "pID":"608807420" url=f'https://webapi.miguvideo.com/gateway/playurl/v3/play/playurl?contId={id}&rateType=3&startPlay=true' #url='http://webapi.miguvideo.com/gateway/playurl/v2/play/playurlh5?contId=635491149&rateType=3&startPlay=true' #url='https://webapi.miguvideo.com/gateway/playurl/v3/play/playurl?contId=635491149&rateType=3&startPlay=true' #'http://webapi.miguvideo.com/gateway/playurl/v2/play/playurlh5?contId=631780532&rateType=3& clientId=5e31849abe9be8ad087ca5fbd67b0e14&startPlay=true&xh265=false&channelId=0131_10010001005' #time.sleep(1) res=requests.get(url,headers=headers) play_jsons=json.loads(res.text) ##단일 소스 메시지=play_jsons["message"] if message=="SUCCESS": #pprint(play_jsons) h5_url=play_jsons['body']['urlInfo']['url'] #TypeError: 'NoneType' 접근 권한에 대한 저작권 제한 #cctv1608807420 h5_urls.append(h5_url) else: print(f'ID:{id} ,저작권 제한,시청 불가') h5_urls.append('error') return h5_urls def ddCalcu(url): #play_url은 getm3u8 주소를 다시 구문 분석합니다.new_url = parse.urlparse(url) #print(new_url) para = dict(parse.parse_qsl(new_url.query)) #print(para) userid = para.get("userid","") timestamp = para.get("timestamp","") ProgramID = para.get("ProgramID","") Channel_ID = para.get("Channel_ID","") puData = para.get("puData","") t = userid if userid else "eeeeeeeee" r = timestamp if timestamp else "tttttttttttttttt" n = ProgramID if ProgramID else "cccccccccc" a = Channel_ID if Channel_ID else "nnnnnnnnnnnnnnnn" o = puData if puData else "" if not o: return url s = list("2624") u = list(t)[int(s[0])] or "e" l = list(r)[int(s[1])] or "t" c = list(n)[int(s[2])] 또는 "c" f = list(a)[len(a)-int(s[3])] 또는 "n" d = list(o) h = [] p = 0 #print(p*2 < len(d)) p*2 동안 < len(d): h.append(d[len(d)-p-1]) p인 경우 < len(d) - p -1: h.append(o[p]) p == 1인 경우: h.append(u) p == 2인 경우: h.append(l) p == 3인 경우: h.append(c) p == 4인 경우: h.append(f) p += 1 v = "".join(h) return url + "&ddCalcu=" + v def api(new_url): # 헤더를 세 번째로 구문 분석합니다={ 'Host': 'h5live.gslb.cmvideo.cn', 'Connection': 'keep-alive', 'Accept': 'text/plain, */*; q=0.01', 'X-Requested-With': 'mark.via', 'Accept-Encoding': 'gzip, deflate', 'Accept-Language': 'zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7', 'Origin':'http://m.miguvideo.com', 'Referer':'http://m.miguvideo.com/', 'User-Agent':'Mozilla/5.0 (Linux; Android 10; SP300 Build/CMDCSP300;) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/92.0.4515.105 Mobile Safari/537.36'} #param={'crossdomain':'www'} time.sleep(1) #104: 네트워크 연결 예외 try #requests.exceptions.ConnectionError: try: res=requests.get(new_url,headers=headers,timeout=10) #print(res.status_code) m3u8=str(res.text) return m3u8 except requests.exceptions.ConnectionError as e: print('✘네트워크 연결 예외: ', e) return False except requests.exceptions.Timeout as e: print('✘연결 시간 초과: ',e) except requests.exceptions.RequestException as e: print('✘요청 예외: ', e) except requests.exceptions.HTTPError as e: print(f'✘HTTP 오류, 상태 코드: {e.response.status_code}, {e}') except ValueError as e: print('✘응답 구문 분석 예외: ', e) def run(): top_vmos=get_topVomsID() top_names,vomsIDs=top_vmos[0],top_vmos[1] ftime = time.strftime("%Y%m%d %H:%M", time.localtime()) s='🎈🦋🦜🍀💋🎤🎗🎖\ 🏅✨🎋🌳🍃🌱🌿☘💥\ 🥇🥈🥉🌹🏵 ️🍂🌺🎍🌴' f=open('lives/migu.txt','w+') f.write(f'🎖Migu 라이브 소스,#장르#\n') f.write(f'by caliph21_{ftime} 업데이트,https://15799848.s21v.faiusr.com/58/ABUIABA6GAAgr-2n9AUoqsakNg.mp4\n') f.write('串烧,https://vd4.bdstatic.com/mda-mkn4iq79ihtufbc1/sc/cae_h264/1637639849265611965/mda-mkn4iq79ihtufbc1.mp4\n\n') f.close() for i in range(len(vomsIDs)): pic=random.choice(s) top_name=top_names[i] print('\n',top_name,f'{i+1}/{len(vomsIDs)}') #time.sleep(1) tv_id=get_tv_id(vomsIDs[i]) print('\n') #time.sleep(1) h5_urls=get_play_url(tv_id[1]) f=open('lives/migu.txt','a+') f.write(f'{pic}|{top_name},#genre#\n\n') f.close() for name,url in zip(tv_id[0],h5_urls): #print(url) if url!='error': new_url=ddCalcu(url) #print(new_url) #time.sleep(1) m3u8=api(new_url+'&crossdomain=www') #print(url==new_url) m3u8!=False인 경우: # 104 네트워크 연결 예외 제거 print(f'소스 업데이트 중: {name} ……') #print(m3u8) with open('lives/migu.txt','a+') as f: f.write(name+','+str(m3u8)+'\n') f.close() __name__ == '__main__'인 경우: #names,pIDs=[],[] headers={'User-Agent':'Mozilla/5.0 (Linux; Android 10; SP300 Build/CMDCSP300;) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/93.0.4515.105 모바일 Safari/537.36'} run() #url = "https://h5live.gslb.cmvideo.cn/migu/kailu/20200324/cctv4meihd/50/index.m3u8?msisdn=20231224165648c5b9040c723843188ccd7b0e30f81b36&mdspid =&spid=699004&netType=0&sid=2200179344&pid=2028597139×tamp=20231224165648&Channel_ID=0116_25000000-99000-100300010010001&ProgramID=6088074 16&ParentNodeID=-99&assertID=2200179344&client_ip=240e:478:4840:1642:17a3:aca9:695:be83&SecurityKey=20231224165648&promotionId=&mvid=22001 79344&mcid=500020&playurl버전=WX-A1-6.12.1.1-RELEASE&userid=&jmhm=&videocodec=h264&bean=mgsph5&puData=8c5826a81b06fdc46a46a9128be66cd0" #url='https://h5live.gslb.cmvideo.cn/wd_r2/cctv/cctv1hd/600/index.m3u8?msisdn=202312241405015bc0ae24f1bb42dc9e16ff0f7ac931f9&mdspid=& spid=699004&netType=0&sid=2201057821&pid=2028597139×tamp=20231224140501&Channel_ID=0116_25000000-99000-100300010010001&ProgramID=60880742 0&ParentNodeID=-99&assertID=2201057821&client_ip=240e:478:4840:1642:17a3:aca9:695:be83&SecurityKey=20231224140501&promotionId=&mvid=22010 57821&mcid=500020&playurlVersion=WX-A1-6.12.1.1-RELEASE&userid=&jmhm=&videocodec=h264&bean=mgsph5&puData=3f841e2a0b365c2914ee68cd75073bdb' #new_url = ddCalcu(url) #print(new_url) #from 트랜스포머에서 CLIPModel 가져오기 #model = CLIPModel.from_pretrained("openai/clip-vit-large-patch14", from_tf=True)

 

3/5 - (4표)

댓글남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다