Compare commits
No commits in common. "8b29e68200478cfa702a53cad257a50fec5b82d0" and "eeeb2d7abacc55ce2033e84fa3a103758bab5c09" have entirely different histories.
8b29e68200
...
eeeb2d7aba
2 changed files with 17 additions and 28 deletions
35
constants.py
35
constants.py
|
@ -1,32 +1,17 @@
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
|
|
||||||
class CITY(Enum):
|
class CITY(Enum):
|
||||||
TOKYO1 = 12
|
# TODO: Add all these cities: https://c.myjcom.jp/shared/common/js/region/data/cityMaster.js?_=1735632747105
|
||||||
TOKYO2 = 221
|
# TODO: Change these to cities' names
|
||||||
|
KYUSHU1 = 35
|
||||||
|
KYUSHU2 = 36
|
||||||
|
KYUSHU3 = 54
|
||||||
|
MIYAGI1 = 52
|
||||||
|
OSAKA1 = 40
|
||||||
|
OSAKA2 = 46
|
||||||
|
TOKYO1 = 19
|
||||||
|
TOKYO2 = 100
|
||||||
TOKYO3 = 222
|
TOKYO3 = 222
|
||||||
OSAKA1 = 28
|
|
||||||
OSAKA2 = 40
|
|
||||||
OSAKA3 = 42
|
|
||||||
OSAKA4 = 44
|
|
||||||
OSAKA5 = 30
|
|
||||||
KYOTO = 46
|
|
||||||
HYOGO = 106
|
|
||||||
WAKAYAMA = 25
|
|
||||||
YAMAGUCHI = 39
|
|
||||||
FUKUOKA = 37
|
|
||||||
KUMAMOTO = 227
|
|
||||||
HOKKAIDO = 1
|
|
||||||
MIYAGI = 52
|
|
||||||
GUNMA = 13
|
|
||||||
IBARAKI = 2
|
|
||||||
CHIBA1 = 3
|
|
||||||
CHIBA2 = 217
|
|
||||||
CHIBA3 = 219
|
|
||||||
CHIBA4 = 300
|
|
||||||
KANAGAWA1 = 101
|
|
||||||
KANAGAWA2 = 201
|
|
||||||
SAITAMA1 = 3
|
|
||||||
SAITAMA2 = 214
|
|
||||||
|
|
||||||
|
|
||||||
class XMLTV:
|
class XMLTV:
|
||||||
|
|
10
run.py
10
run.py
|
@ -43,7 +43,7 @@ def request_url() -> str:
|
||||||
|
|
||||||
|
|
||||||
if not file_exists('data/channels.xml'):
|
if not file_exists('data/channels.xml'):
|
||||||
c_area = CITY.OSAKA2.value
|
c_area = CITY.OSAKA1.value
|
||||||
c_adult = 'true'
|
c_adult = 'true'
|
||||||
|
|
||||||
for c_type in [2, 3, 5, 120]: # GR / BS / BS4K / CS
|
for c_type in [2, 3, 5, 120]: # GR / BS / BS4K / CS
|
||||||
|
@ -77,8 +77,12 @@ for x in range(0, 7):
|
||||||
channel = chid[0:chid.rfind('_')]
|
channel = chid[0:chid.rfind('_')]
|
||||||
title = fix(epg_data['title'])
|
title = fix(epg_data['title'])
|
||||||
comment = fix(epg_data['commentary'])
|
comment = fix(epg_data['commentary'])
|
||||||
start = datetime.fromtimestamp(datetime.strptime(epg_data['programStart'], '%Y%m%d%H%M%S').timestamp() - 32400).strftime('%Y%m%d%H%M%S')
|
start = str(epg_data['programStart'])
|
||||||
end = datetime.fromtimestamp(datetime.strptime(epg_data['programEnd'], '%Y%m%d%H%M%S').timestamp() - 32400).strftime('%Y%m%d%H%M%S')
|
start = datetime(int(start[0:4]), int(start[4:6]), int(start[6:8]), int(start[8:10]), int(start[10:12]), int(start[12:14])).timestamp() - 32400
|
||||||
|
start = datetime.fromtimestamp(start).strftime('%Y%m%d%H%M%S')
|
||||||
|
end = str(epg_data['programEnd'])
|
||||||
|
end = datetime(int(end[0:4]), int(end[4:6]), int(end[6:8]), int(end[8:10]), int(end[10:12]), int(end[12:14])).timestamp() - 32400
|
||||||
|
end = datetime.fromtimestamp(end).strftime('%Y%m%d%H%M%S')
|
||||||
gen = genre(epg_data['sortGenre'])
|
gen = genre(epg_data['sortGenre'])
|
||||||
attr = epg_data['attr']
|
attr = epg_data['attr']
|
||||||
icon = 'https://tvguide.myjcom.jp{}'.format(epg_data['imgPath']) if int(epg_data['hasImage']) == 1 and epg_data['imgPath'] else None
|
icon = 'https://tvguide.myjcom.jp{}'.format(epg_data['imgPath']) if int(epg_data['hasImage']) == 1 and epg_data['imgPath'] else None
|
||||||
|
|
Loading…
Add table
Reference in a new issue