proxytv
Python library and CLI tool for parsing, processing, and filtering IPTV playlists from proxytv.ru.
Installation
pip install proxytv
Or using Poetry:
poetry add proxytv
Command Line Interface
The package provides a proxytv executable command (also accessible via python -m proxytv).
CLI Options
usage: proxytv [-h] [-f] [-t] [-q QUERY] [-cd COOLDOWN] [-x PROXY] [-chf CHANNEL_FILTERS] [-pl [PL ...]] [-o OUTPUT]
options:
-h, --help Show help message and exit.
-f, --forever Run repeatedly every cooldown seconds.
-t, --threading Fetch and parse playlists concurrently in separate threads (default: True).
-q, --query QUERY Single search query (e.g. "ch: HD" or "pl: aist").
-cd, --cooldown COOLDOWN
Interval between iterations in seconds (default: 30).
-x, --proxy PROXY Proxy server formatted as <protocol>://<ip>:<port>.
-chf, --channel-filters CHANNEL_FILTERS
Path to channel filter file.
-pl [PL ...] Playlist names to download.
-o, --output OUTPUT Output .m3u(8) file path (default: stdout).
Usage Examples
Collect all channels from all available playlists into a single file:
proxytv -o playlist.m3u8
Periodically update selected channels every 2 minutes:
proxytv -chf filters.txt -f -cd 120 -o tv.m3u8
Query a specific channel or playlist:
proxytv -q "ch: HD" -o hd_channels.m3u
Channel Filtering Rules
The --channel-filters (-chf) flag specifies a text file containing filter rules. Each line defines a rule based on regular expressions.
A channel is included in the output playlist if it matches at least one defined rule.
Rule Syntax
- A leading
\character is ignored. - A leading
:character filters by IP address or stream URL instead of channel title. - A leading
#character matches literal substrings without evaluating regular expression symbols. - Rules without special prefixes are evaluated as regular expressions against channel titles and metadata.
- All rule matching is case-insensitive.
Example Filter File (filters.txt)
#NICKELODEON HD
#CARTOON NETWORK
#REN TV
#TNT HD
Run continuous parsing with filtering:
python -m proxytv -chf filters.txt -f -cd 120 -o tv.m3u8
Python API
The library can be integrated directly into Python applications.
Basic API Search
from proxytv import SearchEngine
# List available playlists
playlists = SearchEngine.plist()
# Search for a specific playlist
extinf = SearchEngine.pl("aist")
# Save results to a file
with open("aist.m3u8", "w", encoding="utf-8") as f:
f.write(str(extinf))
Custom Robot Implementation
Extend the Robot or RobotThreading classes to customize processing loops or post-processing behavior:
from proxytv import RobotThreading, SearchEngine
class CustomRobot(RobotThreading):
def post_init(self):
# Perform custom setup after initialization
pass
def upload(self, filename: str):
# Called after output saving (e.g. upload file to remote host)
print(f"Playlist saved to: {filename}")
# Instantiate and run
robot = CustomRobot(forever=False, search=SearchEngine, output="output.m3u8")
robot.run()
License
MIT License. Developed by Nikita Denissov (ndenissov).
Release files for proxytv 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| proxytv-1.1.0.tar.gz | 9.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| proxytv-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.4 kB
Release files / proxytv-1.1.0.tar.gz
| Download URL | proxytv-1.1.0.tar.gz |
|---|---|
| Size | 9.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c508623a4cfa5304422163c69be0b9e58cf267f5818c9abfdee5fa2b6f6e1d22
|
|
BLAKE2b-256 checksum How to use checksums |
d6041f5e988832109f2b7d4c5c271a8d22be06b6e40acaa8959c6b68ef56e10f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.13.14 Linux/7.1.4-zen1
|
Release files / proxytv-1.1.0-py3-none-any.whl
| Download URL | proxytv-1.1.0-py3-none-any.whl |
|---|---|
| Size | 11.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
78c2131704d872a2761ea1f7703431773b332e2e255f5953d4073b8c0c80c625
|
|
BLAKE2b-256 checksum How to use checksums |
11a4aae486fd4feb1528832f5e1023ec7355b60b68b62440c0c8d86869c05df2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.13.14 Linux/7.1.4-zen1
|