Update 1.2.2p3

HCN 함수 수정
This commit is contained in:
wonipapa 2017-09-18 09:36:35 +09:00 committed by GitHub
parent c79cd7dc75
commit 49a4b1dc58

View File

@ -38,7 +38,7 @@ except ImportError:
reload(sys) reload(sys)
sys.setdefaultencoding('utf-8') sys.setdefaultencoding('utf-8')
__version__ = '1.2.2p2' __version__ = '1.2.2p3'
if not sys.version_info[:2] == (2, 7): if not sys.version_info[:2] == (2, 7):
print("Error : ", "python 2.7 버전이 필요합니다.", file=sys.stderr) print("Error : ", "python 2.7 버전이 필요합니다.", file=sys.stderr)
@ -584,13 +584,15 @@ def GetEPGFromHcn(ChannelInfo):
html_data = response.content html_data = response.content
data = html_data data = html_data
strainer = SoupStrainer('li') strainer = SoupStrainer('li')
soup = BeautifulSoup(data, 'lxml', parse_only=strainer, from_encoding='utf-8') soup = BeautifulSoup(data, htmlparser, parse_only=strainer, from_encoding='utf-8')
html = soup.find_all('li') if soup.find_all('li') else '' html = soup.find_all('li') if soup.find_all('li') else ''
if(html) : if(html) :
for row in html: for row in html:
startTime = endTime = programName = subprogramName = desc = actors = producers = category = episode = '' startTime = endTime = programName = subprogramName = desc = actors = producers = category = episode = ''
rebroadcast = False rebroadcast = False
rating = 0 rating = 0
if 'noData' in row['class']:
continue
startTime = str(day) + ' ' + row.find('span', {'class':'progTime'}).text.strip() startTime = str(day) + ' ' + row.find('span', {'class':'progTime'}).text.strip()
startTime = datetime.datetime.strptime(startTime, '%Y-%m-%d %H:%M') startTime = datetime.datetime.strptime(startTime, '%Y-%m-%d %H:%M')
startTime = startTime.strftime('%Y%m%d%H%M%S') startTime = startTime.strftime('%Y%m%d%H%M%S')
@ -1150,4 +1152,4 @@ elif output == "socket" :
else : else :
printError("epg2xml.json 파일의 default_xml_socket항목이 없습니다."); printError("epg2xml.json 파일의 default_xml_socket항목이 없습니다.");
sys.exit() sys.exit()
getEpg() getEpg()