# %% import os import time import datetime import subprocess import pandas as pd import json import requests from urllib.request import urlopen try : from bs4 import BeautifulSoup except : subprocess.run('sudo apt-get install python-bs4') import warnings warnings.filterwarnings("ignore") def gen_web_m3u8_KBS() : try : url_0 = "https://onair.kbs.co.kr" html_0 = requests.get(url_0, verify = False) str_0 = html_0.text.split('\n') for i in str_0 : if 'var add_ch_code' in i : channel_list = i.split("'")[1].split(',') channerl_list += ['CP03', 'CP04', 'CP05', 'CP06', 'CP07', 'CP08', 'CP09', 'CP10', 'CP11', 'CP12'] except : channel_list = ['11','12','14','81', # 1TV, 2TV, WORLD, NEWS24 'N91','N92','N94','N93','N96', # DRAMA, JOY, LIFE, W, KIDS '21','22','23','24','25','26', 'I92', #1RADIO, 2RADIO, 3RADIo, 1FM, 2FM, hanminjok, workdradio 'nvod1','nvod2','nvod3','nvod4','nvod5', 'nvod6','nvod7','nvod8','nvod9','nvod10', 'wink11','I92','cctv01', # WINK11, DOKDO 'CP03', 'CP04', 'CP05', 'CP06', 'CP07', 'CP08', 'CP09', 'CP10', 'CP11', 'CP12'] # k-event url_1 = 'https://cfpwwwapi.kbs.co.kr/api/v1/landing/live/channel_code/' kbs_ch_info = [] for i in channel_list : html_1 = requests.get(url_1 + str(i), verify = False) str_1 = json.loads(html_1.text) for j in str_1['channel_item'] : #print(j['channel_id'], j['service_url']) kbs_ch_info.append({ 'media_type' : j['media_type'], 'channel_code' : j['channel_code'], 'channel_id' : j['channel_id'], 'service_url': j['service_url'], }) df = pd.DataFrame(kbs_ch_info) df['media_group'] = 9 df['media_type'] = df['media_type'].apply(lambda x : x.upper()) df['channel_id'] = 'KBS_' + df['channel_id'].apply(lambda x : x.upper()) def media_group(x) : if x == 'TV' : return 1 elif x == 'HTTPS' : return 2 elif x == 'BORA' : return 3 elif x == 'RADIO' : return 4 elif x == 'PREVIEW' or x == 'CC' : return 9 else : return 7 df['media_group'] = df['media_type'].apply(lambda x : media_group(x)) df = df[df['media_group'] < 9] df = df.sort_values(by = ['media_group', 'media_type', 'channel_code', 'channel_id']) web_m3u8_KBS = {} for i in df.index : web_m3u8_KBS[df.loc[i, 'channel_id']] = df.loc[i, 'service_url'] return web_m3u8_KBS web_url_KBS = { # Not used 'KBS_1TV' : 'https://onair.kbs.co.kr/index.html?sname=onair&stype=live&ch_code=11&ch_type=globalList', 'KBS_2TV' : 'https://onair.kbs.co.kr/index.html?sname=onair&stype=live&ch_code=12&ch_type=globalList', 'KBS_24' : 'https://onair.kbs.co.kr/index.html?sname=onair&stype=live&ch_code=81&ch_type=globalList', 'KBS_World' : 'https://onair.kbs.co.kr/index.html?sname=onair&stype=live&ch_code=14&ch_type=globalList', 'KBS_N_Drama' : 'https://onair.kbs.co.kr/index.html?sname=onair&stype=live&ch_code=N91&ch_type=globalList', 'KBS_N_Joy' : 'https://onair.kbs.co.kr/index.html?sname=onair&stype=live&ch_code=N92&ch_type=globalList', 'KBS_N_Story' : 'https://onair.kbs.co.kr/index.html?sname=onair&stype=live&ch_code=N94&ch_type=globalList', 'KBS_N_Life' : 'https://onair.kbs.co.kr/index.html?sname=onair&stype=live&ch_code=N93&ch_type=globalList', 'KBS_N_Kids' : 'https://onair.kbs.co.kr/index.html?sname=onair&stype=live&ch_code=N96&ch_type=globalList', 'KBS_Special_Live_01' : 'https://onair.kbs.co.kr/index.html?sname=onair&stype=live&ch_code=CP05&ch_type=globalList', 'KBS_Special_Live_02' : 'https://onair.kbs.co.kr/index.html?sname=onair&stype=live&ch_code=CP06&ch_type=globalList', 'KBS_Special_Live_03' : 'https://onair.kbs.co.kr/index.html?sname=onair&stype=live&ch_code=CP07&ch_type=globalList', 'KBS_Special_Live_04' : 'https://onair.kbs.co.kr/index.html?sname=onair&stype=live&ch_code=CP08&ch_type=globalList', 'KBS_Special_Live_05' : 'https://onair.kbs.co.kr/index.html?sname=onair&stype=live&ch_code=CP09&ch_type=globalList', 'KBS_Special_Live_06' : 'https://onair.kbs.co.kr/index.html?sname=onair&stype=live&ch_code=CP10&ch_type=globalList', 'KBS_Radio_Bora_2Radio' : 'https://onair.kbs.co.kr/index.html?sname=onair&stype=live&ch_code=22&ch_type=radioList&openradio=on', 'KBS_Radio_Bora_2FM' : 'https://onair.kbs.co.kr/index.html?sname=onair&stype=live&ch_code=25&ch_type=radioList&openradio=on', 'KBS_Radio_1Radio' : 'https://onair.kbs.co.kr/index.html?sname=onair&stype=live&ch_code=21&ch_type=radioList', 'KBS_Radio_2Radio' : 'https://onair.kbs.co.kr/index.html?sname=onair&stype=live&ch_code=22&ch_type=radioList', 'KBS_Radio_3Radio' : 'https://onair.kbs.co.kr/index.html?sname=onair&stype=live&ch_code=23&ch_type=radioList', 'KBS_Radio_1FM' : 'https://onair.kbs.co.kr/index.html?sname=onair&stype=live&ch_code=24&ch_type=radioList', 'KBS_Radio_2FM' : 'https://onair.kbs.co.kr/index.html?sname=onair&stype=live&ch_code=25&ch_type=radioList', 'KBS_Radio_Hanminjok' : 'https://onair.kbs.co.kr/index.html?sname=onair&stype=live&ch_code=26&ch_type=radioList', 'KBS_Radio_World' : 'https://onair.kbs.co.kr/index.html?sname=onair&stype=live&ch_code=I92&ch_type=radioList', 'KBS_Radio_Pohang' : 'https://onair.kbs.co.kr/index.html?sname=onair&stype=live&ch_code=21&group_code=32&ch_type=localList', #'KBS_DMB_STAR' : 'http://onair.kbs.co.kr/index.html?sname=onair&stype=live&ch_code=51', #'KBS_DMB_HEART' : 'http://onair.kbs.co.kr/index.html?sname=onair&stype=live&ch_code=52', #'KBS_DMB_RADIO' : 'http://onair.kbs.co.kr/index.html?sname=onair&stype=live&ch_code=61', } web_url_EBS = { 'EBS_1TV' : 'http://www.ebs.co.kr/html/onair_tv1.html', 'EBS_2TV' : 'http://www.ebs.co.kr/html/onair_tv2.html', 'EBS_KIDS' : 'http://www.ebs.co.kr/html/onair_KIDS.html', 'EBS_PLUS1' : 'http://www.ebs.co.kr/html/onair_PLUS1.html', 'EBS_PLUS2' : 'http://www.ebs.co.kr/html/onair_PLUS2.html', 'EBS_PLUSe' : 'http://www.ebs.co.kr/html/onair_EBSe.html', 'EBS_FM' : 'http://www.ebs.co.kr/html/onair_FM.html', 'EBS_Bandi' : 'http://www.ebs.co.kr/html/onair_bandi.html', } web_url_MBC = { 'MBC' : 'http://mediaapi.imbc.com/Player/OnAirURLUtil?type=PC', 'MBC_every1' : 'http://mediaapi.imbc.com/Player/OnAirPlusURLUtil?ch=2', 'MBC_DRAMA' : 'http://mediaapi.imbc.com/Player/OnAirPlusURLUtil?ch=1', 'MBC_ON' : 'http://mediaapi.imbc.com/Player/OnAirPlusURLUtil?ch=6', 'MBC_M' : 'http://mediaapi.imbc.com/Player/OnAirPlusURLUtil?ch=3', 'MBC_ALL-THE-K-POP' : 'http://mediaapi.imbc.com/Player/OnAirPlusURLUtil?ch=4', 'MBC_NET' : 'http://mediaapi.imbc.com/Player/NVodURLUtil?chid=17', } web_m3u8_KBS = gen_web_m3u8_KBS() web_m3u8_EBS = {} web_m3u8_MBC = {} web_m3u8_ETC1 = { #'KBS_Dokdo' : 'http://kbs-dokdo.gscdn.com/dokdo_800/_definst_/dokdo_800.stream/playlist.m3u8', 'TBS_TV' : 'https://cdntv.tbs.seoul.kr/tbs/_definst_/tbs_tv_web_720.smil/playlist.m3u8', 'TBS_FM' : 'https://cdnfm.tbs.seoul.kr/tbs/_definst_/tbs_fm_web_360.smil/playlist.m3u8', 'TBS_eFM' : 'https://cdnefm.tbs.seoul.kr/tbs/_definst_/tbs_efm_web_360.smil/playlist.m3u8', #'TBS_TV' : 'https://cdntv.tbs.seoul.kr/tbs/_definst_/tbs_tv.smil/playlist.m3u8', #'TBS_FM' : 'https://cdnfm.tbs.seoul.kr/tbs/_definst_/tbs_fm.smil/playlist.m3u8', #'TBS_eFM' : 'https://cdnefm.tbs.seoul.kr/tbs/_definst_/tbs_efm.smil/playlist.m3u8', 'NATV' : 'https://m.webcast.go.kr/live/_definst_/smil:natv_720p.smil/playlist.m3u8', 'K_TV' : 'https://hlive.ktv.go.kr/live/klive_h.stream/playlist.m3u8', 'ARIRANG_TV' : 'http://amdlive-ch01.ctnd.com.edgesuite.net/arirang_1ch/smil:arirang_1ch.smil/playlist.m3u8', 'GUGAK_TV' : 'https://mgugaklive.nowcdn.co.kr/gugakvideo/gugakvideo.stream/playlist.m3u8', 'TBN_kyungbuk' : 'https://5cc6beb04faf6.streamlock.net/kyungbuk/myStream/playlist.m3u8', } web_m3u8_ETC2 = { 'MBC_GWANJ_TV' : 'https://media.kjmbc.co.kr/hls/live/stream/playlist.m3u8', # 1920x1080 'MBC_YEOSU_TV' : 'https://5c3639aa99149.streamlock.net/live_TV/tv/playlist.m3u8', # 1920x1080 'MBC_CHNCN_TV' : 'https://stream.chmbc.co.kr/live/TV/playlist.m3u8', # 1920x1080 'MBC_DAEJN_TV' : 'https://ns1.tjmbc.co.kr/live/myStream.sdp/playlist.m3u8', # 1280x720 'MBC_MOKPO_TV' : 'https://vod.mpmbc.co.kr/a_live/25246741/ch001/chunklist_w1672872502.m3u8', # 1280x720 'MBC_ULSAN_TV' : 'https://5ddfd163bd00d.streamlock.net/nHDTV/nHDTV/playlist.m3u8', # 960x540 'MBC_DAEGU_TV' : 'https://5ee1ec6f32118.streamlock.net/live/livetv/chunklist_w729883528.m3u8', # 854x480 'MBC_JENJU_TV' : 'https://5ee9633b25727.streamlock.net/jmbc_tv/_definst_/jmbc_tv.stream/chunklist_w283569664.m3u8', # 800x450 'MBC_JEJU__TV' : 'https://5cf58a556f9b2.streamlock.net:443/live/tv_jejumbc/playlist.m3u8', # 640x352 'MBC_CHNCN_AM' : 'https://stream.chmbc.co.kr/live_radio/fm2/playlist.m3u8', 'MBC_CHNCN_FM' : 'https://stream.chmbc.co.kr/live_radio2/fm1/playlist.m3u8', 'MBC_GANWN_AM' : 'http://123.254.72.24:1935/amlive/livestream/chunklist_w1908250557.m3u8', 'MBC_GANWN_FM' : 'http://123.254.72.24:1935/fmlive/livestream/chunklist_w17480494.m3u8', 'MBC_CHGBK_AM' : 'http://211.33.246.4:32954/radio_stfm/myStream.sdp/chunklist_w392819215.m3u8', 'MBC_CHGBK_FM' : 'http://211.33.246.4:32954/radio_fm/myStream.sdp/chunklist_w348337231.m3u8', 'MBC_DAEJN_AM' : 'https://ns1.tjmbc.co.kr/live_am/live_am.stream/playlist.m3u8', 'MBC_DAEJN_FM' : 'https://ns1.tjmbc.co.kr/live_fm/live_fm.stream/playlist.m3u8', 'MBC_DAEGU_AM' : 'https://5ee1ec6f32118.streamlock.net/amradio/am/chunklist_w24211307.m3u8', 'MBC_DAEGU_FM' : 'https://5ee1ec6f32118.streamlock.net/fmradio/fm/chunklist_w951122196.m3u8', 'MBC_BUSAN_AM' : 'https://stream.bsmbc.com/live/mp4:BusanMBC.Live-AM-0415/playlist.m3u8', 'MBC_BUSAN_FM' : 'https://stream.bsmbc.com/live/mp4:BusanMBC.Live-FM-0415/playlist.m3u8', 'MBC_MOKPO_AM' : 'http://vod.mpmbc.co.kr:1935/live/encoder-fm/playlist.m3u8', 'MBC_MOKPO_FM' : 'http://vod.mpmbc.co.kr:1935/live/encoder-am/playlist.m3u8', 'MBC_JEJU_AM' : 'https://5cf58a556f9b2.streamlock.net:443/live/_definst_/mp3:radio1/playlist.m3u8', 'MBC_JEJU_FM' : 'https://5cf58a556f9b2.streamlock.net:443/live/_definst_/mp3:radio2/playlist.m3u8', #'MBC_GANWN_TV' : 'http://123.254.72.24:1935/tvlive/livestream/chunklist_w445659573.m3u8', # response abnormal #'MBC_BUSAN_TV' : 'https://stream.bsmbc.com/livetv/BusanMBC_TV_livestream/playlist.m3u8', # noise appears in stream #'MBC_WONJU_TV' : 'rtsp://live.wjmbc.co.kr/wjmbctv', # rtsp is not compatible in chrome #'MBC_WONJU_AM' : 'mms://live.wjmbc.co.kr/fm2', # mms is not compatible in chrome #'MBC_WONJU_FM' : 'mms://live.wjmbc.co.kr/fm989', # mms is not compatible in chrome #'MBC_CHANG_TV' : 'https://5e78e0fa4379e.streamlock.net:443/rud08ska01mbc/mbc0205/playlist.m3u8', # exist but not connection #'MBC_CHANG_AM' : 'https://5e78e0fa4379e.streamlock.net:443/rud08ska01mbc/radio10205/playlist.m3u8', # exist but not connection #'MBC_CHANG_FM' : 'https://5e78e0fa4379e.streamlock.net:443/rud08ska01mbc/radio20205/playlist.m3u8', # exist but not connection #'MBC_JINJU_TV' : 'https://5e78e0fa4379e.streamlock.net:443/rud08ska01mbc/Jmbc0205/playlist.m3u8', # exist but not connection #'MBC_JINJU_AM' : 'https://5e78e0fa4379e.streamlock.net:443/rud08ska01mbc/Jradio10205/playlist.m3u8', # exist but not connection #'MBC_JINJU_FM' : 'https://5e78e0fa4379e.streamlock.net:443/rud08ska01mbc/Jradio20205/playlist.m3u8', # exist but not connection 'SBS_TJB_TV' : 'http://1.245.74.5:1935/live/tv/playlist.m3u8', # 1920x1080 'SBS_KBC_TV' : 'http://119.200.131.11:1935/KBCTV/tv/playlist.m3u8', # 1920x1080 'SBS_JIBS_TV' : 'http://123.140.197.22/stream/1/play.m3u8', # 1280x720 'SBS_TBC_TV' : 'http://203.251.91.122:1935/on-air-Backup/tv/playlist.m3u8', # 854x480 #'SBS_TBC_TV' : 'http://221.157.125.239:1935/live/psike/playlist.m3u8', # 960x540 'SBS_UBC_TV' : 'http://59.25.202.82:1935/live/UBCstream/playlist.m3u8', # 960x540 'SBS_CJB_TV' : 'https://5ee9be10640ac.streamlock.net/live/cjbtv/playlist.m3u8', # 960x540 'SBS_KNN_TV' : 'http://211.220.195.200:1935/live/mp4:KnnTV.sdp/chunklist_w1445879965.m3u8', # 800x450 'SBS_G1_TV' : 'https://5fe169eb5feaa.streamlock.net/live/_definst_/tv.stream/chunklist_w2120854797.m3u8', # 600x360 'SBS_KBC_FM_1' : 'https://vod.ikbc.co.kr/KBCFM/kbcra_aac/playlist.m3u8', 'SBS_KBC_FM_2' : 'http://119.200.131.11:1935/KBCFM/kbcra_aac/playlist.m3u8', 'SBS_TJB_FM' : 'http://1.245.74.5/radiolive/radio_64k/playlist.m3u8', 'SBS_TBC_FM' : 'http://203.251.91.122:1935/on-air/fm/playlist.m3u8', #'SBS_TBC_FM' : 'http://221.157.125.239:1935/live/mp3:fmstream/playlist.m3u8', 'SBS_UBC_FM' : 'http://59.23.231.102:1935/live/mp3:UBCfmstream/playlist.m3u8', # 'SBS_UBC_FM' : 'http://59.25.202.82:1935/live/mp3:UBCfmstream/playlist.m3u8', 'SBS_CJB_FM' : 'https://5ee9be10640ac.streamlock.net/live/cjbradio/chunklist_w1790754303.m3u8', 'SBS_KNN_1FM' : 'http://211.220.195.200:1935/live/mp4:KnnRadio1FM.sdp/playlist.m3u8', 'SBS_KNN_2FM' : 'http://211.220.195.200:1935/live/mp4:KnnRadio2FM.sdp/chunklist_w221840589.m3u8', 'KFN_TV' : 'https://mediaworks.dema.mil.kr/live_edge/cudo.sdp/playlist.m3u8', 'KFN_FM_Bora' : 'https://mediaworks.dema.mil.kr/live_edge/video.sdp/playlist.m3u8', 'KFN_FM' : 'https://mediaworks.dema.mil.kr/live_edge/audio.sdp/playlist.m3u8', 'NBS' : 'https://media.joycorp.co.kr:4443/live/live_360p/playlist.m3u8', 'RTV' : 'https://rtv-stream.a04f922e9e85c8d25ebfeae3dfd22a67.com/rtv/rtv.m3u8', 'STB' : 'https://606d65214d80f.streamlock.net/live-stb/_definst_/72686cff038fba06e41ed7ed6562ef7470d11524d86cdd835a22532b3bfa7499/playlist.m3u8', 'KCTV_05' : 'http://119.77.96.184:1935/chn05/chn05/playlist.m3u8', 'KCTV_21' : 'http://119.77.96.184:1935/chn21/chn21/playlist.m3u8', 'KCTV_JEJU' : 'https://vod.kctvjeju.com/ch7/ch4/playlist.m3u8', 'Rtomato_TV' : 'http://rtomatofms2.hscdn.com/rtomato/livestream/playlist.m3u8', 'BTN_TV' : 'http://btn.nowcdn.co.kr/btn/btnlive2m/playlist.m3u8', 'BTN_TV_Audio' : 'http://btn.nowcdn.co.kr/btnaudio/btnliveaudio/playlist.m3u8', 'BTN_ONAIR_03' : 'http://btn.nowcdn.co.kr/btn_ch4st/live.stream/playlist.m3u8', 'BTN_ONAIR_04' : 'http://btn.nowcdn.co.kr/btn_ch1st/live.stream/playlist.m3u8', 'BTN_ONAIR_05' : 'http://btn.nowcdn.co.kr/btn_ch3st/live.stream/playlist.m3u8', 'BTN_ONAIR_06' : 'http://btn.nowcdn.co.kr/btn_ch2st/live.stream/playlist.m3u8', 'BBS_TV' : 'http://bbstv.clouducs.com:1935/bbstv-live/livestream/playlist.m3u8', 'BBS_TV' : 'https://bbslive.clouducs.com/bbstv-live/livestream/playlist.m3u8', 'BBS_RADIO' : 'http://bbsfm.smilecdn.com:1935/bbsfm/live.sdp/playlist.m3u8', 'BBS_RADIO' : 'http://bbslive.clouducs.com:1935/bbsradio-live/livestream/playlist.m3u8', 'BBS_RADIO' : 'http://bbslive.clouducs.com:1935/bbsradio-mlive/livestream/playlist.mp3', 'BBS_RADIO' : 'https://bbslive.clouducs.com/bbsradio-live/livestream/playlist.m3u8', 'CTS_TV1' : 'https://d34t5yjz1ooymj.cloudfront.net/out/v1/875039d5eba0478fa8375a06b3aa5a37/index.m3u8', 'CTS_TV2' : 'https://cdn.cts.tv/out/v1/875039d5eba0478fa8375a06b3aa5a37/index.m3u8', 'CTS_RADIO' : 'https://cdn.zroad.tv/channel36_1/stream36_1/playlist.m3u8', 'CTS_RADIO' : 'https://cdn.zroad.tv/channel36_3/stream36_3/playlist.m3u8', 'CTS_RADIO' : 'https://cdn.zroad.tv/channel36_4/stream36_4/playlist.m3u8', 'CTS_RADIO' : 'https://cdn.zroad.tv/channel36_6/stream36_6/playlist.m3u8', 'CTS_RADIO' : 'https://cdn.zroad.tv/channel36_7/stream36_7/playlist.m3u8', 'CTS_RADIO' : 'https://cdn.zroad.tv/channel36_8/stream36_8/playlist.m3u8', 'CPBC_TV1' : 'http://49.1.248.33:1935/vod/_definst_/amlst:240@PBC_240P/tv/reading_father/reading_father_20181201.mp4__360@PBC_360P/tv/reading_father/reading_father_20181201.mp4__720@PBC_HD/tv/reading_father/reading_father_20181201.mp4/playlist.m3u8', 'CPBC_TV2' : 'http://onair2.cpbc.co.kr:1935/live/Instreamer.stream_aac/playlist.m3u8', 'YTN' : 'https://www.ytn.co.kr/_hd/hd_live.html', 'Yonhapnewstv' : 'https://www.yonhapnewstv.co.kr/live', 'WOWTV' : 'https://www.wowtv.co.kr/Broad/OnAir/Index?menuSeq=643', 'SENTV' : 'http://www.sentv.co.kr/onair', 'MTN' : 'https://www.mtn.co.kr/live/index.mtn', 'edaily' : 'https://tv.edaily.co.kr/Live/HighVod', 'MBN' : 'http://mbnmoney.mbn.co.kr/tv/onair', '*** HLS Playback ***' : 'https://chrome.google.com/webstore/detail/native-hls-playback/emnphkkblegpebimobpbekeedfgemhof', '*** HLS Playback ****' : 'https://chromewebstore.google.com/detail/hls-player-m3u8-streaming/eakdijdofmnclopcffkkgmndadhbjgka', } for i in web_url_EBS : html = requests.get(web_url_EBS[i], verify = False) str_0 = html.text str_0 = str_0.split('\n') str_1 = [] for j in str_0 : str_1 = j.split('\'') for k in str_1 : if 'm3u8' in k : web_m3u8_EBS[i] = k for i in web_url_MBC : html = requests.get(web_url_MBC[i], verify = False) str_0 = html.text str_0 = str_0.split('\"') str_1 = [] for j in str_0 : str_1 = j.split('\"') for k in str_1 : if 'm3u8' in k : web_m3u8_MBC[i] = k # BEST : KBS1, KBS2, EBS1, EBS2, MBC_GWANJ_TV, MBC_YEOSU_TV, SBS_TJB_TV, SBS_KBC_TV for _ in range(1) : web_m3u8_BEST = {} try : #web_m3u8_BEST['TBS_TV'] = web_m3u8_ETC1['TBS_TV'] web_m3u8_BEST['KBS_1TV'] = web_m3u8_KBS['KBS_1TV'] web_m3u8_BEST['KBS_2TV'] = web_m3u8_KBS['KBS_2TV'] web_m3u8_BEST['MBC_GWANJ_TV'] = web_m3u8_ETC2['MBC_GWANJ_TV'] web_m3u8_BEST['MBC_YEOSU_TV'] = web_m3u8_ETC2['MBC_YEOSU_TV'] web_m3u8_BEST['SBS_TJB_TV'] = web_m3u8_ETC2['SBS_TJB_TV'] web_m3u8_BEST['SBS_KBC_TV'] = web_m3u8_ETC2['SBS_KBC_TV'] web_m3u8_BEST['SBS_TBC_TV'] = web_m3u8_ETC2['SBS_TBC_TV'] web_m3u8_BEST['EBS_1TV'] = web_m3u8_EBS['EBS_1TV'] web_m3u8_BEST['EBS_2TV'] = web_m3u8_EBS['EBS_2TV'] except : pass html_head = """