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
This is a open source discord bot project

pythonDiscordBot This is a open source discord bot project #based on the MAX A video: https://www.youtube.com/watch?v=jHZlvRr9KxM Prerequisites Python

Edson Holanda Teixeira Junior 3 Oct 11, 2021
The source code of the bot that displays erotic images on Discord

説明 このコードはDiscord.pyとNeko APIを使ったNsfw画像表示ボットのソースコードです。 成人向けコンテンツを含むボットなので、不快になる方はこのボットの作成中止をおすすめします。 使い方 まず、install.batを起動してください。 そのあとに、config.json を開き

はなくそ 1 Dec 28, 2021
Auto filter bot for python

Media Search bot Index channel or group files for inline search. When you post file on telegram channel or group this bot will save that file in datab

1 Dec 22, 2021
Facebook fishing on telegram bot

Facebook-fishing Facebook fishing on telegram bot تثبيت الاداة pkg update -y pkg upgrade -y pkg install git -y pkg install python -y git clone https:/

sadamalsharabi 7 Oct 18, 2022
A simple, multipurpose Discord bot.

EpicBot 🏅 A simple, multipurpose Discord bot. • Info EpicBot is a multipurpose Discord bot that was designed to make your Discord life easier and coo

Nirlep_5252_ 130 Dec 29, 2022
A simple Telegram bot that converts a phone number to a direct whatsapp chat link

Open in WhatsApp I was using a great app to open a whatsapp chat with a given number directly without saving that number in my contact list, but I fel

Pathfinder 19 Dec 24, 2022
Beyonic API Python official client library simplified examples using Flask, Django and Fast API.

Beyonic API Python official client library simplified examples using Flask, Django and Fast API.

Role Discord Members (by username) from File

Role Discord Members (by username) from File Bot Setup Navigate to https://discord.com/developers/applications Create a new application Navigate to th

Dylan Orrell 3 Jan 06, 2022
An Simple Advance Auto Filter Bot Complete Rewritten Version Of Adv-Filter-Bot

Adv Auto Filter Bot V2 This Is Just An Simple Advance Auto Filter Bot Complete Rewritten Version Of Adv-Filter-Bot.. Just Sent Any Text As Query It Wi

0 Dec 18, 2021
A simple google translator telegram bot version 2

Translator-Bot-V2 A simple google translator telegram bot version 2 Made with Python3 (C) @FayasNoushad Copyright permission under MIT License License

Fayas Noushad 15 Oct 21, 2022
Petit webhook manager by moi (wassim)

Webhook Manager By wassim oubliez pas de ⭐ le projet Installations il te faut python sinon quand tu va lancer le start.bat sa va tout installer tout s

wassim 9 Jul 08, 2021
Faster Twitch Alerts is a highly customizable, lightning-fast alternative to Twitch's slow mobile notification system

Faster Twitch Alerts What is "Faster Twitch Alerts"? Faster Twitch Alerts is a highly customizable, lightning-fast alternative to Twitch's slow mobile

6 Dec 22, 2022
Repository to access information of stocks in Bombay Stock Exchange.

BSE Repository to access information of stocks in Bombay Stock Exchange. The code in this repository uses BSE API and conclusions made using the code

1 Nov 13, 2021
🥀 Find the start of the token !

Discord Token Finder Find half of your target's token with just their ID. Install 🔧 pip install -r requeriments.txt Gui Usage 💻 Go to Discord Setti

zeytroxxx 2 Dec 22, 2021
Automate TikTok follower bot, like bot, share bot, view bot and more using selenium

Zefoy TikTok Automator Automate TikTok follower bot, like bot, share bot, view bot and more using selenium. Click here to report bugs. Usage Download

555 Dec 30, 2022
Discord bot template.py

discord_bot_template.py A minimal and open-source discord.py boilerplate for kick-starting bot projects. I spend a lot of time developing bots for dif

Tarran Prior 1 Feb 24, 2022
Wrapper around the latest Tuenti API

python-tuenti Overview Wrapper around the latest Tuenti API. Installation Install using pip, including any optional packages you want... $ pip install

Juan Riaza 10 Mar 07, 2022
Simple VK API wrapper for Python

VK Admier: documentation VK Admier is simple VK API wrapper for community bot development. Authorization You should create bot object from Client clas

Egor Light 2 Nov 10, 2022
Implement backup and recovery with AWS Backup across your AWS Organizations using a CI/CD pipeline (AWS CodePipeline).

Backup and Recovery with AWS Backup This repository provides you with a management and deployment solution for implementing Backup and Recovery with A

AWS Samples 8 Nov 22, 2022
Kodi script for proper Australian weather data

Kodi Oz Weather weather.ozweather Script for Kodi for high quality Australian weather data sourced directly from the BOM. Available from the Kodi offi

Jeremy Daalder 5 Nov 24, 2022