English | 中文
Utilities for China Telecom's IPTV authentication with an example.
Tested in Hubei
The encryption and authorization algorithm (package located in /src/epg/
) is optimized and rewritten based on the best practices of Python in a modern way. Original algorithms have come from reverse engineering of the app on my STB.
The core idea of the example project is to give up on simulating each package, which took a complex analysis and made it impossible to fit different cases. I eventually chose to use the same way originally on the STB, a browser. It's way more easy to debug and control.
For that, I implemented the package /src/browser/
to automatically finish the authorization and receive EPG. Specifically, /src/browser/browser.py
provides a browser interface which allows me to interact with it and will auto-quit once the destination address is hit. And the /src/browser/remote_injector/
provides a few classes and functions to inject Python methods and classes to the browser as JavaScript.
requirement: git, python>=3.10 (tested on Python 3.12), python3-pip, python3-venv
⚠️ the version of the playwright currently freezes to 1.44.0 because there is a critical bug on the latest version (1.45.0) which leads to failure. (The/src/browser/remote_injector/template/invokeRemoteFunction.js
would successfully be injected via/src/browser/remote_injector/inject.py
but won't work)solved
-
-
-
sudo apt-get update sudo apt-get install git python3 python3-pip python3-venv -y
git clone https://github.com/sht2017/iptv.git cd iptv ./setup.py
-
⚠️ /config.yaml
is requiredℹ️ You can create it as in
/config.example.yaml
source .venv/bin/activate PYTHONPATH="$(pwd)/src:${PYTHONPATH}" python3 src/custom/main.py
Go check
/db.json
and enjoy
-
-
-
-
-
⚠️ winget might not available on your systemwinget install --id Git.Git -e --source winget winget install python3 --source winget
git clone https://github.com/sht2017/iptv.git cd iptv python setup.py
-
⚠️ /config.yaml
is requiredℹ️ You can create it as in
/config.example.yaml
.venv\Scripts\activate set PYTHONPATH=%cd%\src;%PYTHONPATH% python src/custom/main.py
Go check
/db.json
and enjoy
-
-
for utility libs check docstring in src/epg, suggest to modify in /src/custom/
.