skylife 대응 GetEPGFromSKY 수정
This commit is contained in:
parent
20ac5ebe74
commit
5db2e1477b
@ -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',
|
||||
|
@ -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) :
|
||||
|
Loading…
x
Reference in New Issue
Block a user