release: 0.1.61
This commit is contained in:
@@ -603,15 +603,6 @@ class EinschaltenPlugin(BasisPlugin):
|
||||
url = urljoin(base + "/", path.lstrip("/"))
|
||||
return f"{url}?{urlencode({'query': query})}"
|
||||
|
||||
def _api_movies_url(self, *, with_genres: int, page: int = 1) -> str:
|
||||
base = self._get_base_url()
|
||||
if not base:
|
||||
return ""
|
||||
params: Dict[str, str] = {"withGenres": str(int(with_genres))}
|
||||
if page and int(page) > 1:
|
||||
params["page"] = str(int(page))
|
||||
return urljoin(base + "/", "api/movies") + f"?{urlencode(params)}"
|
||||
|
||||
def _genre_page_url(self, *, genre_id: int, page: int = 1) -> str:
|
||||
"""Genre title pages are rendered server-side and embed the movie list in ng-state.
|
||||
|
||||
@@ -771,23 +762,6 @@ class EinschaltenPlugin(BasisPlugin):
|
||||
except Exception:
|
||||
return []
|
||||
|
||||
def _fetch_new_titles_movies(self) -> List[MovieItem]:
|
||||
# "Neue Filme" lives at `/movies/new` and embeds the list in ng-state (`u: "/api/movies"`).
|
||||
url = self._new_titles_url()
|
||||
if not url:
|
||||
return []
|
||||
try:
|
||||
_, body = self._http_get_text(url, timeout=20)
|
||||
payload = _extract_ng_state_payload(body)
|
||||
movies = _parse_ng_state_movies(payload)
|
||||
_log_debug_line(f"parse_ng_state_movies:count={len(movies)}")
|
||||
if movies:
|
||||
_log_titles(movies, context="new_titles")
|
||||
return movies
|
||||
return []
|
||||
except Exception:
|
||||
return []
|
||||
|
||||
def _fetch_new_titles_movies_page(self, page: int) -> List[MovieItem]:
|
||||
page = max(1, int(page or 1))
|
||||
url = self._new_titles_url()
|
||||
|
||||
@@ -20,7 +20,7 @@ import os
|
||||
import re
|
||||
import json
|
||||
from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional
|
||||
from urllib.parse import urljoin
|
||||
from urllib.parse import urlencode, urljoin
|
||||
|
||||
try: # pragma: no cover - optional dependency
|
||||
import requests
|
||||
@@ -66,12 +66,9 @@ SETTING_LOG_URLS = "log_urls_topstreamfilm"
|
||||
SETTING_DUMP_HTML = "dump_html_topstreamfilm"
|
||||
SETTING_SHOW_URL_INFO = "show_url_info_topstreamfilm"
|
||||
SETTING_LOG_ERRORS = "log_errors_topstreamfilm"
|
||||
SETTING_GENRE_MAX_PAGES = "topstream_genre_max_pages"
|
||||
DEFAULT_TIMEOUT = 20
|
||||
DEFAULT_PREFERRED_HOSTERS = ["supervideo", "dropload", "voe"]
|
||||
MEINECLOUD_HOST = "meinecloud.click"
|
||||
DEFAULT_GENRE_MAX_PAGES = 20
|
||||
HARD_MAX_GENRE_PAGES = 200
|
||||
HEADERS = {
|
||||
"User-Agent": "Mozilla/5.0 (Kodi; ViewIt) AppleWebKit/537.36 (KHTML, like Gecko)",
|
||||
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
|
||||
@@ -347,22 +344,6 @@ class TopstreamfilmPlugin(BasisPlugin):
|
||||
return urljoin(base if base.endswith("/") else base + "/", href)
|
||||
return href
|
||||
|
||||
def _get_setting_bool(self, setting_id: str, *, default: bool = False) -> bool:
|
||||
return get_setting_bool(ADDON_ID, setting_id, default=default)
|
||||
|
||||
def _get_setting_int(self, setting_id: str, *, default: int) -> int:
|
||||
if xbmcaddon is None:
|
||||
return default
|
||||
try:
|
||||
addon = xbmcaddon.Addon(ADDON_ID)
|
||||
getter = getattr(addon, "getSettingInt", None)
|
||||
if callable(getter):
|
||||
return int(getter(setting_id))
|
||||
raw = str(addon.getSetting(setting_id) or "").strip()
|
||||
return int(raw) if raw else default
|
||||
except Exception:
|
||||
return default
|
||||
|
||||
def _notify_url(self, url: str) -> None:
|
||||
notify_url(
|
||||
ADDON_ID,
|
||||
|
||||
Reference in New Issue
Block a user