ipbeeldbuis 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
ipbeeldbuis/__init__.py
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"""
|
|
2
|
+
ipbeeldbuis — IPTV stream picker TUI.
|
|
3
|
+
|
|
4
|
+
The Rust binary is downloaded from GitHub Releases on first use and cached
|
|
5
|
+
next to this file. No compilation required.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
import os
|
|
9
|
+
import platform
|
|
10
|
+
import stat
|
|
11
|
+
import sys
|
|
12
|
+
import tarfile
|
|
13
|
+
import tempfile
|
|
14
|
+
import urllib.request
|
|
15
|
+
|
|
16
|
+
VERSION = "0.1.0"
|
|
17
|
+
REPO = "stanlocht/ipbeeldbuis"
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def _binary_path() -> str:
|
|
21
|
+
here = os.path.dirname(os.path.abspath(__file__))
|
|
22
|
+
name = "ipb.exe" if sys.platform == "win32" else "ipb"
|
|
23
|
+
return os.path.join(here, name)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def _detect_target() -> str:
|
|
27
|
+
machine = platform.machine().lower()
|
|
28
|
+
system = platform.system().lower()
|
|
29
|
+
|
|
30
|
+
if system == "darwin":
|
|
31
|
+
os_name = "macos"
|
|
32
|
+
elif system == "linux":
|
|
33
|
+
os_name = "linux"
|
|
34
|
+
else:
|
|
35
|
+
raise RuntimeError(
|
|
36
|
+
f"Unsupported platform: {system}. "
|
|
37
|
+
"Install manually from https://github.com/stanlocht/ipbeeldbuis/releases"
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
if machine in ("arm64", "aarch64"):
|
|
41
|
+
arch = "arm64"
|
|
42
|
+
elif machine == "x86_64":
|
|
43
|
+
arch = "x86_64"
|
|
44
|
+
else:
|
|
45
|
+
raise RuntimeError(
|
|
46
|
+
f"Unsupported architecture: {machine}. "
|
|
47
|
+
"Install manually from https://github.com/stanlocht/ipbeeldbuis/releases"
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
return f"{os_name}-{arch}"
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def _download_binary() -> None:
|
|
54
|
+
target = _detect_target()
|
|
55
|
+
filename = f"ipb-{target}.tar.gz"
|
|
56
|
+
url = f"https://github.com/{REPO}/releases/download/v{VERSION}/{filename}"
|
|
57
|
+
|
|
58
|
+
print(f"ipbeeldbuis: downloading binary for {target}...", file=sys.stderr)
|
|
59
|
+
|
|
60
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
61
|
+
archive = os.path.join(tmp, filename)
|
|
62
|
+
try:
|
|
63
|
+
urllib.request.urlretrieve(url, archive)
|
|
64
|
+
except Exception as e:
|
|
65
|
+
raise RuntimeError(
|
|
66
|
+
f"Failed to download binary from {url}\n"
|
|
67
|
+
"Check https://github.com/stanlocht/ipbeeldbuis/releases"
|
|
68
|
+
) from e
|
|
69
|
+
|
|
70
|
+
with tarfile.open(archive, "r:gz") as tar:
|
|
71
|
+
tar.extractall(tmp)
|
|
72
|
+
|
|
73
|
+
src = os.path.join(tmp, "ipb")
|
|
74
|
+
if not os.path.exists(src):
|
|
75
|
+
raise RuntimeError(f"Binary not found in archive: {filename}")
|
|
76
|
+
|
|
77
|
+
dest = _binary_path()
|
|
78
|
+
import shutil
|
|
79
|
+
shutil.copy2(src, dest)
|
|
80
|
+
os.chmod(dest, os.stat(dest).st_mode | stat.S_IEXEC | stat.S_IXGRP | stat.S_IXOTH)
|
|
81
|
+
|
|
82
|
+
print("ipbeeldbuis: binary ready.", file=sys.stderr)
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
def main() -> None:
|
|
86
|
+
binary = _binary_path()
|
|
87
|
+
if not os.path.isfile(binary):
|
|
88
|
+
_download_binary()
|
|
89
|
+
os.execv(binary, [binary] + sys.argv[1:])
|
ipbeeldbuis/__main__.py
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ipbeeldbuis
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: IPTV stream picker TUI
|
|
5
|
+
Project-URL: Homepage, https://github.com/stanlocht/ipbeeldbuis
|
|
6
|
+
License: MIT
|
|
7
|
+
Requires-Python: >=3.8
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
|
|
10
|
+
# ipbeeldbuis
|
|
11
|
+
|
|
12
|
+
A terminal UI for browsing and playing IPTV streams from M3U playlists.
|
|
13
|
+
|
|
14
|
+
**Requires [mpv](https://mpv.io) to be installed for playback.**
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Install
|
|
19
|
+
|
|
20
|
+
### curl (macOS / Linux)
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
curl -sSL https://raw.githubusercontent.com/stanlocht/ipbeeldbuis/main/install.sh | bash
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### pip / uv
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
pip install ipbeeldbuis
|
|
30
|
+
# or
|
|
31
|
+
uv add ipbeeldbuis
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
The binary is downloaded automatically on first run.
|
|
35
|
+
|
|
36
|
+
### Build from source
|
|
37
|
+
|
|
38
|
+
Requires [Rust](https://rustup.rs).
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
cargo install --git https://github.com/stanlocht/ipbeeldbuis
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Usage
|
|
47
|
+
|
|
48
|
+
Launch with a playlist URL or local file:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
ipb --source "http://your-provider.com/playlist.m3u"
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Or just run `ipb` to use saved playlists:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
ipb
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Key bindings
|
|
63
|
+
|
|
64
|
+
| Key | Action |
|
|
65
|
+
|-----|--------|
|
|
66
|
+
| `↑ / ↓` or `j / k` | Navigate channels |
|
|
67
|
+
| `← / →` or `h / l` | Switch category tabs |
|
|
68
|
+
| `/` | Search |
|
|
69
|
+
| `t` | Toggle content filter (All / Live / Movies / Series) |
|
|
70
|
+
| `e` | Toggle EPG panel (Now / Next) |
|
|
71
|
+
| `s` | Settings — manage playlists and EPG URLs |
|
|
72
|
+
| `a` | Add a new playlist |
|
|
73
|
+
| `Enter` | Play selected channel |
|
|
74
|
+
| `q` | Quit |
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## EPG
|
|
79
|
+
|
|
80
|
+
If your M3U playlist includes an EPG URL in its header (`url-tvg="..."`), the EPG is loaded automatically. You can also set or override the EPG URL per playlist in the settings screen (`s`).
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
ipbeeldbuis/__init__.py,sha256=kZzeMnRJsq0pGoQShvGJMYNFP55o5CQrxmejiQmrmMU,2501
|
|
2
|
+
ipbeeldbuis/__main__.py,sha256=8hDMczg3jtrKe7kZ69GgH208WzZdYqhLvA3L8U_6FT0,37
|
|
3
|
+
ipbeeldbuis-0.1.0.dist-info/METADATA,sha256=2wAh-KRT2lNkRQSwauR87CY-K_ht9otlloPmx5RyoWc,1585
|
|
4
|
+
ipbeeldbuis-0.1.0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
|
|
5
|
+
ipbeeldbuis-0.1.0.dist-info/entry_points.txt,sha256=W2galSf-LFYf2tCgSHJZ3E2sOSW2SChFoAAEjSACsJc,41
|
|
6
|
+
ipbeeldbuis-0.1.0.dist-info/RECORD,,
|