Skip to content

Commit

Permalink
utils.py: Fix: Category names weren't fully displayed
Browse files Browse the repository at this point in the history
  • Loading branch information
Mannu-1 authored and Shra1V32 committed Jan 19, 2022
1 parent 1132ea6 commit 608acbb
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions code_samples/utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import jwtoken
import jwtoken as jwt
import threading

m3ustr = '#EXTM3U x-tvg-url="http://botallen.live/epg.xml.gz" \n\n'

m3ustr = '#EXTM3U x-tvg-url="http://botallen.live/epg.xml.gz" \n\n'
kodiPropLicenseType = "#KODIPROP:inputstream.adaptive.license_type=com.widevine.alpha"


Expand All @@ -12,22 +13,23 @@ def processTokenChunks(channelList):
print("Channel List is empty ..Exiting")
exit(1)
for channel in channelList:
ls_session_key = jwtoken.generateJWT(channel['channel_id'], iterative=False)
ls_session_key = jwt.generateJWT(channel['channel_id'], iterative=False)
if ls_session_key != "":
licenseUrl = channel['channel_license_url'] + "&ls_session=" + ls_session_key
kodiPropLicenseUrl = "#KODIPROP:inputstream.adaptive.license_key=" + licenseUrl
else:
print("Didn't get license for channel: Id: {0} Name:{1}".format(channel['channel_id'],
channel['channel_name']))
print('Continuing...Please get license manually for channel :', channel['channel_name'])
m3ustr += "#EXTINF:-1 " + "tvg-id=ts" + channel['channel_id'] + " tvg-logo=" + channel['channel_logo'] + " group-title=" + channel['channel_genre'] + ", "
m3ustr += channel['channel_name'] + "\n" + kodiPropLicenseType + "\n" + kodiPropLicenseUrl + "\n" + channel['channel_url'] + "\n\n"
m3ustr += kodiPropLicenseType + "\n" + kodiPropLicenseUrl + "\n" + "#EXTINF:-1 "
m3ustr += "tvg-id=" + "\"" + "ts" + channel['channel_id'] + "\" " + "group-title=" + "\"" + channel['channel_genre'] + "\" " + "tvg-logo=\"" + channel[
'channel_logo'] + "\" ," + channel['channel_name'] + "\n" + channel['channel_url'] + "\n\n"


def m3ugen():
ts = []
global m3ustr
channelList = jwtoken.getUserChannelSubscribedList()
channelList = jwt.getUserChannelSubscribedList()
for i in range(0, len(channelList), 5):
t = threading.Thread(target=processTokenChunks, args=([channelList[i:i + 5]]))
ts.append(t)
Expand Down Expand Up @@ -58,4 +60,4 @@ def getPrintNote():


if __name__ == '__main__':
m3ugen()
m3ugen()

0 comments on commit 608acbb

Please sign in to comment.