Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About hosting it somewhere for kodi addon #3

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion addon.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<import addon="script.module.codequick" version="1.0.2"/>
<import addon="script.module.inputstreamhelper" version="0.5.10"/>
<import addon="inputstream.adaptive" minversion="2.6.6"/>
<import addon="script.module.m3u8" version="0.5.4"/>
<import addon="repository.botallen" version="2.0.0"/>
</requires>
<extension point="xbmc.python.pluginsource" library="addon.py">
Expand All @@ -20,7 +21,7 @@
<forum>https://botallen.com/discord</forum>
<website>https://botallen.com</website>
<email>[email protected]</email>
<source>https://github.com/botallen/plugin.video.jiotv</source>
<source>https://github.com/Geletinousamigo/plugin.video.jiotv</source>
<news>
[- 2.3.0 -]
[added] more extra channels
Expand Down
2 changes: 1 addition & 1 deletion resources/lib/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
EXTRA_CHANNELS = os.path.join(translatePath(
ADDON.getAddonInfo("path")), "resources", "extra", "channels.json")
CHANNELS_SRC = "http://jiotv.data.cdn.jio.com/apis/v1.3/getMobileChannelList/get/?os=android&devicetype=phone&version=6.0.9"
GET_CHANNEL_URL = "https://tv.media.jio.com/apis/v1.4/getchannelurl/getchannelurl?langId=6&userLanguages=All"
GET_CHANNEL_URL = "https://tv.media.jio.com/apis/v1.5/getchannelurl/getchannelurl?langId=6&userLanguages=All"
CATCHUP_SRC = "http://jiotv.data.cdn.jio.com/apis/v1.3/getepg/get?offset={0}&channel_id={1}&langId=6"
M3U_SRC = os.path.join(translatePath(
ADDON.getAddonInfo("profile")), "playlist.m3u")
Expand Down
10 changes: 9 additions & 1 deletion resources/lib/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from urllib.parse import urlencode
import inputstreamhelper
import json
import m3u8
from time import time, sleep
from datetime import datetime, timedelta, date

Expand Down Expand Up @@ -290,10 +291,17 @@ def play(plugin, channel_id, showtime=None, srno=None):
art["thumb"] = art["icon"] = IMG_CATCHUP + \
resp.get("result", "").split("/")[-1].replace(".m3u8", ".png")
params = getTokenParams()
uriToUse = resp.get("result","") + "?" + urlencode(params)
variant_m3u8 = m3u8.load(resp.get("result","") + "?" + urlencode(params), headers=getHeaders())
if variant_m3u8.is_variant:
quality = len(variant_m3u8.playlists) - 1
uriToUse = uriToUse.replace(resp.get("result", "").split("/")[-1], variant_m3u8.playlists[quality].uri)

return Listitem().from_dict(**{
"label": plugin._title,
"art": art,
"callback": resp.get("result", "") + "?" + urlencode(params),
# "callback": resp.get("result", "") + "?" + urlencode(params),
"callback": uriToUse,
"properties": {
"IsPlayable": True,
"inputstream": "inputstream.adaptive",
Expand Down