Skip to content

Commit

Permalink
Upload Files
Browse files Browse the repository at this point in the history
  • Loading branch information
henry-richard7 committed Oct 8, 2021
1 parent 6a33a0d commit 7fc043f
Show file tree
Hide file tree
Showing 13 changed files with 243 additions and 0 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,22 @@
# Kodi ZEE5 TV Addon
A kodi Addon That Allows You To Watch Live TV From ZEE5 OTT Platform without ZEE5 Account.

# My Kodi Repo
Vist Here to get more information about my kodi repo https://henry-richard.ml/Kodi/

# Screenshots

# My Youtube Channel
[![](https://img.shields.io/badge/Subscribe-red?style=for-the-badge&logo=YouTube)](https://www.youtube.com/channel/UCVGasc5jr45eZUpZNHvbtWQ)


# My Telegram Channel
[![](https://img.shields.io/badge/Telegram-Join%20Now-blue?style=for-the-badge&logo=Telegram)](https://t.me/cracked4free)

## Donations
If you like my projects then consider making a small donation by clicking below button ^_^
<br/>
[![](https://img.shields.io/badge/Donate-Paypal-blue?style=for-the-badge&logo=paypal)](https://www.paypal.com/paypalme/henryrics)

# Copyrights © [Henry Richard J](https://github.com/henry-richard7)
#### Star the Repo in case you liked it :)
Binary file added Screenshots/ZEE5 1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Screenshots/ZEE5 2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file added __init__.py
Empty file.
Binary file added fanart.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions language/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This folder will be the home of your translations
27 changes: 27 additions & 0 deletions language/resource.language.en_gb/strings.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Kodi Media Center language file
# Addon Name: Zee5 Live TV
# Addon id: plugin.henry.zee5tv
# Addon Provider: Henry Richard
msgid ""
msgstr ""
"Project-Id-Version: XBMC Addons\n"
"Report-Msgid-Bugs-To: alanwww1@xbmc.org\n"
"POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Kodi Translation Team\n"
"Language-Team: English (http://www.transifex.com/projects/p/xbmc-addons/language/en/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: en\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#This is a comment

msgctxt "#32000"
msgid "Example"
msgstr ""

msgctxt "#32001"
msgid "Debug"
msgstr ""
Empty file added lib/__init__.py
Empty file.
43 changes: 43 additions & 0 deletions lib/kodilogging.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# -*- coding: utf-8 -*-

from __future__ import unicode_literals
from resources.lib.kodiutils import get_setting_as_bool

import logging
import xbmc
import xbmcaddon


class KodiLogHandler(logging.StreamHandler):

def __init__(self):
logging.StreamHandler.__init__(self)
addon_id = xbmcaddon.Addon().getAddonInfo('id')
prefix = b"[%s] " % addon_id
formatter = logging.Formatter(prefix + b'%(name)s: %(message)s')
self.setFormatter(formatter)

def emit(self, record):
levels = {
logging.CRITICAL: xbmc.LOGFATAL,
logging.ERROR: xbmc.LOGERROR,
logging.WARNING: xbmc.LOGWARNING,
logging.INFO: xbmc.LOGINFO,
logging.DEBUG: xbmc.LOGDEBUG,
logging.NOTSET: xbmc.LOGNONE,
}
if get_setting_as_bool('debug'):
try:
xbmc.log(self.format(record), levels[record.levelno])
except UnicodeEncodeError:
xbmc.log(self.format(record).encode(
'utf-8', 'ignore'), levels[record.levelno])

def flush(self):
pass


def config():
logger = logging.getLogger()
logger.addHandler(KodiLogHandler())
logger.setLevel(logging.DEBUG)
71 changes: 71 additions & 0 deletions lib/kodiutils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# -*- coding: utf-8 -*-

import xbmc
import xbmcaddon
import xbmcgui
import sys
import logging
import json as json


# read settings
ADDON = xbmcaddon.Addon()

logger = logging.getLogger(__name__)


def notification(header, message, time=5000, icon=ADDON.getAddonInfo('icon'), sound=True):
xbmcgui.Dialog().notification(header, message, icon, time, sound)


def show_settings():
ADDON.openSettings()


def get_setting(setting):
return ADDON.getSetting(setting).strip().decode('utf-8')


def set_setting(setting, value):
ADDON.setSetting(setting, str(value))


def get_setting_as_bool(setting):
return get_setting(setting).lower() == "true"


def get_setting_as_float(setting):
try:
return float(get_setting(setting))
except ValueError:
return 0


def get_setting_as_int(setting):
try:
return int(get_setting_as_float(setting))
except ValueError:
return 0


def get_string(string_id):
return ADDON.getLocalizedString(string_id).encode('utf-8', 'ignore')


def kodi_json_request(params):
data = json.dumps(params)
request = xbmc.executeJSONRPC(data)

try:
response = json.loads(request)
except UnicodeDecodeError:
response = json.loads(request.decode('utf-8', 'ignore'))

try:
if 'result' in response:
return response['result']
return None
except KeyError:
logger.warn("[%s] %s" %
(params['method'], response['error']['message']))
return None
76 changes: 76 additions & 0 deletions lib/plugin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
from __future__ import unicode_literals

# noinspection PyUnresolvedReferences
from codequick import Route, Resolver, Listitem, run
from codequick.utils import urljoin_partial, bold
import requests
import xbmcgui
import re
import urllib
import inputstreamhelper

USER_AGENT = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36'
headers = {
"Origin": "https://www.zee5.com",
"Referer": "https://www.zee5.com",
"Accept-Encoding": "gzip, deflate, br",
"Accept-Language": "en-US,en;q=0.9",
"Accept": "application/json, text/plain, */*",
"content-type": "application/json",
"device_id": "4363debbc0dded755df0b635277271c0",
"platform_name": "desktop_web",
"uid": "ed7f9dad-15f5-4ef1-b9fd-d119f91408dc",
"ppid": "4363debbc0dded755df0b635277271c0",
"User-Agent": USER_AGENT,
"Country": "IN"
}

languages = "ta,kn,pa,bn,en,ml,mr,gu,te,hi"
platform = 'web_app'


def get_live_token():
url = 'https://useraction.zee5.com/token/live.php'
data = requests.get(url, headers=headers).json()
return data['video_token']


def get_token():
url = 'https://useraction.zee5.com/token/platform_tokens.php?platform_name={}'.format(
platform)
data = requests.get(url, headers=headers).json()
return data['token']


def get_play_url(channel_id):
url = f"https://catalogapi.zee5.com/v1/channel/{channel_id}?translation=en&country=IN"
data = requests.get(url).json()
stream_url = data['stream_url_hls']
return f"{stream_url}{get_live_token()}"


@Route.register
def root(plugin, content_type="segment"):
headers["x-access-token"] = get_token()
url = f'https://catalogapi.zee5.com/v1/channel/bygenre?sort_by_field=channel_number&sort_order=ASC&genres=FREE%20Channels,Hindi%20Entertainment,Hindi%20Movies,English%20Entertainment,Entertainment,Movie,News,Hindi%20News,English%20News,Marathi,Tamil,Telugu,Bengali,Malayalam,Kannada,Punjabi,Kids,Gujarati,Odiya,Music,Lifestyle,Devotional,Comedy,Drama,Sports,Infotainment&country=IN&translation=en&languages={languages}'

jd = requests.get(url, headers=headers).json()
items = jd['items']

for item in items:
for channel in item['items']:
item = Listitem()
item.label = channel['title']
item.art[
"thumb"] = f"https://akamaividz2.zee5.com/image/upload/w_386,h_386,c_scale/resources/{channel['id']}/channel_web/{channel['list_image']}"
item.art[
"fanart"] = f"https://akamaividz2.zee5.com/image/upload/w_386,h_386,c_scale/resources/{channel['id']}/channel_web/{channel['list_image']}"
item.info["plot"] = f"Watch {channel['title']} Now."
item.set_callback(play_video, channel_id=channel['id'])

yield item


@Resolver.register
def play_video(plugin, channel_id):
return plugin.extract_source(get_play_url(channel_id))
5 changes: 5 additions & 0 deletions settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<settings>
<setting id="debug" type="bool" label="32001" default="false"/>
</settings>

0 comments on commit 7fc043f

Please sign in to comment.