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
M3U Playlist for free TV channels

Free TV This is an M3U playlist for free TV channels around the World. Either free locally (over the air): Or free on the Internet: Plex TV Pluto TV P

Free TV 964 Jan 8, 2023
A bot that updates about the most subscribed artist' channels on YouTube

A bot that updates about the most subscribed artist' channels on YouTube. A weekly top chart report is provided every Monday. It posts updates on Twitter

Marco Fantauzzo 5 Dec 14, 2022
SpotPlay2YouPlay - Converts new additions to a Spotify playlist to a matching Youtube playlist

SpotPlay2YouPlay - Converts new additions to a Spotify playlist to a matching Youtube playlist, can also be configured to converting whole playlists with the refresh fun

null 9 Mar 6, 2022
Tubee is a web application, which runs actions when your subscribed channel upload new videos

Tubee is a web application, which runs actions when your subscribed channel upload new videos, think of it as a better IFTTT but built specifically for YouTube with many enhancements.

Tomy Hsieh 11 Jan 1, 2023
A thin Python Wrapper for the Dark Sky (formerly forecast.io) weather API

Dark Sky Wrapper This is a wrapper for the Dark Sky (formerly forecast.io) API. It allows you to get the weather for any location, now, in the past, o

Ze'ev Gilovitz 414 Nov 16, 2022
Replacement for the default Dark Sky Home Assistant integration using Pirate Weather

Pirate Weather Integrations This integration is designed to replace the default Dark Sky integration in Home Assistant with a slightly modified, but f

Alexander Rey 129 Jan 6, 2023
Chronocalc - Calculates the dates and times when the sun or moon is in a given position in the sky

Chronocalc I wrote this script after I was busy updating my article on chronoloc

null 16 Dec 13, 2022
Total time of all YouTube videos in a playlist.

Youtube Playlist Total Times Total time of all YouTube videos in a playlist. How to Use Download chromedriver depending on your os and chrome version

Mohammad Dori 3 Jul 15, 2022
Benachrichtigungs-Bot für das niedersächische Impfportal / Notification bot for the lower saxony vaccination portal

Ein kleines Wochenend-Projekt von mir. Der Bot überwacht die REST-API des niedersächsischen Impfportals auf freie Impfslots und sendet eine Benachrichtigung mit deinem bevorzugtem Service. Ab da gilt leider: der Schnellste gewinnt. Bitte missbraucht den Bot nicht und verwendet moderate Intervalle.

sibalzer 37 May 11, 2022
Python wrapper for Interactive Brokers Client Portal Web API

EasyIB: Unofficial Wrapper for Interactive Brokers API EasyIB is an unofficial python wrapper for Interactive Brokers Client Portal Web API. Features

null 39 Dec 13, 2022
Portal Backend for Yuta management

Portal Backend for Yuta management Prerequisites Python 3.10 or above. pip, pdm installed. Quickstart Install the required packages: pdm install Runn

Loc Mai 1 Dec 20, 2021
Telegram Voice Chat UserBot made with Pyrogram and MarshalX/tgcalls with playlist and Heroku support

Telegram Voice Chat UserBot A Telegram UserBot to Play Audio in Voice Chats. This is also the source code of the userbot which is being used for playi

Calls Music 164 Nov 12, 2022
JAKYM, Just Another Konsole YouTube-Music. A command line based Youtube music player written in Python with spotify and youtube playlist support

Just Another Konsole YouTube-Music Overview I wanted to create this application so that I could use the command line to play music easily. I often pla

Mayank Jha 73 Jan 1, 2023
YouTube playlist Files downloaded by FDM are not organized according to the original order on YouTube

Youtube-Playlist-File-Organizer YouTube playlist Files downloaded by Free Download Manager are not organized according to the original order on YouTub

David Mainoo 3 Dec 27, 2021
A Python script to update Spotify Playlist data every 5 minutes.

Spotify Playlist Updater A Python script to update Spotify Playlist data every 5 minutes. Description An automatic playlist updater using Spotify API

null 6 Nov 24, 2022
Youtube Music Playlist Organizer

Youtube Music Playlist Organizer, a simple Python application that uses ytmusicapi to help user edit their playlists and organize in other playlists.

Bedir Tapkan 1 Oct 24, 2021
Web app for spotify playlist management with last.fm integration

Music Tools Set of utility tools for Spotify and Last.fm. Built on my other libraries for Spotify (spotframework), Last.fm (fmframework) and interfaci

andy 3 Dec 14, 2022
Converts a text file of songs to a playlist on your Spotify account.

Playlist Converter Convert a text file of songs to a playlist on your Spotify account. Create your playlists faster instead of manually searching for

Priya Aggarwal 18 Dec 21, 2022
PlaylistAudioBot - Telegram playlist download bot with ytdl

Telegram PlaylistAudioBot PlaylistAudioBot: ???? Telegram playlist download bot

Hüzünlü Artemis [HuzunluArtemis] 14 Jul 22, 2022