Skip to content

Commit fb26909

Browse files
Fixed Key error 19, and CatchUP
1 parent ac896c8 commit fb26909

File tree

3 files changed

+37
-16
lines changed

3 files changed

+37
-16
lines changed

resources/lib/constants.py

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,14 +154,30 @@
154154
"tvImg": IMG_PUBLIC + "logos/langGen/Malayalam_1579245819981.jpg",
155155
"promoImg": IMG_PUBLIC+"67/0/Malayalam_1580459753008_promo.jpg",
156156
},
157+
# {
158+
# "name": "Odia",
159+
# "tvImg": IMG_PUBLIC + "logos/langGen/Odia_1579245819981.jpg",
160+
# "promoImg": IMG_PUBLIC+"67/0/Odia_1580459753008_promo.jpg",
161+
# }
157162
{
158163
"name": "Odia",
159-
"tvImg": IMG_PUBLIC + "logos/langGen/Odia_1579245819981.jpg",
160-
"promoImg": IMG_PUBLIC+"67/0/Odia_1580459753008_promo.jpg",
164+
"tvImg": IMG_PUBLIC + "logos/langGen/Malayalam_1579245819981.jpg",
165+
"promoImg": IMG_PUBLIC+"67/0/Malayalam_1580459753008_promo.jpg",
166+
},
167+
{
168+
"name": "Manipuri",
169+
"tvImg": IMG_PUBLIC + "logos/langGen/Malayalam_1579245819981.jpg",
170+
"promoImg": IMG_PUBLIC+"67/0/Malayalam_1580459753008_promo.jpg",
171+
},
172+
{
173+
"name": "Koshali",
174+
"tvImg": IMG_PUBLIC + "logos/langGen/Malayalam_1579245819981.jpg",
175+
"promoImg": IMG_PUBLIC+"67/0/Malayalam_1580459753008_promo.jpg",
161176
}
162177
]
163178
LANG_MAP = {6: "English", 1: "Hindi", 2: "Marathi", 3: "Punjabi", 4: "Urdu", 5: "Bengali", 7: "Malayalam", 8: "Tamil",
164-
9: "Gujarati", 10: "Odia", 11: "Telugu", 12: "Bhojpuri", 13: "Kannada", 14: "Assamese", 15: "Nepali", 16: "French", 18: "Manipuri"}
179+
9: "Gujarati", 10: "Odia", 11: "Telugu", 12: "Bhojpuri", 13: "Kannada", 14: "Assamese", 15: "Nepali", 16: "French",
180+
18: "Manipuri", 19: "Koshali"}
165181
GENRE_MAP = {8: "Sports", 5: "Entertainment", 6: "Movies", 12: "News", 13: "Music", 7: "Kids", 9: "Lifestyle",
166182
10: "Infotainment", 15: "Devotional", 16: "Business", 17: "Educational", 18: "TestChannels", 19: "JioDarshan"}
167183
CONFIG = {"Genres": GENRE_CONFIG, "Languages": LANGUAGE_CONFIG}

resources/lib/main.py

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,13 @@ def show_featured(plugin, id=None):
111111
"showtime": child.get("showtime", "").replace(":", ""),
112112
"srno": datetime.fromtimestamp(int(child.get("startEpoch", 0)*.001)).strftime('%Y%m%d'),
113113
"programId": child.get("srno", ""),
114-
"begin": datetime.utcfromtimestamp(int(child.get("startEpoch", 0)*.001)).strftime('%Y%m%dT%H%M%S'),
115-
"end": datetime.utcfromtimestamp(int(child.get("endEpoch", 0)*.001)).strftime('%Y%m%dT%H%M%S')
114+
"begin": datetime.fromtimestamp(int(child.get("startEpoch", 0)*.001)).strftime('%Y%m%dT%H%M%S'),
115+
"end": datetime.fromtimestamp(int(child.get("endEpoch", 0)*.001)).strftime('%Y%m%dT%H%M%S'),
116116
}
117117
yield Listitem.from_dict(**info_dict)
118118
else:
119119
yield Listitem.from_dict(**{
120-
"label": each.get("name"),
120+
"label": each.get("showname"),
121121
"art": {
122122
"thumb": IMG_CATCHUP_SHOWS + each.get("data", [{}])[0].get("episodePoster"),
123123
"icon": IMG_CATCHUP_SHOWS + each.get("data", [{}])[0].get("episodePoster"),
@@ -156,7 +156,9 @@ def fltr(x):
156156
else:
157157
return LANG_MAP[x.get("channelLanguageId")] == category_id
158158

159-
for each in filter(fltr, resp):
159+
for each in filter(fltr, resp):
160+
if each.get("channelIdForRedirect") and not Settings.get_boolean("extra"):
161+
continue
160162
litm = Listitem.from_dict(**{
161163
"label": each.get("channel_name"),
162164
"art": {
@@ -204,8 +206,8 @@ def show_epg(plugin, day, channel_id):
204206
'originaltitle': each['showname'],
205207
"tvshowtitle": each['showname'],
206208
'genre': each['showGenre'],
207-
'plot': each['description'],
208-
"episodeguide": each.get("episode_desc"),
209+
"plot": each.get("episode_desc"),
210+
"episodeguide": each.get("description"),
209211
'episode': 0 if each['episode_num'] == -1 else each['episode_num'],
210212
'cast': each['starCast'].split(', '),
211213
'director': each['director'],
@@ -218,8 +220,8 @@ def show_epg(plugin, day, channel_id):
218220
"showtime": None if islive else each.get("showtime", "").replace(":", ""),
219221
"srno": None if islive else datetime.fromtimestamp(int(each.get("startEpoch", 0)*.001)).strftime('%Y%m%d'),
220222
"programId": None if islive else each.get("srno", ""),
221-
"begin": None if islive else datetime.utcfromtimestamp(int(each.get("startEpoch", 0)*.001)).strftime('%Y%m%dT%H%M%S'),
222-
"end": None if islive else datetime.utcfromtimestamp(int(each.get("endEpoch", 0)*.001)).strftime('%Y%m%dT%H%M%S')
223+
"begin": None if islive else datetime.fromtimestamp(int(each.get("startEpoch", 0)*.001)).strftime('%Y%m%dT%H%M%S'),
224+
"end": None if islive else datetime.fromtimestamp(int(each.get("endEpoch", 0)*.001)).strftime('%Y%m%dT%H%M%S'),
223225
}
224226
})
225227
if int(day) == 0:
@@ -263,7 +265,9 @@ def play(plugin, channel_id, showtime=None, srno=None , programId=None, begin=No
263265
"host":"tv.media.jio.com",
264266
"os":"android",
265267
"versioncode":"290",
266-
"Content-Type":"application/json"
268+
"Content-Type":"application/json",
269+
"channel_id":str(channel_id),
270+
"srno":rjson["srno"] if "srno" in rjson else str(None)
267271
}
268272

269273
headers = getHeaders()
@@ -274,11 +278,11 @@ def play(plugin, channel_id, showtime=None, srno=None , programId=None, begin=No
274278
channelName_m3u8 = resp.get("result", "").split("?")[0].split('/')[-1]
275279
channelName = channelName_m3u8[:-5].replace("_"," ")
276280
art["thumb"] = art["icon"] = IMG_CATCHUP + \
277-
resp.get("result", "").split("/")[-1].replace(".m3u8", ".png")
281+
channelName_m3u8.replace(".m3u8", ".png")
278282
cookie = resp.get("result", "").split("?")[1]
279283
headers['cookie'] = cookie
280284
uriToUse = resp.get("result","")
281-
285+
282286
return Listitem().from_dict(**{
283287
"label": channelName,
284288
"art": art,
@@ -350,7 +354,7 @@ def m3ugen(plugin, notify="yes"):
350354
"channel_id={0}".format(channel.get("channel_id"))
351355
catchup = ""
352356
if channel.get("isCatchupAvailable"):
353-
catchup = ' catchup="vod" catchup-source="{0}channel_id={1}&showtime={{H}}{{M}}{{S}}&srno={{Y}}{{m}}{{d}}" catchup-days="7"'.format(
357+
catchup = ' catchup="vod" catchup-source="{0}channel_id={1}&showtime={{H}}{{M}}{{S}}&srno={{Y}}{{m}}{{d}}&programId={{catchup-id}}" catchup-days="7"'.format(
354358
PLAY_URL, channel.get("channel_id"))
355359
m3ustr += M3U_CHANNEL.format(
356360
tvg_id=channel.get("channel_id"),
@@ -392,4 +396,4 @@ def set_setting(id, value):
392396
@Script.register
393397
def cleanup(plugin):
394398
urlquick.cache_cleanup(-1)
395-
Script.notify("Cache Cleaned", "")
399+
Script.notify("Cache Cleaned", "")

resources/settings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
<setting id="Urdu" type="bool" label="Urdu" default="true"/>
2626
<setting id="Nepali" type="bool" label="Nepali" default="true"/>
2727
<setting id="Manipuri" type="bool" label="Manipuri" default="true"/>
28+
<setting id="Koshali" type="bool" label="Koshali" default="true"/>
2829
</category>
2930
<category label="More">
3031
<setting id="cleanup" type="action" label="Clear Cache" action="RunPlugin(plugin://plugin.video.jiotv/resources/lib/main/cleanup/)" option="close"/>

0 commit comments

Comments
 (0)