Skip to content

Commit

Permalink
Merge pull request #46 from krreet/feature/support-for-catchup
Browse files Browse the repository at this point in the history
OS-002 updated to v3.0 to get channel list
  • Loading branch information
krreet committed Mar 5, 2023
2 parents 6a1c5e0 + ed053ea commit 60b6928
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion resources/lib/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
PLAY_URL = "plugin://plugin.video.jiotv/resources/lib/main/play/?"
PLAY_EX_URL = "plugin://plugin.video.jiotv/resources/lib/main/play_ex/?_pickle_="
FEATURED_SRC = "https://tv.media.jio.com/apis/v1.6/getdata/featurednew?start=0&limit=30&langId=6"
CHANNELS_SRC = "https://jiotv.data.cdn.jio.com/apis/v1.3/getMobileChannelList/get/?os=android&devicetype=phone&usertype=JIO&version=290&langId=6"
CHANNELS_SRC = "https://jiotv.data.cdn.jio.com/apis/v3.0/getMobileChannelList/get/?langId=6&os=android&devicetype=phone&usertype=tvYR7NSNn7rymo3F&version=285&langId=6"
GET_CHANNEL_URL = "https://tv.media.jio.com/apis/v2.0/getchannelurl/getchannelurl?langId=6&userLanguages=All"
CATCHUP_SRC = "https://jiotv.data.cdn.jio.com/apis/v1.3/getepg/get?offset={0}&channel_id={1}&langId=6"
M3U_SRC = os.path.join(translatePath(
Expand Down
12 changes: 8 additions & 4 deletions resources/lib/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,9 +506,12 @@ def epg_setup(plugin):
"http": "http://103.216.160.163:80",
"https": "http://104.223.135.178:10000",
}

response = requests.request(
"GET", url, headers=headers, data=payload, proxies=proxies)
if not Settings.get_boolean("useproxy"):
response = requests.request(
"GET", url, headers=headers, data=payload)
else:
response = requests.request(
"GET", url, headers=headers, data=payload, proxies=proxies)
with open(EPG_PATH, 'wb') as f:
f.write(response.content)
# for chunk in response.iter_content(chunk_size=1024):
Expand Down Expand Up @@ -536,7 +539,8 @@ def epg_setup(plugin):

# create the doctype declaration
doctype_declaration = '<!DOCTYPE tv SYSTEM "xmltv.dtd">\n'
new_xml_content = xml_declaration + doctype_declaration + ET.tostring(root, encoding='unicode')
new_xml_content = xml_declaration + doctype_declaration + \
ET.tostring(root, encoding='unicode')
# create the root element and set its attributes
with gzip.open(EPG_PATH, 'wt') as f:
f.write(new_xml_content)
Expand Down
3 changes: 2 additions & 1 deletion resources/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
<setting id="applyAllSettings0" type="action" label="Apply all settings" action="RunPlugin(plugin://plugin.video.jiotv/resources/lib/main/applyall/)" option="close"/>
</category>
<category label="Setup">
<setting label="Setup Simple IPTV PVR" type="action" id="pvrsetup" action="RunPlugin(plugin://plugin.video.jiotv/resources/lib/main/pvrsetup/)" option="close"/>
<setting id="useproxy" type="bool" label="Use proxy for epg" default="true"/>
<setting label="Setup EPG" type="action" id="epgsetup" action="RunPlugin(plugin://plugin.video.jiotv/resources/lib/main/epg_setup/)"/>
<setting label="Setup Simple IPTV PVR" type="action" id="pvrsetup" action="RunPlugin(plugin://plugin.video.jiotv/resources/lib/main/pvrsetup/)" option="close"/>
<setting id="m3ugen" type="bool" label="Generate Playlist On Startup" default="true"/>
<!-- <setting id="extraPl" type="text" label="Extra Playlist"/> -->
<setting id="applyAllSettings1" type="action" label="Apply all settings" action="RunPlugin(plugin://plugin.video.jiotv/resources/lib/main/applyall/)" option="close"/>
Expand Down

0 comments on commit 60b6928

Please sign in to comment.