update 1.2.3

- PHP 버전통합
  - PYTHON 버전 html Parser 변수 추가
  - 소스 추가
  - Channel.json Enabled 항목 제거
  - 에피소드 넘버 xmltv_ns 옵션 항목 추가
  - 가져오는 날짜 최대 7일로 변경
  - KT 함수 수정
This commit is contained in:
wonipapa 2017-10-10 17:27:09 +09:00
parent 2beb41b715
commit 355efea26d
5 changed files with 383 additions and 379 deletions

View File

@ -31,7 +31,7 @@
{ "Id": 40, "Name": "CJ오쇼핑", "KT Name": "CJ오쇼핑", "KTCh": 4, "LG Name": "CJ오쇼핑", "LGCh": 8, "SK Name": "CJ오쇼핑", "SKCh": 6, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/uBClUx6.png", "Source": "EPG", "ServiceId": "250" },
{ "Id": 41, "Name": "CJ오쇼핑 플러스", "KT Name": "CJ오쇼핑플러스", "KTCh": 28, "LG Name": "CJ오쇼핑+", "LGCh": 32, "SK Name": "CJ오쇼핑 플러스", "SKCh": 33, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/WlK2YDk.png", "Source": "KT", "ServiceId": "28" },
{ "Id": 42, "Name": "CLASSICA", "KT Name": "CLASSICA", "KTCh": 90, "LG Name": "클래시카", "LGCh": 146, "SK Name": "Classica HD", "SKCh": 235, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/FEfMS0W.png", "Source": "EPG", "ServiceId": "365" },
{ "Id": 43, "Name": "CMC가족오락TV", "KT Name": "CMC가족오락TV", "KTCh": 126, "LG Name": "", "LGCh": null, "SK Name": "CMC 가족오락TV", "SKCh": 93, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/fNuqGzR.png", "Source": "EVERYON", "ServiceId": "1"},
{ "Id": 43, "Name": "CMC가족오락TV", "KT Name": "CMC가족오락TV", "KTCh": 126, "LG Name": "", "LGCh": null, "SK Name": "CMC 가족오락TV", "SKCh": 93, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/fNuqGzR.png", "Source": "NAVER", "ServiceId": "814797" },
{ "Id": 44, "Name": "CMTV", "KT Name": "CMTV", "KTCh": 262, "LG Name": "", "LGCh": null, "SK Name": "", "SKCh": null, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/ITweLdv.png", "Source": "KT", "ServiceId": "44" },
{ "Id": 45, "Name": "CNBC", "KT Name": "CNBC", "KTCh": 197, "LG Name": "CNBC", "LGCh": 118, "SK Name": "", "SKCh": null, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/Mx8ZXqk.png", "Source": "NAVER", "ServiceId": "815128" },
{ "Id": 46, "Name": "CNN International", "KT Name": "CNN International", "KTCh": 191, "LG Name": "CNN International", "LGCh": 117, "SK Name": "CNN International", "SKCh": 158, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/RxsYny9.png", "Source": "EPG", "ServiceId": "117" },
@ -57,7 +57,7 @@
{ "Id": 70, "Name": "Extreme Fun", "KT Name": "Extreme Fun", "KTCh": 173, "LG Name": "", "LGCh": null, "SK Name": "", "SKCh": null, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/yDg1RC6.png", "Source": "KT", "ServiceId": "173" },
{ "Id": 71, "Name": "Fashion N", "KT Name": "", "KTCh": null, "LG Name": "", "LGCh": null, "SK Name": "Fashion N", "SKCh": 211, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/qPBnZpV.png", "Source": "SKB", "ServiceId": "274" },
{ "Id": 72, "Name": "FISHING TV", "KT Name": "FISHING TV", "KTCh": 119, "LG Name": "피싱TV", "LGCh": 65, "SK Name": "FISHING TV", "SKCh": 244, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/Go4FdK1.png", "Source": "SK", "ServiceId": "273" },
{ "Id": 73, "Name": "푸드TV", "KT Name": "푸드TV", "KTCh": 78, "LG Name": "푸드TV", "LGCh": 83, "SK Name": "Food TV", "SKCh": 213, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/F9Rb9SA.png", "Source": "HCN", "ServiceId": "753"},
{ "Id": 73, "Name": "푸드TV", "KT Name": "", "KTCh": null, "LG Name": "푸드TV", "LGCh": 83, "SK Name": "Food TV", "SKCh": 213, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/F9Rb9SA.png", "Source": "HCN", "ServiceId": "753" },
{ "Id": 74, "Name": "FOX", "KT Name": "FOX", "KTCh": 107, "LG Name": "FOX채널", "LGCh": 44, "SK Name": "FOX", "SKCh": 101, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/8usDWOC.png", "Source": "LG", "ServiceId": "654" },
{ "Id": 75, "Name": "Fox life", "KT Name": "", "KTCh": null, "LG Name": "", "LGCh": null, "SK Name": "Fox life", "SKCh": 216, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/CqVujLk.png", "Source": "SKB", "ServiceId": "280" },
{ "Id": 76, "Name": "Fox News", "KT Name": "Fox News", "KTCh": 195, "LG Name": "", "LGCh": null, "SK Name": "", "SKCh": null, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/9rGThzD.png", "Source": "NAVER", "ServiceId": "815413" },
@ -71,7 +71,7 @@
{ "Id": 86, "Name": "GTV", "KT Name": "GTV", "KTCh": 73, "LG Name": "GTV", "LGCh": 136, "SK Name": "Gtv", "SKCh": 217, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/1qXSXRa.png", "Source": "HCN", "ServiceId": "35" },
{ "Id": 87, "Name": "히어로액션", "KT Name": "히어로액션", "KTCh": 112, "LG Name": "히어로액션", "LGCh": 110, "SK Name": "히어로액션", "SKCh": 107, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/yBChQVh.png", "Source": "NAVER", "ServiceId": "814760" },
{ "Id": 89, "Name": "하이라이트TV", "KT Name": "하이라이트TV", "KTCh": 74, "LG Name": "하이라이트TV", "LGCh": 91, "SK Name": "Highlight TV", "SKCh": 42, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/V9CQ4A6.png", "Source": "LG", "ServiceId": "701" },
{ "Id": 90, "Name": "History HD", "KT Name": "History HD", "KTCh": 169, "LG Name": "히스토리 HD", "LGCh": 132, "SK Name": "History HD", "SKCh": 264, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/SSkop4X.png", "Source": "NAVER", "ServiceId": "815148"},
{ "Id": 90, "Name": "History HD", "KT Name": "History", "KTCh": 169, "LG Name": "히스토리 HD", "LGCh": 132, "SK Name": "History", "SKCh": 264, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/SSkop4X.png", "Source": "NAVER", "ServiceId": "815148" },
{ "Id": 91, "Name": "HQ+", "KT Name": "HQ+", "KTCh": 253, "LG Name": "", "LGCh": null, "SK Name": "HQ+", "SKCh": 47, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/GTANuZS.png", "Source": "NAVER", "ServiceId": "3566359" },
{ "Id": 92, "Name": "아이넷TV", "KT Name": "아이넷TV", "KTCh": 92, "LG Name": "아이넷TV", "LGCh": 106, "SK Name": "아이넷 TV", "SKCh": 233, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/JYQpemw.png", "Source": "SKB", "ServiceId": "261" },
{ "Id": 93, "Name": "IB SPORTS", "KT Name": "IB SPORTS", "KTCh": 53, "LG Name": "IB스포츠", "LGCh": 62, "SK Name": "IB Sports", "SKCh": 129, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/wOOQEC1.png", "Source": "SKY", "ServiceId": "515" },
@ -99,12 +99,12 @@
{ "Id": 119, "Name": "K쇼핑", "KT Name": "K쇼핑", "KTCh": 20, "LG Name": "", "LGCh": null, "SK Name": "K쇼핑", "SKCh": 25, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/6ORm0Rz.png", "Source": "SK", "ServiceId": "333" },
{ "Id": 121, "Name": "Mnet", "KT Name": "Mnet", "KTCh": 27, "LG Name": "엠넷", "LGCh": 22, "SK Name": "M.net", "SKCh": 27, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/putHm2b.png", "Source": "SKY", "ServiceId": "273" },
{ "Id": 122, "Name": "MBC", "KT Name": "MBC", "KTCh": 11, "LG Name": "MBC", "LGCh": 11, "SK Name": "MBC", "SKCh": 11, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/duig32i.png", "Source": "SKY", "ServiceId": "797" },
{ "Id": 123, "Name": "MBC Every1", "KT Name": "MBC Every1", "KTCh": 3, "LG Name": "MBC에브리원", "LGCh": 29, "SK Name": "MBC Every1", "SKCh": 28, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/oOnpFes.png", "Source": "POOQ", "ServiceId": "M03"},
{ "Id": 123, "Name": "MBC Every1", "KT Name": "MBC Every1", "KTCh": 1, "LG Name": "MBC에브리원", "LGCh": 29, "SK Name": "MBC Every1", "SKCh": 28, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/oOnpFes.png", "Source": "POOQ", "ServiceId": "M03" },
{ "Id": 124, "Name": "MBC MUSIC", "KT Name": "MBC MUSIC", "KTCh": 97, "LG Name": "MBC뮤직", "LGCh": 99, "SK Name": "MBC Music", "SKCh": 231, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/6g56RDx.png", "Source": "POOQ", "ServiceId": "M06" },
{ "Id": 125, "Name": "MBC NET", "KT Name": "MBC NET", "KTCh": 164, "LG Name": "MBCNET", "LGCh": 140, "SK Name": "MBC NET", "SKCh": 274, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/lxDOgY8.png", "Source": "SKY", "ServiceId": "537" },
{ "Id": 126, "Name": "MBC SPORTS+", "KT Name": "MBC SPORT+", "KTCh": 60, "LG Name": "MBC스포츠+", "LGCh": 60, "SK Name": "MBC Sports+", "SKCh": 123, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/Su21uj3.png", "Source": "SKY", "ServiceId": "911" },
{ "Id": 127, "Name": "MBC SPORTS+2", "KT Name": "MBC SPORTS+2", "KTCh": 61, "LG Name": "MBC스포츠+2", "LGCh": 61, "SK Name": "MBC SPORTS+2", "SKCh": 124, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/frAuUS3.png", "Source": "SKY", "ServiceId": "96" },
{ "Id": 128, "Name": "MBC Dramanet", "KT Name": "MBC Dramanet", "KTCh": 75, "LG Name": "MBC드라마넷", "LGCh": 35, "SK Name": "MBC 드라마", "SKCh": 32, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/VBMFcZ3.png", "Source": "POOQ", "ServiceId": "M02"},
{ "Id": 128, "Name": "MBC Dramanet", "KT Name": "MBC Dramanet", "KTCh": 3, "LG Name": "MBC드라마넷", "LGCh": 35, "SK Name": "MBC 드라마", "SKCh": 32, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/VBMFcZ3.png", "Source": "POOQ", "ServiceId": "M02" },
{ "Id": 129, "Name": "MBN", "KT Name": "MBN", "KTCh": 16, "LG Name": "MBN", "LGCh": 16, "SK Name": "MBN", "SKCh": 16, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/p0mvIJN.png", "Source": "POOQ", "ServiceId": "C2401" },
{ "Id": 130, "Name": "MBN Plus", "KT Name": "MBN Plus", "KTCh": 99, "LG Name": "MBN+", "LGCh": 116, "SK Name": "MBN 플러스", "SKCh": 98, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/yMZiUUp.png", "Source": "NAVER", "ServiceId": "5286722" },
{ "Id": 133, "Name": "마운틴TV", "KT Name": "마운틴TV", "KTCh": 117, "LG Name": "마운틴TV", "LGCh": 69, "SK Name": "Mountain TV", "SKCh": 247, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/4nLYnVC.png", "Source": "ISCS", "ServiceId": "713" },
@ -156,7 +156,6 @@
{ "Id": 193, "Name": "STB상생방송", "KT Name": "STB상생방송", "KTCh": 261, "LG Name": "상생방송", "LGCh": 187, "SK Name": "STB 상생방송", "SKCh": 308, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/Z3Xknso.png", "Source": "HCN", "ServiceId": "779" },
{ "Id": 194, "Name": "STN", "KT Name": "STN", "KTCh": 267, "LG Name": "", "LGCh": null, "SK Name": "", "SKCh": null, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/ZJi3NQy.png", "Source": "KT", "ServiceId": "267" },
{ "Id": 196, "Name": "슈퍼액션", "KT Name": "슈퍼액션", "KTCh": 32, "LG Name": "수퍼액션", "LGCh": 40, "SK Name": "SUPER ACTION", "SKCh": 55, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/D9PzDBr.png", "Source": "SKY", "ServiceId": "129" },
{ "Id": 197, "Name": "tag TV", "KT Name": "tag TV", "KTCh": 94, "LG Name": "", "LGCh": null, "SK Name": "", "SKCh": null, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/Mmc89FS.png", "Source": "KT", "ServiceId": "94"},
{ "Id": 198, "Name": "tbsTV", "KT Name": "tbsTV", "KTCh": 214, "LG Name": "tbsTV", "LGCh": 176, "SK Name": "tbsTV", "SKCh": 272, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/o3MWHfb.png", "Source": "SK", "ServiceId": "420" },
{ "Id": 199, "Name": "텔레노벨라", "KT Name": "텔레노벨라", "KTCh": 114, "LG Name": "텔레노벨라", "LGCh": 81, "SK Name": "텔레노벨라", "SKCh": 109, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/Ea3Vu8Z.png", "Source": "LG", "ServiceId": "700" },
{ "Id": 200, "Name": "The Golf Channel", "KT Name": "The Golf Channel", "KTCh": 55, "LG Name": "더 골프채널 코리아", "LGCh": 55, "SK Name": "Golf Channel Korea", "SKCh": 133, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/3VlCrJ7.png", "Source": "SK", "ServiceId": "135" },
@ -215,7 +214,6 @@
{ "Id": 272, "Name": "이데일리TV", "KT Name": "이데일리TV", "KTCh": 183, "LG Name": "이데일리TV", "LGCh": 123, "SK Name": "이데일리TV", "SKCh": 155, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/W90Hw2p.png", "Source": "LG", "ServiceId": "631" },
{ "Id": 273, "Name": "이벤트TV", "KT Name": "이벤트TV", "KTCh": 263, "LG Name": "이벤트TV", "LGCh": 103, "SK Name": "이벤트TV", "SKCh": 238, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/1Eeyijd.png", "Source": "SKB", "ServiceId": "262" },
{ "Id": 275, "Name": "인디필름", "KT Name": "인디필름", "KTCh": 277, "LG Name": "", "LGCh": null, "SK Name": "인디필름", "SKCh": 61, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/iA5UIJ9.png", "Source": "SKB", "ServiceId": "441" },
{ "Id": 277, "Name": "정철영어 TV", "KT Name": "정철영어 TV", "KTCh": 155, "LG Name": "정철영어TV", "LGCh": 161, "SK Name": "정철영어TV", "SKCh": 201, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/lumUZz3.png", "Source": "LG", "ServiceId": "772"},
{ "Id": 278, "Name": "중화TV", "KT Name": "중화TV", "KTCh": 110, "LG Name": "중화TV", "LGCh": 87, "SK Name": "중화TV", "SKCh": 104, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/Nal18s5.png", "Source": "SKB", "ServiceId": "186" },
{ "Id": 279, "Name": "JJC지방자치TV", "KT Name": "JJC지방자치TV", "KTCh": 279, "LG Name": "", "LGCh": null, "SK Name": "", "SKCh": null, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/AuXr9jA.png", "Source": "NAVER", "ServiceId": "3244879" },
{ "Id": 280, "Name": "채널 Ching", "KT Name": "", "KTCh": null, "LG Name": "", "LGCh": null, "SK Name": "채널 Ching", "SKCh": 105, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/tRqGKcS.png", "Source": "HCN", "ServiceId": "780" },
@ -342,5 +340,8 @@
{ "Id": 451, "Name": "다빈치러닝", "KT Name": "다빈치러닝", "KTCh": 224, "LG Name": "", "LGCh": null, "SK Name": "", "SKCh": null, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/mB9BL31.png", "Source": "KT", "ServiceId": "224" },
{ "Id": 452, "Name": "E! Entertainment", "KT Name": "E! 엔터", "KTCh": 225, "LG Name": "", "LGCh": null, "SK Name": "", "SKCh": null, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/VqIgfE9.png", "Source": "KT", "ServiceId": "225" },
{ "Id": 453, "Name": "다큐원", "KT Name": "다큐원", "KTCh": 269, "LG Name": "", "LGCh": null, "SK Name": "다큐원", "SKCh": 283, "Radio Name": "아리랑 라디오", "RadioCh": 926, "Icon_url": "http://i.imgur.com/1EZs0Tn.png", "Source": "SK", "ServiceId": "257" },
{ "Id": 454, "Name": "Discovery Science", "KT Name": "DSC Science", "KTCh": 222, "LG Name": "", "LGCh": null, "SK Name": "", "SKCh": null, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/3UfATJL.png", "Source": "KT", "ServiceId": "222"}
{ "Id": 454, "Name": "Discovery Science", "KT Name": "DSC Science", "KTCh": 222, "LG Name": "", "LGCh": null, "SK Name": "", "SKCh": null, "Radio Name": "", "RadioCh": null, "Icon_url": "http://i.imgur.com/3UfATJL.png", "Source": "KT", "ServiceId": "222" },
{ "Id": 455, "Name": "Now제주TV", "KT Name": "Now제주TV", "KTCh": 94, "LG Name": "", "LGCh": null, "SK Name": "", "SKCh": null, "Radio Name": "", "RadioCh": null, "Icon_url": "https://i.imgur.com/aIvnsge.png", "Source": "KT", "ServiceId": "94" },
{ "Id": 456, "Name": "Lifetime", "KT Name": "Lifetime", "KTCh": 78, "LG Name": "", "LGCh": null, "SK Name": "", "SKCh": null, "Radio Name": "", "RadioCh": null, "Icon_url": "https://i.imgur.com/vh1U91w.png", "Source": "KT", "ServiceId": "78" },
{ "Id": 457, "Name": "플레이런TV", "KT Name": "플레이런TV", "KTCh": 155, "LG Name": "플레이런TV", "LGCh": 161, "SK Name": "플레이런TV", "SKCh": 201, "Radio Name": "", "RadioCh": null, "Icon_url": "https://i.imgur.com/nrtT3Wm.png", "Source": "LG", "ServiceId": "772" }
]

View File

@ -34,6 +34,7 @@ default_icon_url : 채널별 아이콘이 있는 url을 설정할 수 있다.
default_rebroadcast : 제목에 재방송 정보 출력
default_episode : 제목에 회차정보 출력
default_verbose : EPG 정보 상세 출력
default_xmltvns : 에피소드 정보 표시 방법
default_fetch_limit : EPG 데이터 가져오는 기간.
default_xml_filename : EPG 저장시 기본 저장 이름으로 tvheadend 서버가 쓰기가 가능한 경로로 설정해야 한다.
default_xml_socket : External XMLTV 사용시 xmltv.sock가 있는 경로로 설정해준다.
@ -86,8 +87,8 @@ python 경로와 php의 경로는 /usr/bin에 있고, epg2xml 파일은 /home/ht
#### PHP WEB의 경우
<pre>
wget -O - http://domain/epg2xml-web.php 또는
wget -O - http://domain/epg2xml-web.php?i=ALL&l=2
wget -O - http://www.examle.com/epg2xml-web.php 또는
wget -O - http://www.example.com/epg2xml-web.php?i=ALL&l=2
</pre>
### XMLTV SOCKET 사용시
@ -125,6 +126,7 @@ https://github.com/wonipapa/epg2xml/wiki/FAQ
- Channel.json Enabled 항목 제거
- 에피소드 넘버 xmltv_ns 옵션 항목 추가
- 가져오는 날짜 최대 7일로 변경
- KT 함수 수정
### Version 1.2.2
- My Channel 추가
- 소스 추가

View File

@ -86,7 +86,6 @@ try {
$default_episode = $Settings['default_episode'] ?: "y";
$default_verbose = $Settings['default_verbose'] ?: "n";
$default_xmltvns = $Settings['default_xmltvns'] ?: "n";
$userISP = !empty($_GET['i']) ? $_GET['i'] : (!empty($args['i']) ? $args['i'] : "");
$user_output = "";
$user_xml_file = "";
@ -534,50 +533,53 @@ function GetEPGFromKT($ChannelInfo) {
$ServiceId = $ChannelInfo[3];
$epginfo = array();
foreach(range(1, $GLOBALS['period']) as $k) :
$url = "http://tv.olleh.com/renewal_sub/liveTv/pop_schedule_week.asp";
$url = "http://tv.kt.com/tv/channel/pSchedule.asp";
$day = date("Ymd", strtotime("+".($k - 1)." days"));
$params = array(
'ch_name' => '',
'ch_no' => $ServiceId,
'nowdate'=> $day,
'seldatie' => $day,
'tab_no' => '1'
'ch_type' => '1',
'view_type' => '1',
'service_ch_no' => $ServiceId,
'seldate' => $day
);
$params = http_build_query($params);
$method = "GET";
$method = "POST";
try {
$response = getWeb($url, $params, $method);
if ($response === False && $GLOBALS['debug']) :
printError($ChannelName.HTTP_ERROR);
else :
$response = str_replace("charset=euc-kr", "charset=utf-8", $response);
$response = mb_convert_encoding($response, "UTF-8", "EUC-KR");
$response = mb_convert_encoding($response, "HTML-ENTITIES", "EUC-KR");
$dom = new DomDocument;
libxml_use_internal_errors(True);
if($dom->loadHTML($response)):
$xpath = new DomXPath($dom);
$query = "//table[@id='pop_day']/tbody/tr";
$query = "//tbody/tr";
$rows = $xpath->query($query);
foreach($rows as $row) :
$startTime = $endTime = $programName = $subprogramName = $desc = $actors = $producers = $category = $episode = "";
$rebroadcast = False;
$rating = 0;
$cells = $row->getElementsByTagName('td');
//programName, startTime, rating, category
$startTime = date("YmdHis", strtotime($day." ".trim($cells->item(0)->nodeValue)));
$pattern = '/^(.*?)( <(.*)>)?$/';
$programName = trim($cells->item(1)->nodeValue);
preg_match($pattern, $programName, $matches);
if ($matches != NULL) :
if(isset($matches[1])) $programName = $matches[1] ?: "";
if(isset($matches[3])) $subprogramName = $matches[3] ?: "";
$programs = array_map(null, iterator_to_array($xpath->query('p', $cells->item(1))), iterator_to_array($xpath->query('p', $cells->item(2))), iterator_to_array($xpath->query('p', $cells->item(3))));
foreach($programs as $program):
$hour = trim($cells->item(0)->nodeValue);
$minute = trim($program[0]->nodeValue);
$startTime = date("YmdHis", strtotime($day.$hour.$minute."00"));
$programName = trim($program[1]->nodeValue);
$images = $program[1]->getElementsByTagName('img')->item(0);
preg_match('/([\d,]+)/', $images->getAttribute('alt'), $grade);
if($grade != NULL):
$rating = $grade[1];
else:
$rating = 0;
endif;
$category = trim($cells->item(4)->nodeValue);
$rating = str_replace("all", 0, str_replace("세 이상", "", trim($cells->item(2)->nodeValue)));
$programName = str_replace("방송중 ", "", $programName);
$category = trim($program[2]->nodeValue);
//ChannelId, startTime, programName, subprogramName, desc, actors, producers, category, episode, rebroadcast, rating
$epginfo[] = array($ChannelId, $startTime, $programName, $subprogramName, $desc, $actors, $producers, $category, $episode, $rebroadcast, $rating);
usleep(1000);
endforeach;
endforeach;
else :
if($GLOBALS['debug']) printError($ChannelName.CONTENT_ERROR);
endif;

View File

@ -4,8 +4,8 @@
"###_COMMENT_###" : "사용하는 ISP 선택 (ALL, KT, LG, SK)",
"MyISP": "ALL",
"###_COMMENT_###" : "### # My Channel EPG 정보 가져오는 채널 ID ###",
"###_COMMENT_###" : "### 채널 ID를 , 로 구분. , 상의 간격 유무 관계없음 ###",
"MyChannels" : "",
"###_COMMENT_###" : "### 채널 ID를 , 로 구분하여 입력 ###",
"MyChannels" : "60, 110, 111, 122, 164",
"###_COMMENT_###" : "output 셋팅은 (d, o, s) 셋중에 하나로 선택한다",
"###_COMMENT_###" : " d - EPG 정보 화면 출력",
"###_COMMENT_###" : " o - EPG 정보 파일로 저장",

View File

@ -236,17 +236,17 @@ def GetEPGFromKT(ChannelInfo):
for cell in [row.find_all('td')]:
startTime = endTime = programName = subprogramName = desc = actors = producers = category = episode = ''
rebroadcast = False
rating = 0
for minute, program, cateogry in zip(cell[1].find_all('p'), cell[2].find_all('p'), cell[3].find_all('p')):
for minute, program, category in zip(cell[1].find_all('p'), cell[2].find_all('p'), cell[3].find_all('p')):
startTime = str(day) + ' ' + cell[0].text.strip() + ':' + minute.text.strip()
startTime = datetime.datetime.strptime(startTime, '%Y-%m-%d %H:%M')
startTime = startTime.strftime('%Y%m%d%H%M%S')
programName = program.text.strip()
cateogry = cateogry.text.strip()
programName = program.text.replace('방송중 ', '').strip()
category = category.text.strip()
for image in [program.find_all('img', alt=True)]:
rating = 0
grade = re.match('([\d,]+)',image[0]['alt'])
if not (grade is None): rating = int(grade.group(1))
else: rating = 0
#ChannelId, startTime, programName, subprogramName, desc, actors, producers, category, episode, rebroadcast, rating
epginfo.append([ChannelId, startTime, programName, subprogramName, desc, actors, producers, category, episode, rebroadcast, rating])
time.sleep(0.001)
@ -1077,7 +1077,6 @@ try:
Settings = json.load(f)
MyISP = Settings['MyISP'] if 'MyISP' in Settings else 'ALL'
MyChannels = Settings['MyChannels'] if 'MyChannels' in Settings else ''
MergeChannels = Settings['MergeChannels'] if 'MergeChannels' in Settings else ''
default_output = Settings['output'] if 'output' in Settings else 'd'
default_xml_file = Settings['default_xml_file'] if 'default_xml_file' in Settings else 'xmltv.xml'
default_xml_socket = Settings['default_xml_socket'] if 'default_xml_socket' in Settings else 'xmltv.sock'