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.
- A working brain
- Knowledge of basic python
- A working Tata Sky/ Play account
- Channels that you want to watch, already subscribed (I'm sorry, no freebies)
- An app capable of reading a m3u file
I know you would love to get your hands on how this works, but hold on and read before you proceed further
The methods are divided into
Easy
andDifficult
based on how comfortable you are with the commandline. TheEasy
guide is recommended if you have no working knowledge of Python or scripting in general
- Login with your SID, RMN and OTP/ Password(deprecated) first
- Once you login, your details are saved to your local storage so that you don't have to enter the details again and again
- Every 24 hours, the playlist expires, so the app gives you the next expiry time and you will have to generate your playlist again before that time
- The app can be found in the releases page
Minimum Supported Android Version : Android 5.0
- Make sure you have python up and running on your system. If you don't know how to do this then well, don't think of proceeding further
- You need
requests
to be installed. Do that by usingpip install requests
- Clone this to your directory using
git clone https://github.com/ForceGT/TSPrivateAPI
or download thezip
file and then go inside thecode_samples
directory and open your terminal there - Change to the
code_samples
directory by usingcd code_samples
- 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. TheaccessToken
has to be updated from time to time. To do so run the login logic again. If you delete theuserDetails.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 -
You need to login just once usually, it will create a
userDetails.json
file once you login, and then you can just regenerate the playlist each day when you would like to use it. If you don't see theuserDetails.json
file anywhere, then you may have to login again
Find some good M3u players here
The issue with the playlist, is that it expires in 24 hours as the access tokens have a validity of 24 hours. So the straightforward way would be do the entire process (without login) again after the playlist expires but man is lazy and so there are two brilliant solutions so that you lazy bums don't have to re-generate after a day
- Take a look at Shravan's Idea
- Take a look at Saif's Idea
If you're interested in how this mechanism works, Refer to docs
This code is just a CASE STUDY on how the authentication mechanism and live streaming using IPTV works I am in no way responsible if you misuse the code and cause revenue loss to the concerned parties and owners of the portal
This code is protected under the MIT license