commit
c883a57f19
@ -3,7 +3,7 @@
|
|||||||
@date_default_timezone_set('Asia/Seoul');
|
@date_default_timezone_set('Asia/Seoul');
|
||||||
error_reporting(E_ALL ^ E_NOTICE);
|
error_reporting(E_ALL ^ E_NOTICE);
|
||||||
@set_time_limit(0);
|
@set_time_limit(0);
|
||||||
define("VERSION", "1.2.4");
|
define("VERSION", "1.2.4p1");
|
||||||
$debug = False;
|
$debug = False;
|
||||||
$ua = "'Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36'";
|
$ua = "'Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36'";
|
||||||
$timeout = 5;
|
$timeout = 5;
|
||||||
@ -969,7 +969,7 @@ function GetEPGFromIscs($ChannelInfo) {
|
|||||||
foreach(range(1, $GLOBALS['period']) as $k) :
|
foreach(range(1, $GLOBALS['period']) as $k) :
|
||||||
$istomorrow = False;
|
$istomorrow = False;
|
||||||
$url = "https://www.iscs.co.kr/service/sub/ajax_channel_view.asp";
|
$url = "https://www.iscs.co.kr/service/sub/ajax_channel_view.asp";
|
||||||
$day = date("Y-m-d", strtotime("+".($k - 1)." days"));
|
$day = date("Y-m-d", strtotime("+".($k - 2)." days"));
|
||||||
$params = array(
|
$params = array(
|
||||||
's_idx' => $ServiceId,
|
's_idx' => $ServiceId,
|
||||||
'c_date' => $day
|
'c_date' => $day
|
||||||
|
10
epg2xml.py
10
epg2xml.py
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python2
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
@ -44,7 +44,7 @@ if not sys.version_info[:2] == (2, 7):
|
|||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
# Set variable
|
# Set variable
|
||||||
__version__ = '1.2.4'
|
__version__ = '1.2.4p1'
|
||||||
debug = False
|
debug = False
|
||||||
today = datetime.date.today()
|
today = datetime.date.today()
|
||||||
ua = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36', 'accept': '*/*'}
|
ua = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36', 'accept': '*/*'}
|
||||||
@ -392,6 +392,7 @@ def GetEPGFromSKB(ChannelInfo):
|
|||||||
data = re.sub(pattern, partial(replacement, tag='span'), data)
|
data = re.sub(pattern, partial(replacement, tag='span'), data)
|
||||||
strainer = SoupStrainer('div', {'id':'dawn'})
|
strainer = SoupStrainer('div', {'id':'dawn'})
|
||||||
soup = BeautifulSoup(data, htmlparser, parse_only=strainer, from_encoding='utf-8')
|
soup = BeautifulSoup(data, htmlparser, parse_only=strainer, from_encoding='utf-8')
|
||||||
|
soup = soup.prettify()
|
||||||
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:
|
||||||
@ -401,7 +402,10 @@ def GetEPGFromSKB(ChannelInfo):
|
|||||||
startTime = str(day) + ' ' + row.find('span', {'class':'time'}).text
|
startTime = str(day) + ' ' + row.find('span', {'class':'time'}).text
|
||||||
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')
|
||||||
cell = row.find('span', {'class':'title'}).text.decode('string_escape').strip()
|
cell = row.find('span', {'class':'title'})
|
||||||
|
print(cell)
|
||||||
|
if(cell):
|
||||||
|
cell = cell.text.decode('string_escape').strip()
|
||||||
pattern = "^(.*?)(\(([\d,]+)회\))?(<(.*)>)?(\((재)\))?$"
|
pattern = "^(.*?)(\(([\d,]+)회\))?(<(.*)>)?(\((재)\))?$"
|
||||||
matches = re.match(pattern, cell)
|
matches = re.match(pattern, cell)
|
||||||
if not(matches is None) :
|
if not(matches is None) :
|
||||||
|
Loading…
x
Reference in New Issue
Block a user