Generate direct m3u playlist for all the channels subscribed in the Tata Sky portal

Overview

Tata Sky IPTV Script generator

A script to generate the m3u playlist containing direct streamable file (.mpd or MPEG-DASH or DASH) based on the channels that the user has subscribed on the Tata Sky portal. You just have to login that's it

Login

The figure shows how the API authenticates any user

Using OTP

Password mechanism also works kinda similar

Explanation of different files used in the code_samples directory

allChannels.py - This generates a file allChannels.json containing all the channels available on the TataSky platform irrespective of whether the user has subscribed or not. The file has already been included in the repository

constants.py - This is a list of urls, headers, payloads that might be used anywhere in the other files

jwttoken.py -

  • This contains the logic need for generation of the jwt . This is different from the user access Token generated by the backend upon user login. This is needed to get a license to play each channel url / mpeg dash stream /mpd file The token generated here is appended to the license_url of each channel using ls_session key You can find how it is done in the detailed manner in the file itself
  • This can be used independently , just specify the channelId for which you need to get the token and you are good to go The script calls this repeatedly for all channels in the user subscribed/entitlement list

main.py - This contains the logic for the menu generation for the user. It might be updated constantly utils.py - This contains the logic for the m3u generation. This will be integrated soon in the main file



TODO

  • Add Support for Kodi 19.0 ( See #1 for more info)
  • Figure out easy way to solve the issue of playlist need to be updated daily

How to use

  • Clone this to your directory using git clone https://github.com/ForceGT/TSPrivateAPI
  • Change to the code_samples directory by using cd code_samples
  • Get all the needed requirements for the script from the requirements.txt file using pip install -r requirements.txt
  • Simply run main.py (the main script) using the following code
  python main.py
  • You will get options to login using the different methods, upon successful login a userDetails.json file is created which contains important details of the user. The accessToken has to be updated from time to time. To do so run the login logic again. If you delete the userDetails.json file you will have to login again so please be careful

  • You can generate m3u file by selecting option 3. This generates allChannelPlaylist.m3u file in the current directory NOTE: Please run this only after logging in using Step 1 or 2 otherwise the script exits with an error

Playing in Android TV

  • You can use Kodi with the PVR Simple IPTV Plugin [doesn't work yet]. The generated m3u file already is in the standard format that can be read by the plugin (WIP)
  • You can use Tivimate app to play the m3u playlist too

Playing in Android

  • You can use Kodi to play the m3u file(WIP)
  • You can play individual channel using Exostreamer Playing individual link : Just open the m3u file generated above in any text editor of your choice and search for your channel. Once you found it, get the channel url(the one that ends with .mpd and starts with http) and your license url(The license url is the value of the key #KODIPROP:inputstream.adaptive.license_key= paramater) Paste the channelurl(mentioned above) in the text field and click on the DRM button to enter your license url and then click on play. The app automatically remembers this next time if you use it

Playing in a browser (tried with Chrome)

To play a single link/ particular channel

  • Open the generated m3u file, and look for the channel you want to play. Get the channel url (ends with .mpd) and paste it in the browser
  • The extension automatically asks for the license url. You should then look for the license url. The license url is the value of the key #KODIPROP:inputstream.adaptive.license_key= paramater. Copy the entire url and paste it in the browser NOTE: The ls_session should be copied carefully otherwise the license is not granted

Good points to know

  • The generated m3u file has to be updated daily.If you generated it at 11:00pm today it will expire by 11:00pm tomorrow.You don't need to relogin, just generate the playlist again using command number 3 in the script.

  • If it fails to get jwt for a specific channelId then you must do it manually. Note down the channelId and then use the jwttoken.py to generate token for that file and manually edit the m3u file using any text editor How to edit: First run the jwttoken.py python file using python jwttoken.py Enter the channelId for which you need a token The Token you obtain after running the `above file will be printed in the console. Copy this token and open the m3u file and edit the value inputstream.adapative.license_url=https://tatasky.irdetto.***** and append to it ```ls_session```.If your url is ```https://tatasky.****``` then after appending the ```ls_session```, it should now be ```https://tatasky.irdetto.com/****ContentId=4999999&ls_session=Your_Token_Here```

  • You don't need to have a Tata Sky dish, you just need to have a working subscriber id / registered no and/or otp/password (Total 4 ways of logging in using the script) and you should have the channel you want to watch subscribed for the above script to work

  • You need to have basic python knowledge for this

Comments
  • Explicitly specify inputstreamaddon and manifest type=mpd while generating the playlist

    Explicitly specify inputstreamaddon and manifest type=mpd while generating the playlist

    By default, kodi is unable to interpret the mpd format. With these, kodi is able to interpret the mpd format and is also sending the requests to license_key url.

    However, afterwards, the license_key url is giving a different error, as described here: https://github.com/xbmc/inputstream.adaptive/issues/378 I have not gotten past this point.

    opened by anishsane 7
  • Some channels not working

    Some channels not working

    Suddenly some channels stopped working Set Max (SD), Sony Wah, Disney as I got only this cannels not working, Tatasky source is okay as I found those are playing on Tatasky Watch and other unofficial playlists.

    opened by animeshrock 5
  • Language

    Language

    First of all - Amazing work Congratulations and many thanks The only problem is that while watching channels under "Knowledge" section, we can't change language, I was watching NatGeo Wild and I guess it was running Telugu. Can we fix this ?

    Regards

    opened by drtiwarir 4
  • Any Chances of adding other OTT

    Any Chances of adding other OTT

    any chances of you adding other ott live tv channel list ? it will be great to generate voot, zee5, sony live tv from one app !

    Thanks for the script and app, its really helpful !

    enhancement 
    opened by deepaksp 4
  • VLC showing blank screen (even though progress bar is moving)

    VLC showing blank screen (even though progress bar is moving)

    So, I cloned your repo, generated my userdetails, generated my channel playlist. But VLC shows a blank screen (even though progress bar is moving)

    image

    Any ideas as to why?

    opened by theincognito-inc 4
  • Delay in channels

    Delay in channels

    There is a one minute delay while watching the live channels. It is a concern while watching sports. Can we do something to reduce this delay to 30 seconds?

    opened by saifshaikh1805 3
  • Look-up subscriber ID from RMN using tata sky API

    Look-up subscriber ID from RMN using tata sky API

    We often remember our phone number, but not our subscriber ID. So, we need to look up the SID from tata sky app or from the STB. Tata sky provides an API to look up the subscriber ID from RMN. Use that to populate the default subscriber ID. If more than 1 SIDs present for the same RMN, provide a list instead.

    opened by anishsane 2
  • Genre/Section Issue

    Genre/Section Issue

    Can you add more specific Genre/section like Hindi Movies, Hindi Entertainment, Knowledge and Lifestyle, Marathi etc, and put that particular channels in that Genre/section same as we see in Tata Sky set up box.

    opened by ajayuclever 2
  • M3U is not generating

    M3U is not generating

    Hi,

    Getting following error while trying to generate M3U file in both OTP as well as password method of login. Please advice. Thanks!

    Could not generate JWT for channelId: 80 Didn't get license for channel: Id: 80 Name:SONY MAX HD Continuing...Please get license manually for channel : SONY MAX HD Response: {"code":"TKERR007","message":"Invalid epids"} Could not generate JWT for channelId: 72 Didn't get license for channel: Id: 72 Name:REPUBLIC TV Continuing...Please get license manually for channel : REPUBLIC TV Response: {"code":"TKERR007","message":"Invalid epids"}Response: {"code":"TKERR007","message":"Invalid epids"}

    opened by vgmuthu 2
  • Categorization of the Channels into the Playlist

    Categorization of the Channels into the Playlist

    Hey @ForceGT, That's really a great work by you, I'm hoping that we can expect all the channels being categorized in the playlist. It really makes hassle free.

    opened by Shra1V32 2
  • How can i register it please?

    How can i register it please?

    When I visit https://www.tataplay.com/, the following information appears:

    403 ERROR The request could not be satisfied. The Amazon CloudFront distribution is configured to block access from your country. We can't connect to the server for this app or website at this time. There might be too much traffic or a configuration error. Try again later, or contact the app or website owner. If you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation.

    Generated by cloudfront (CloudFront) Request ID: bUdtB-D77qMavB8KkroxWL3eR7vrv631BHmXSXlTI1ECwl9gANp29w==

    opened by 239144498 1
Releases(v3.1)
  • v3.1(May 28, 2022)

  • v3.0(May 28, 2022)

    • Added better notifications
    • Added 401 Error Resolution, please re-login if you see it
    • New Added auto fetching of Subscriber ID from Mobile Number, you just enter your mobile number and the app will fetch the details automatically
    • New Added settings when clicking on top right icon
      • EPG: You can now set your own epg before generation
    • New Made Playlist generation upto 1.5X faster
    • Removed password option from login, and OTP is the only way possible in the backend

    Note: This is an EOL Update, use the script for generation going forward

    Source code(tar.gz)
    Source code(zip)
    app_3.0.apk(5.03 MB)
  • PlaylistRefresh-TV(Jan 19, 2022)

    • You can simply use the android app on your mobile phone or TV, log in and then generate an m3u
    • Note that you have to generate a new playlist before the exploit time, that is mentioned in the app or just one day for simplicity
    • The app can smartly detect if you have a playlist already in the mentioned directory,(the location of the file can be found inside the app), and it overwrites the content if you generate it again and again
    • You can point Tivimate to the location mentioned in the app, and just update once whenever you want to watch the playlist, should work fine
    • There may be issues navigating through the text fields in TV, Try with the left key to navigate down, works for me, will fix when I have time Minimum Supported Version: Android 5.0
    Source code(tar.gz)
    Source code(zip)
    app.apk(4.49 MB)
Owner
Gaurav Thakkar
CSE Student, Mobile App Developer (Android/IOS/Flutter) , Cybersecurity Enthusiast, Spends time writing random scripts sometimes
Gaurav Thakkar
An API wrapper around Discord API.

NeoCord This project is work in progress not for production use. An asynchronous API wrapper around Discord API written in Python. Features Modern API

Izhar Ahmad 14 Jan 03, 2022
Ts-matterbridge - Integrate TeamSpeak Chat with MatterBridge

TeamSpeak-MatterBridge Bot You can use this bot to integrate TeamSpeak Chat with

4 Sep 25, 2022
Weee - Advanced project's versions bumper

Weee - Advanced project's versions bumper

Yan Kurbatov 2 Jun 06, 2022
Images to PDF Telegram Bot

ilovepdf Convert Images to PDF Bot This bot will helps you to create pdf's from your images [without leaving telegram] 😉 By Default: your pdf fil

✰Naͥbiͣlͫ A Navab✰ 116 Dec 29, 2022
Crypto Signal Provider - A web application that allows users to select a cryptocurrency

Crypto_Signal_Provider This is a web application that allows users to select a c

Raul 2 Dec 11, 2022
Hazard-Nuker - Hazard Nuker With Python

🌟 Since hazard is free, donations are really appriciate and keeps the developme

†† 9 Oct 26, 2022
A supabase client for python

supabase-client A Supabase client for Python. This mirrors the design of supabase-js Full documentation: https://keosariel.github.io/2021/08/08/supaba

kenneth gabriel 11 Dec 19, 2022
Telegram bot that let's you flip a coin in a dialog

coin_flip Telegram bot that let's you flip a coin in a dialog Report issue · Request feature About Software development tool that lets you finally dec

Ivan Akostelov 2 Dec 12, 2021
A multipurpose bot designed to make Discord better for everyone, written in Python.

Hadum A multipurpose bot that makes Discord better for everyone Features A Fully Functional Moderation component: manage your staff, members and permi

1 Jan 25, 2022
Powerful Telegram userbot to turn your PROFILE PICTURE & LAST NAME into a real time clock & to change your BIO automatically.

DATE_TIME_USERBOT-TeLeTiPs Powerful Telegram userbot to turn your PROFILE PICTURE & LAST NAME into a real time clock & to change your BIO automaticall

53 Jan 05, 2023
NitroSniper - A discord nitro sniper, it uses 2 account tokens here's the explanation

Discord-Nitro-Sniper This is a discord nitro sniper, it uses 2 account tokens he

vanis / 1800 0 Jan 20, 2022
Develop and deploy applications with the Ionburst Cloud Python SDK.

Ionburst SDK for Python The Ionburst SDK for Python enables developers to easily integrate with Ionburst Cloud, building in ultra-secure and private o

Ionburst Cloud 3 Mar 06, 2022
Rotten Tomatoes API for Python

rottentomatoes.py rottentomatoes offers an easy-to-use Python wrapper to interact with the Rotten Tomatoes API. Before you try and use the API, make s

Zach Williams 88 Dec 15, 2022
Lumberjack-bot - A game bot written for Lumberjack game at Telegram platform

This is a game bot written for Lumberjack game at Telegram platform. It is devel

Uğur Uysal 6 Apr 07, 2022
This software's intent is to automate all activities related to manage Axie Infinity Scholars. It is specially aimed to mangers with large scholar roasters.

Axie Scholars Utilities This software's intent is to automate all activities related to manage Scholars. It is specially aimed to mangers with large s

Ferran Marin 153 Nov 16, 2022
This is a Innexia Group Manager Bot with many features

⚡ Innexia ⚡ A Powerful, Smart And Simple Group Manager ... Written with AioGram , Pyrogram and Telethon... Available on Telegram as @Innexia ❤️ Suppor

TeamDeeCode 84 Jun 04, 2022
A project that alerts me when there's a dog outside so I can go look at it.

Dog Detector A project that alerts me when there's a dog outside so I can go look at it. Tech Specs This script uses the YOLOv3 object detection model

rydercalmdown 58 Jul 29, 2022
Discord Bot for League of Legends live match tracker

SABot Dicord Bot for League of Legends match auto tracker Features: Search Summoners statistics in League of Legends. Auto-notifications provide when

Jungyu Choi 4 Sep 27, 2022
Manage Proxmox KVM Virtual Machines via Slack bot.

proxmox-slack-bot Create KVM Virtual Machines on Proxmox, the easy way. Not much works works here yet... Setup dev environment Setup fully editable st

Plenus Pyramis 3 Mar 20, 2022
Stock market bot that will be used to learn about API calls and database connections.

Stock market bot that will be used to learn about API calls and database connections.

1 Dec 24, 2021