Merge pull request #97 from wonipapa/devel

skylife 대응 GetEPGFromSKY 수정
This commit is contained in:
wonipapa 2018-03-22 14:41:32 +09:00 committed by GitHub
commit 9f598837a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -3,7 +3,7 @@
@date_default_timezone_set('Asia/Seoul');
error_reporting(E_ALL ^ E_NOTICE);
@set_time_limit(0);
define("VERSION", "1.2.5p1");
define("VERSION", "1.2.5p2");
$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'";
$timeout = 5;
@ -811,7 +811,7 @@ function GetEPGFromSKY($ChannelInfo) {
$ChannelName = $ChannelInfo[1];
$ServiceId = $ChannelInfo[3];
foreach(range(1, $GLOBALS['period']) as $k) :
$url = "http://www.skylife.co.kr/channel/epg/channelScheduleListJson.do";
$url = "http://www.skylife.co.kr/channel/epglist/channelScheduleListJson.do";
$day = date("Y-m-d", strtotime("+".($k - 1)." days"));
$params = array(
'area' => 'in',

View File

@ -44,7 +44,7 @@ if not sys.version_info[:2] == (2, 7):
sys.exit()
# Set variable
__version__ = '1.2.5p1'
__version__ = '1.2.5p2'
debug = False
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': '*/*'}
@ -433,7 +433,7 @@ def GetEPGFromSKY(ChannelInfo):
ChannelId = ChannelInfo[0]
ChannelName = ChannelInfo[1]
ServiceId = ChannelInfo[3]
url = 'http://www.skylife.co.kr/channel/epg/channelScheduleListJson.do'
url = 'http://www.skylife.co.kr/channel/epglist/channelScheduleListJson.do'
for k in range(period):
day = today + datetime.timedelta(days=k)
params = {'area': 'in', 'inFd_channel_id': ServiceId, 'inairdate': day.strftime('%Y-%m-%d'), 'indate_type': 'now'}
@ -441,6 +441,7 @@ def GetEPGFromSKY(ChannelInfo):
response = requests.post(url, data=params, headers=ua, timeout=timeout)
response.raise_for_status()
json_data = response.text
print(json_data)
try:
data = json.loads(json_data, encoding='utf-8')
if (len(data['scheduleListIn']) == 0) :