# 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**
![](images/tsky.png)
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
<hr>
<hr>
# How to use
+ Clone this to your directory using ```git clone https://github.com/ForceGT/TSPrivateAPI```
+ Simply run main.py using the following code
```python
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
+ You can generate m3u file by selecting option 3. This generates ```allChannelPlaylist.m3u``` file
**NOTE: Please run this only after logging in otherwise the script exits with an error**
+ The generated m3u file may have to be updated time to time. 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
# Playing in Android TV
+ You can use Kodi with the PVR Simple IPTV Plugin. The generated m3u file already is in the standard format that can be read by the plugin
+ You can use Tivimate app to play the m3u playlist too
# Playing in a browser (tried with Chrome)
+ I personally use [Native MPEG-Dash + HLS Playback](https://chrome.google.com/webstore/detail/native-mpeg-dash-%20-hls-pl/cjfbmleiaobegagekpmlhmaadepdeedn) which doesn't suppport playlists yet
+ To play a single file 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
没有合适的资源?快使用搜索试试~ 我知道了~
示例代码显示 TS (TataSky) 直播频道 api 如何工作_python_代码_下载
共15个文件
py:7个
pyc:3个
md:2个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 82 浏览量
2022-06-22
16:31:00
上传
评论
收藏 83KB ZIP 举报
温馨提示
一个脚本,用于根据用户在 Tata Sky 门户网站上订阅的频道生成包含直接流式文件(.mpd 或 MPEG-DASH 或 DASH)的 m3u 播放列表。你只需要登录就可以了 该图显示了 API 如何对任何用户进行身份验证 使用一次性密码 密码机制也有点类似 code_samples目录中使用的不同文件说明 allChannels.py- 这将生成一个文件 allChannels.json,其中包含 TataSky 平台上可用的所有频道,无论用户是否订阅。该文件已包含在存储库中 constants.py- 这是可能在其他文件中的任何位置使用的 url、标头、有效负载的列表 jwttoken.py- 更多详情、使用方法,请下载后阅读README.md文件
资源详情
资源评论
资源推荐
收起资源包目录
TSPrivateAPI-master.zip (15个子文件)
TSPrivateAPI-master
images
tsky.png 40KB
test.py 833B
static
apidoc.md 5KB
code_samples
constants.py 390B
main.py 2KB
utils.py 1KB
__pycache__
constants.cpython-39.pyc 584B
jwtoken.cpython-39.pyc 3KB
login.cpython-39.pyc 4KB
allChannels.py 2KB
login.py 5KB
jwtoken.py 3KB
allChannels.json 259KB
.gitignore 184B
README.md 4KB
共 15 条
- 1
快撑死的鱼
- 粉丝: 1w+
- 资源: 9154
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0