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
A Telegram Bot written in Python for mirroring files on the Internet to your Google Drive or Telegram

Original Repo mirror-leech-telegram-bot This is a Telegram Bot written in Python for mirroring files on the Internet to your Google Drive or Telegram.

0 Jan 03, 2022
Os-Remoter with Python (Telegram Bot)

Remote-Os Os-Remoter with Python (Telegram Bot) [1] First install "python -m pip install --upgrade pip" [2] Second install the modules inside file ins

Alisa Alikhani 2 Nov 09, 2022
Hasan Can Kaya - Konusanlar Ticket Notifier

Hasan Can Kaya - Konusanlar Ticket Notifier This script sends a notification to any telegram chat/group/channel when added a new available ticket to b

omer citak 3 Jan 31, 2022
A bot can play all variants, but standard are abit weak, so if you need strongest you can change fsf instead of stockfish_14_Dev

MAINTAINERS Drdisrespect1 and drrespectable lichess-bot Engine communication code taken from https://github.com/ShailChoksi/lichess-bot by ShailChoksi

RPNS Nimsilu 1 Dec 12, 2021
Zero2 Discord bot is written with Discord.py using Python.

Zero2 Discord bot is written with Discord.py using Python.

Siva Avanish 4 Nov 08, 2021
Isobot is originally made by notsniped. This is a remix of iso.bot by archisha.

iso6.9-1.2beta iso.bot is originally made by notsniped#0002. This is a remix of iso.bot by αrchιshα#5518. iso6.9 is a Discord bot written in Python an

Kamilla Youver 3 Jan 11, 2022
An alternative launcher for Lunar Client which is aimed at portability and functionality.

Portaluna An alternative launcher for Lunar Client which is aimed at portability and functionality. Features Portable. Lightweight. Functional. Note:

4 Mar 05, 2022
Discord Webhook Spammer (fastest)

Discord Webhook Spammer A simple fast asynchronous webhook spammer. Spammer Features Fast message spamming. Controllable speed. Noob friendly. Usage N

Varient 2 Apr 22, 2022
ApiMoedas - This API is a extesion of API

🪙 Api Moeda 🪙 Este projeto é uma extensão da API Awesome API. Basicamente, ele mostra todas as moedas que a Awesome API tem e todas as suas conversõ

Abel 4 May 29, 2022
Pixiv 爬虫,使用 Python 实现。支持批量下载、上传到图床。

用 Python 实现的 Pixiv 爬虫,支持批量下载和上传。 随机图片 API: https://loliapi.ml/ Deploy Github Action 集成部署 建议使用本方法部署,相较于本地部署,无需搭建环境,全程在线上完成。并且使用国外服务器下载、上传,网络更加通畅。 Fork

18 Feb 26, 2022
A media upload to telegraph module

A media upload to telegraph module

Fayas Noushad 5 Dec 01, 2021
🔎 Hunt down social media accounts by username across social networks

Hunt down social media accounts by username across social networks Installation | Usage | Docker Notes | Contributing Installation # clone the repo $

Sherlock 38.2k Jan 01, 2023
Another Autoscaler is a Kubernetes controller that automatically starts, stops, or restarts pods from a deployment at a specified time using a cron annotation.

Another Autoscaler Another Autoscaler is a Kubernetes controller that automatically starts, stops, or restarts pods from a deployment at a specified t

Diego Najar 66 Nov 19, 2022
Discord Token Generator based on HTTPX, makes unverified tokens and automatically joins your server! this is used for memberboosting

Discord Token Generator | 2021 Features: (1) hCaptcha Bypasser, latest hfuck.py Updated by me (2) Free Proxy Support/Scrapper (3) Custom Realistic Dat

2 Nov 30, 2021
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
Get an SNS alert for High Severity GuardDuty findings

Automation AWS-GuardDuty findings Get an SNS alert for High Severity GuardDuty findings Problem: Getting notified when there is Red finding in AWS Gua

Giten Mitra 4 Nov 18, 2022
A Telegram bot to all media and documents files to web link .

FileStreamBot A Telegram bot to all media and documents files to web link . Report a Bug | Request Feature 🍁 About This Bot : This bot will give you

Code X Mania 129 Jan 03, 2023
A GUI Application that creates a Spotify Playlist from any year in the past, by just entering your preferred date

A GUI Application that creates a Spotify Playlist from any year in the past, by just entering your preferred date

David .K. Danso 1 Jan 17, 2022
A repository of publicly verifiable token Sale contracts

Token-Sale-Plutus-Contract A repository of publicly verifiable token sale and royalty contracts. This will be the storage solution since it is easily

Logical Mechanism 29 Aug 18, 2022
Discord group chat leaver.

Discord group chat leaver I know many people who have fallen victim to these weird group chat spammers including me. I made this script to help those

cliphd 3 Feb 27, 2022