vega-cli 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.
- vega_cli/__init__.py +1 -0
- vega_cli/__main__.py +6 -0
- vega_cli/cli.py +247 -0
- vega_cli/config.py +99 -0
- vega_cli/display.py +138 -0
- vega_cli/html.py +540 -0
- vega_cli/interactive.py +220 -0
- vega_cli/player.py +82 -0
- vega_cli/providers/__init__.py +13 -0
- vega_cli/providers/ani_dream.py +1089 -0
- vega_cli/providers/anikoto.py +820 -0
- vega_cli/providers/animesalt.py +649 -0
- vega_cli/providers/animesub.py +1374 -0
- vega_cli/providers/animeworld.py +504 -0
- vega_cli/providers/auto_embed.py +479 -0
- vega_cli/providers/castle.py +497 -0
- vega_cli/providers/cncverse.py +873 -0
- vega_cli/providers/common/__init__.py +51 -0
- vega_cli/providers/common/aes.py +152 -0
- vega_cli/providers/common/aniskip.py +186 -0
- vega_cli/providers/common/base_url.py +102 -0
- vega_cli/providers/common/cinemeta.py +231 -0
- vega_cli/providers/common/errors.py +25 -0
- vega_cli/providers/common/extractors/__init__.py +23 -0
- vega_cli/providers/common/extractors/abbasy.py +247 -0
- vega_cli/providers/common/extractors/buzzheavier.py +72 -0
- vega_cli/providers/common/extractors/cinejoy.py +33 -0
- vega_cli/providers/common/extractors/gdflix.py +170 -0
- vega_cli/providers/common/extractors/gofile.py +167 -0
- vega_cli/providers/common/extractors/hubcloud.py +277 -0
- vega_cli/providers/common/extractors/movy.py +349 -0
- vega_cli/providers/common/extractors/st111477.py +139 -0
- vega_cli/providers/common/extractors/transferit.py +53 -0
- vega_cli/providers/common/extractors/vegadrive.py +161 -0
- vega_cli/providers/common/extractors/vidstuck.py +379 -0
- vega_cli/providers/common/extractors/zcloud.py +158 -0
- vega_cli/providers/common/extractors/zypter.py +72 -0
- vega_cli/providers/common/headers.py +25 -0
- vega_cli/providers/common/http.py +121 -0
- vega_cli/providers/common/net_mirror.py +1494 -0
- vega_cli/providers/common/theintrodb.py +112 -0
- vega_cli/providers/common/unpack.py +54 -0
- vega_cli/providers/disney_mirror.py +31 -0
- vega_cli/providers/dramacool.py +297 -0
- vega_cli/providers/drive.py +695 -0
- vega_cli/providers/durbin_live.py +354 -0
- vega_cli/providers/eon_movies.py +752 -0
- vega_cli/providers/extraflix.py +701 -0
- vega_cli/providers/four_khdhub.py +307 -0
- vega_cli/providers/goku_hd.py +336 -0
- vega_cli/providers/hdhub4u.py +665 -0
- vega_cli/providers/internet_archive.py +552 -0
- vega_cli/providers/kartoons.py +642 -0
- vega_cli/providers/kartoons2.py +395 -0
- vega_cli/providers/katmovies.py +816 -0
- vega_cli/providers/kick_ass_anime.py +445 -0
- vega_cli/providers/kiss_kh.py +490 -0
- vega_cli/providers/live_tg_tv.py +540 -0
- vega_cli/providers/lux_movies.py +650 -0
- vega_cli/providers/mod.py +676 -0
- vega_cli/providers/movie_box_web.py +921 -0
- vega_cli/providers/movielinkdb.py +734 -0
- vega_cli/providers/movies4u.py +580 -0
- vega_cli/providers/moviezwap.py +199 -0
- vega_cli/providers/mxplayer.py +470 -0
- vega_cli/providers/netflix_mirror.py +32 -0
- vega_cli/providers/one_cinevood.py +596 -0
- vega_cli/providers/prime_mirror.py +31 -0
- vega_cli/providers/rareanimes.py +676 -0
- vega_cli/providers/registry.py +124 -0
- vega_cli/providers/showbox.py +245 -0
- vega_cli/providers/topmovies.py +707 -0
- vega_cli/providers/torrentio.py +398 -0
- vega_cli/providers/uhd.py +483 -0
- vega_cli/providers/vega.py +891 -0
- vega_cli/providers/youtube.py +566 -0
- vega_cli/providers/zeefliz.py +563 -0
- vega_cli/store.py +45 -0
- vega_cli/utils.py +90 -0
- vega_cli-0.1.0.dist-info/METADATA +8 -0
- vega_cli-0.1.0.dist-info/RECORD +84 -0
- vega_cli-0.1.0.dist-info/WHEEL +5 -0
- vega_cli-0.1.0.dist-info/entry_points.txt +2 -0
- vega_cli-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"""Pure-Python provider discovery and factory registry for all Vega providers."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import importlib
|
|
6
|
+
from typing import Any
|
|
7
|
+
|
|
8
|
+
from ..store import KVStore
|
|
9
|
+
|
|
10
|
+
PROVIDER_MANIFEST: list[dict[str, Any]] = [
|
|
11
|
+
{"value": "vega", "display_name": "VMovies", "type": "global", "disabled": False, "version": "2.52"},
|
|
12
|
+
{"value": "autoEmbed", "display_name": "MultiStream", "type": "global", "disabled": False, "version": "3.12"},
|
|
13
|
+
{"value": "drive", "display_name": "MoviesDrive", "type": "global", "disabled": False, "version": "2.30"},
|
|
14
|
+
{"value": "4khdhub", "display_name": "4khdHub", "type": "global", "disabled": False, "version": "2.21"},
|
|
15
|
+
{"value": "1cinevood", "display_name": "Cinewood", "type": "global", "disabled": False, "version": "1.38"},
|
|
16
|
+
{"value": "katmovies", "display_name": "KatMoviesHd", "type": "global", "disabled": False, "version": "1.39"},
|
|
17
|
+
{"value": "mod", "display_name": "MoviesMod", "type": "global", "disabled": False, "version": "2.14"},
|
|
18
|
+
{"value": "uhd", "display_name": "UHDMovies", "type": "global", "disabled": False, "version": "2.2"},
|
|
19
|
+
{"value": "movieBoxWeb", "display_name": "MovieBox Web", "type": "global", "disabled": False, "version": "2.10"},
|
|
20
|
+
{"value": "gokuHD", "display_name": "GokuHD", "type": "global", "disabled": False, "version": "1.7"},
|
|
21
|
+
{"value": "dramacool", "display_name": "DramaCool", "type": "global", "disabled": False, "version": "1.4"},
|
|
22
|
+
{"value": "eonMovies", "display_name": "EonMovies", "type": "global", "disabled": False, "version": "1.18"},
|
|
23
|
+
{"value": "movies4u", "display_name": "Movies4U", "type": "global", "disabled": False, "version": "1.32"},
|
|
24
|
+
{"value": "zeefliz", "display_name": "Zeefliz", "type": "global", "disabled": False, "version": "1.40"},
|
|
25
|
+
{"value": "netflixMirror", "display_name": "NetflixMirror", "type": "global", "disabled": False, "version": "2.11"},
|
|
26
|
+
{"value": "primeMirror", "display_name": "PrimeMirror", "type": "global", "disabled": False, "version": "2.10"},
|
|
27
|
+
{"value": "disneyMirror", "display_name": "DisneyMirror", "type": "global", "disabled": False, "version": "2.2"},
|
|
28
|
+
{"value": "hdhub4u", "display_name": "HdHub4u", "type": "global", "disabled": False, "version": "2.30"},
|
|
29
|
+
{"value": "moviezwap", "display_name": "MoviezWap", "type": "india", "disabled": False, "version": "1.4"},
|
|
30
|
+
{"value": "showbox", "display_name": "ShowBox", "type": "english", "disabled": False, "version": "1.8"},
|
|
31
|
+
{"value": "kissKh", "display_name": "KissKh", "type": "english", "disabled": False, "version": "1.5"},
|
|
32
|
+
{"value": "luxMovies", "display_name": "RogMovies", "type": "india", "disabled": False, "version": "2.37"},
|
|
33
|
+
{"value": "topmovies", "display_name": "TopMovies", "type": "india", "disabled": False, "version": "1.18"},
|
|
34
|
+
{"value": "torrentio", "display_name": "Torrentio", "type": "global", "disabled": False, "version": "1.21"},
|
|
35
|
+
{"value": "anikoto", "display_name": "Anikoto", "type": "anime", "disabled": False, "version": "2.3"},
|
|
36
|
+
{"value": "kickAssAnime", "display_name": "KickAssAnime", "type": "anime", "disabled": False, "version": "1.6"},
|
|
37
|
+
{"value": "animesub", "display_name": "AnimeSub+", "type": "anime", "disabled": False, "version": "1.8"},
|
|
38
|
+
{"value": "castle", "display_name": "Castle TV", "type": "global", "disabled": False, "version": "1.2"},
|
|
39
|
+
{"value": "animesalt", "display_name": "AnimeSalt", "type": "anime", "disabled": False, "version": "1.2"},
|
|
40
|
+
{"value": "animeworld", "display_name": "AnimeWorld", "type": "anime", "disabled": False, "version": "1.0"},
|
|
41
|
+
{"value": "movielinkdb", "display_name": "MovieLinkBD", "type": "india", "disabled": False, "version": "1.02"},
|
|
42
|
+
{"value": "mxplayer", "display_name": "MX Player", "type": "india", "disabled": False, "version": "1.3"},
|
|
43
|
+
{"value": "youtube", "display_name": "YouTube", "type": "global", "disabled": False, "version": "1.4"},
|
|
44
|
+
{"value": "kartoons", "display_name": "Kartoons", "type": "anime", "disabled": False, "version": "1.10"},
|
|
45
|
+
{"value": "internetArchive", "display_name": "Internet Archive", "type": "global", "disabled": False, "version": "1.2"},
|
|
46
|
+
{"value": "rareanimes", "display_name": "Rareanimes", "type": "india", "disabled": False, "version": "1.0"},
|
|
47
|
+
{"value": "durbinLive", "display_name": "DurbinLive", "type": "global", "disabled": False, "version": "1.4"},
|
|
48
|
+
{"value": "liveTgTv", "display_name": "LiveTG TV", "type": "global", "disabled": False, "version": "1.6"},
|
|
49
|
+
{"value": "aniDream", "display_name": "AniDream", "type": "anime", "disabled": False, "version": "1.4"},
|
|
50
|
+
{"value": "extraflix", "display_name": "ExtraFlix", "type": "global", "disabled": False, "version": "1.0"},
|
|
51
|
+
{"value": "kartoons2", "display_name": "Kartoons2", "type": "anime", "disabled": False, "version": "1.01"},
|
|
52
|
+
{"value": "cncverse", "display_name": "CNCVerse Bridge", "type": "global", "disabled": False, "version": "1.0"},
|
|
53
|
+
]
|
|
54
|
+
|
|
55
|
+
_PROVIDER_CLASSES: dict[str, tuple[str, str]] = {
|
|
56
|
+
"vega": ("vega_cli.providers.vega", "VegaClient"),
|
|
57
|
+
"autoEmbed": ("vega_cli.providers.auto_embed", "AutoEmbedClient"),
|
|
58
|
+
"drive": ("vega_cli.providers.drive", "DriveClient"),
|
|
59
|
+
"4khdhub": ("vega_cli.providers.four_khdhub", "FourKhdhubClient"),
|
|
60
|
+
"1cinevood": ("vega_cli.providers.one_cinevood", "OneCinevoodClient"),
|
|
61
|
+
"katmovies": ("vega_cli.providers.katmovies", "KatmoviesClient"),
|
|
62
|
+
"mod": ("vega_cli.providers.mod", "ModClient"),
|
|
63
|
+
"uhd": ("vega_cli.providers.uhd", "UhdClient"),
|
|
64
|
+
"movieBoxWeb": ("vega_cli.providers.movie_box_web", "MovieBoxWebClient"),
|
|
65
|
+
"gokuHD": ("vega_cli.providers.goku_hd", "GokuHdClient"),
|
|
66
|
+
"dramacool": ("vega_cli.providers.dramacool", "DramacoolClient"),
|
|
67
|
+
"eonMovies": ("vega_cli.providers.eon_movies", "EonMoviesClient"),
|
|
68
|
+
"movies4u": ("vega_cli.providers.movies4u", "Movies4uClient"),
|
|
69
|
+
"zeefliz": ("vega_cli.providers.zeefliz", "ZeeflizClient"),
|
|
70
|
+
"netflixMirror": ("vega_cli.providers.netflix_mirror", "NetflixMirrorClient"),
|
|
71
|
+
"primeMirror": ("vega_cli.providers.prime_mirror", "PrimeMirrorClient"),
|
|
72
|
+
"disneyMirror": ("vega_cli.providers.disney_mirror", "DisneyMirrorClient"),
|
|
73
|
+
"hdhub4u": ("vega_cli.providers.hdhub4u", "Hdhub4uClient"),
|
|
74
|
+
"moviezwap": ("vega_cli.providers.moviezwap", "MoviezwapClient"),
|
|
75
|
+
"showbox": ("vega_cli.providers.showbox", "ShowboxClient"),
|
|
76
|
+
"kissKh": ("vega_cli.providers.kiss_kh", "KissKhClient"),
|
|
77
|
+
"luxMovies": ("vega_cli.providers.lux_movies", "LuxMoviesClient"),
|
|
78
|
+
"topmovies": ("vega_cli.providers.topmovies", "TopmoviesClient"),
|
|
79
|
+
"torrentio": ("vega_cli.providers.torrentio", "TorrentioClient"),
|
|
80
|
+
"anikoto": ("vega_cli.providers.anikoto", "AnikotoClient"),
|
|
81
|
+
"kickAssAnime": ("vega_cli.providers.kick_ass_anime", "KickAssAnimeClient"),
|
|
82
|
+
"animesub": ("vega_cli.providers.animesub", "AnimesubClient"),
|
|
83
|
+
"castle": ("vega_cli.providers.castle", "CastleClient"),
|
|
84
|
+
"animesalt": ("vega_cli.providers.animesalt", "AnimesaltClient"),
|
|
85
|
+
"animeworld": ("vega_cli.providers.animeworld", "AnimeworldClient"),
|
|
86
|
+
"movielinkdb": ("vega_cli.providers.movielinkdb", "MovielinkdbClient"),
|
|
87
|
+
"mxplayer": ("vega_cli.providers.mxplayer", "MxplayerClient"),
|
|
88
|
+
"youtube": ("vega_cli.providers.youtube", "YoutubeClient"),
|
|
89
|
+
"kartoons": ("vega_cli.providers.kartoons", "KartoonsClient"),
|
|
90
|
+
"internetArchive": ("vega_cli.providers.internet_archive", "InternetArchiveClient"),
|
|
91
|
+
"rareanimes": ("vega_cli.providers.rareanimes", "RareanimesClient"),
|
|
92
|
+
"durbinLive": ("vega_cli.providers.durbin_live", "DurbinLiveClient"),
|
|
93
|
+
"liveTgTv": ("vega_cli.providers.live_tg_tv", "LiveTgTvClient"),
|
|
94
|
+
"aniDream": ("vega_cli.providers.ani_dream", "AniDreamClient"),
|
|
95
|
+
"extraflix": ("vega_cli.providers.extraflix", "ExtraflixClient"),
|
|
96
|
+
"kartoons2": ("vega_cli.providers.kartoons2", "Kartoons2Client"),
|
|
97
|
+
"cncverse": ("vega_cli.providers.cncverse", "CncverseClient"),
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
def load_manifest() -> list[dict[str, Any]]:
|
|
102
|
+
"""Return embedded provider metadata entries."""
|
|
103
|
+
return [dict(entry) for entry in PROVIDER_MANIFEST]
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
def list_providers(include_disabled: bool = False) -> list[dict[str, Any]]:
|
|
107
|
+
"""Return available pure-Python providers."""
|
|
108
|
+
entries = load_manifest()
|
|
109
|
+
if include_disabled:
|
|
110
|
+
return entries
|
|
111
|
+
return [entry for entry in entries if not entry.get("disabled", False)]
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
def get_provider(name: str, kv: KVStore | None = None) -> Any:
|
|
115
|
+
"""Instantiate a pure-Python provider client by name."""
|
|
116
|
+
target = _PROVIDER_CLASSES.get(name)
|
|
117
|
+
if not target:
|
|
118
|
+
raise ValueError(
|
|
119
|
+
f"Unknown provider '{name}'. Run 'cli.py providers' to see available providers."
|
|
120
|
+
)
|
|
121
|
+
mod_path, cls_name = target
|
|
122
|
+
mod = importlib.import_module(mod_path)
|
|
123
|
+
cls = getattr(mod, cls_name)
|
|
124
|
+
return cls(kv=kv)
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
"""Pure-Python ShowBox (FebBox) provider."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import re
|
|
6
|
+
from typing import Any
|
|
7
|
+
from urllib.parse import quote, urljoin, urlparse
|
|
8
|
+
|
|
9
|
+
from ..html import parse_html
|
|
10
|
+
from .common import BaseProvider, get_base_url, throw_provider_error
|
|
11
|
+
|
|
12
|
+
_DEFAULT_BASE_URL = "https://www.showbox.media"
|
|
13
|
+
_FEBBOX_UA = (
|
|
14
|
+
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) "
|
|
15
|
+
"AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36"
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def _format_episode_name(title: str) -> str:
|
|
20
|
+
m = re.search(r"[sS](\d+)\s*[eE](\d+)", title)
|
|
21
|
+
if m:
|
|
22
|
+
return f"Season{m.group(1).zfill(2)} Episode{m.group(2).zfill(2)}"
|
|
23
|
+
return title
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class ShowboxClient(BaseProvider):
|
|
27
|
+
"""Provider client for ShowBox."""
|
|
28
|
+
|
|
29
|
+
name = "showbox"
|
|
30
|
+
catalog = [
|
|
31
|
+
{"title": "Home", "filter": ""},
|
|
32
|
+
{"title": "Movies", "filter": "/movie"},
|
|
33
|
+
{"title": "TV Shows", "filter": "/tv"},
|
|
34
|
+
]
|
|
35
|
+
genres: list[dict[str, str]] = []
|
|
36
|
+
settings_schema = [
|
|
37
|
+
{
|
|
38
|
+
"key": "febboxCookie",
|
|
39
|
+
"type": "text",
|
|
40
|
+
"label": "FebBox Cookie (ui/session)",
|
|
41
|
+
"placeholder": "ui=...; or full cookie string",
|
|
42
|
+
"defaultValue": "",
|
|
43
|
+
"description": (
|
|
44
|
+
"Optional: Your personal FebBox login cookie to stream directly "
|
|
45
|
+
"if the public worker session is expired."
|
|
46
|
+
),
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
|
|
50
|
+
def _base_url(self) -> str:
|
|
51
|
+
return (get_base_url("showbox") or _DEFAULT_BASE_URL).rstrip("/")
|
|
52
|
+
|
|
53
|
+
def _fetch_posts(self, url: str, base_url: str) -> list[dict[str, str]]:
|
|
54
|
+
last_err: Exception | None = None
|
|
55
|
+
for _ in range(3):
|
|
56
|
+
try:
|
|
57
|
+
doc = self.fetch_html(url)
|
|
58
|
+
posts: list[dict[str, str]] = []
|
|
59
|
+
for el in doc.select(".movie-item, .flw-item"):
|
|
60
|
+
name_node = el.select_one(".film-name")
|
|
61
|
+
a = el.select_one("a")
|
|
62
|
+
img = el.select_one("img")
|
|
63
|
+
title = name_node.text().strip() if name_node else ""
|
|
64
|
+
href = a.attr("href") if a else ""
|
|
65
|
+
image = img.attr("src") if img else ""
|
|
66
|
+
if title and href and image:
|
|
67
|
+
parsed = urlparse(urljoin(f"{base_url}/", href))
|
|
68
|
+
rel = parsed.path
|
|
69
|
+
if parsed.query:
|
|
70
|
+
rel += f"?{parsed.query}"
|
|
71
|
+
if parsed.fragment:
|
|
72
|
+
rel += f"#{parsed.fragment}"
|
|
73
|
+
posts.append({"title": title, "link": rel, "image": image})
|
|
74
|
+
return posts
|
|
75
|
+
except Exception as err:
|
|
76
|
+
last_err = err
|
|
77
|
+
assert last_err is not None
|
|
78
|
+
raise last_err
|
|
79
|
+
|
|
80
|
+
def get_posts(self, filter_path: str = "", page: int = 1) -> list[dict[str, str]]:
|
|
81
|
+
base_url = self._base_url()
|
|
82
|
+
url = f"{base_url}{filter_path}?page={page}/"
|
|
83
|
+
return self._fetch_posts(url, base_url)
|
|
84
|
+
|
|
85
|
+
def get_search_posts(self, query: str, page: int = 1) -> list[dict[str, str]]:
|
|
86
|
+
base_url = self._base_url()
|
|
87
|
+
url = f"{base_url}/search?keyword={quote(query)}&page={page}"
|
|
88
|
+
return self._fetch_posts(url, base_url)
|
|
89
|
+
|
|
90
|
+
def get_meta(self, link: str) -> dict[str, Any]:
|
|
91
|
+
try:
|
|
92
|
+
base_url_showbox = self._base_url()
|
|
93
|
+
url = urljoin(f"{base_url_showbox}/", link)
|
|
94
|
+
doc = self.fetch_html(url)
|
|
95
|
+
media_type = "series" if "tv" in url else "movie"
|
|
96
|
+
|
|
97
|
+
heading = doc.select_one(".heading-name")
|
|
98
|
+
title = heading.text() if heading else ""
|
|
99
|
+
imdb_btn = doc.select_one(".btn-imdb")
|
|
100
|
+
rating_m = re.search(r"\d+(?:\.\d+)?", imdb_btn.text()) if imdb_btn else None
|
|
101
|
+
rating = rating_m.group(0) if rating_m else ""
|
|
102
|
+
|
|
103
|
+
cover = doc.select_one(".cover_follow")
|
|
104
|
+
style = cover.attr("style") if cover else ""
|
|
105
|
+
img_m = re.search(r"url\(([^)]+)\)", style)
|
|
106
|
+
image = img_m.group(1) if img_m else ""
|
|
107
|
+
|
|
108
|
+
desc = doc.select_one(".description")
|
|
109
|
+
synopsis = re.sub(r"[\n\t]", "", desc.text()).strip() if desc else ""
|
|
110
|
+
|
|
111
|
+
feb_a = heading.select_one("a") if heading else None
|
|
112
|
+
feb_id = (feb_a.attr("href").split("/")[-1] if feb_a and feb_a.attr("href") else "")
|
|
113
|
+
parsed = urlparse(url)
|
|
114
|
+
origin = f"{parsed.scheme}://{parsed.netloc}"
|
|
115
|
+
index_url = f"{origin}/index/share_link?id={feb_id}&type={'1' if media_type == 'movie' else '2'}"
|
|
116
|
+
index_data = self.fetch_json(index_url)
|
|
117
|
+
feb_key = index_data["data"]["link"].split("/")[-1]
|
|
118
|
+
|
|
119
|
+
feb_link = f"https://www.febbox.com/file/file_share_list?share_key={feb_key}&is_html=0"
|
|
120
|
+
feb_data = self.fetch_json(feb_link)
|
|
121
|
+
file_list = (feb_data.get("data") or {}).get("file_list") or []
|
|
122
|
+
|
|
123
|
+
links: list[dict[str, Any]] = []
|
|
124
|
+
for f in file_list:
|
|
125
|
+
file_name = f"{f.get('file_name', '')} ({f.get('file_size', '')})"
|
|
126
|
+
file_id = f.get("fid")
|
|
127
|
+
links.append(
|
|
128
|
+
{
|
|
129
|
+
"title": file_name,
|
|
130
|
+
"episodesLink": f"{feb_key}&{file_id}" if f.get("is_dir") else f"{feb_key}&",
|
|
131
|
+
}
|
|
132
|
+
)
|
|
133
|
+
|
|
134
|
+
return {
|
|
135
|
+
"title": title,
|
|
136
|
+
"rating": rating,
|
|
137
|
+
"synopsis": synopsis,
|
|
138
|
+
"image": image,
|
|
139
|
+
"imdbId": "",
|
|
140
|
+
"type": media_type,
|
|
141
|
+
"linkList": links,
|
|
142
|
+
"webUrl": url,
|
|
143
|
+
}
|
|
144
|
+
except Exception as err:
|
|
145
|
+
throw_provider_error("ShowBox", "metadata", err)
|
|
146
|
+
return {}
|
|
147
|
+
|
|
148
|
+
def get_episodes(
|
|
149
|
+
self,
|
|
150
|
+
url: str,
|
|
151
|
+
imdb_id: str = "",
|
|
152
|
+
season: int | None = None,
|
|
153
|
+
) -> list[dict[str, Any]]:
|
|
154
|
+
try:
|
|
155
|
+
parts = url.split("&", 1)
|
|
156
|
+
file_id = parts[0]
|
|
157
|
+
febbox_id = parts[1] if len(parts) > 1 else ""
|
|
158
|
+
if febbox_id:
|
|
159
|
+
feb_link = f"https://www.febbox.com/file/file_share_list?share_key={file_id}&pwd=&parent_id={febbox_id}&is_html=0"
|
|
160
|
+
else:
|
|
161
|
+
feb_link = f"https://www.febbox.com/file/file_share_list?share_key={file_id}&pwd=&is_html=0"
|
|
162
|
+
data = self.fetch_json(feb_link)
|
|
163
|
+
file_list = (data.get("data") or {}).get("file_list") or []
|
|
164
|
+
episodes: list[dict[str, Any]] = []
|
|
165
|
+
for f in file_list:
|
|
166
|
+
file_name = _format_episode_name(f.get("file_name") or "")
|
|
167
|
+
ep_id = f.get("fid")
|
|
168
|
+
if not f.get("is_dir") and file_name and ep_id:
|
|
169
|
+
episodes.append({"title": file_name, "link": f"{file_id}&{ep_id}"})
|
|
170
|
+
return episodes
|
|
171
|
+
except Exception as err:
|
|
172
|
+
throw_provider_error("ShowBox", "episodes", err)
|
|
173
|
+
return []
|
|
174
|
+
|
|
175
|
+
def get_stream(
|
|
176
|
+
self,
|
|
177
|
+
url: str,
|
|
178
|
+
is_download: bool = False,
|
|
179
|
+
media_type: str = "movie",
|
|
180
|
+
) -> list[dict[str, Any]]:
|
|
181
|
+
try:
|
|
182
|
+
parts = url.split("&", 1)
|
|
183
|
+
ep_id = parts[1] if len(parts) > 1 else ""
|
|
184
|
+
if not ep_id:
|
|
185
|
+
return []
|
|
186
|
+
|
|
187
|
+
html = ""
|
|
188
|
+
febbox_cookie = self.kv.get("febboxCookie")
|
|
189
|
+
if febbox_cookie:
|
|
190
|
+
try:
|
|
191
|
+
feb_data = self.fetch_json(
|
|
192
|
+
f"https://www.febbox.com/console/video_quality_list?fid={ep_id}",
|
|
193
|
+
headers={
|
|
194
|
+
"Cookie": febbox_cookie,
|
|
195
|
+
"User-Agent": _FEBBOX_UA,
|
|
196
|
+
"X-Requested-With": "XMLHttpRequest",
|
|
197
|
+
"Referer": "https://www.febbox.com/",
|
|
198
|
+
},
|
|
199
|
+
)
|
|
200
|
+
if isinstance(feb_data, dict) and isinstance(feb_data.get("html"), str):
|
|
201
|
+
html = feb_data["html"]
|
|
202
|
+
elif isinstance(feb_data, dict) and (
|
|
203
|
+
feb_data.get("code") == -1
|
|
204
|
+
or feb_data.get("login_required")
|
|
205
|
+
or "login" in str(feb_data.get("msg", "")).lower()
|
|
206
|
+
):
|
|
207
|
+
raise RuntimeError("Please set cookies in ShowBox provider settings")
|
|
208
|
+
except RuntimeError as e:
|
|
209
|
+
if "ShowBox provider settings" in str(e):
|
|
210
|
+
raise
|
|
211
|
+
except Exception:
|
|
212
|
+
pass
|
|
213
|
+
|
|
214
|
+
if not html:
|
|
215
|
+
data = self.fetch_json(f"https://feb.8man.workers.dev/?fid={ep_id}")
|
|
216
|
+
if isinstance(data, dict) and isinstance(data.get("html"), str):
|
|
217
|
+
html = data["html"]
|
|
218
|
+
elif isinstance(data, dict) and (
|
|
219
|
+
data.get("code") == -1
|
|
220
|
+
or data.get("login_required")
|
|
221
|
+
or "login" in str(data.get("msg", "")).lower()
|
|
222
|
+
):
|
|
223
|
+
raise RuntimeError("Please set cookies in ShowBox provider settings")
|
|
224
|
+
|
|
225
|
+
if not html:
|
|
226
|
+
return []
|
|
227
|
+
|
|
228
|
+
doc = parse_html(html)
|
|
229
|
+
streams: list[dict[str, Any]] = []
|
|
230
|
+
for el in doc.select(".file_quality"):
|
|
231
|
+
name_n = el.select_one("p.name")
|
|
232
|
+
size_n = el.select_one("p.size")
|
|
233
|
+
speed_n = el.select_one("p.speed")
|
|
234
|
+
server = (
|
|
235
|
+
f"{name_n.text() if name_n else ''} - "
|
|
236
|
+
f"{size_n.text() if size_n else ''} - "
|
|
237
|
+
f"{speed_n.text() if speed_n else ''}"
|
|
238
|
+
)
|
|
239
|
+
link = el.attr("data-url")
|
|
240
|
+
if link:
|
|
241
|
+
streams.append({"server": server, "type": "mkv", "link": link})
|
|
242
|
+
return streams
|
|
243
|
+
except Exception as err:
|
|
244
|
+
throw_provider_error("ShowBox", "stream", err)
|
|
245
|
+
return []
|