mirror of
https://github.com/vinefeeder/TwinVine.git
synced 2026-07-15 18:10:04 +02:00
updates
This commit is contained in:
@@ -136,6 +136,7 @@ def result(service: Service, profile: Optional[str] = None, **_: Any) -> None:
|
||||
result_text = f"[bold text]{result.title}[/]"
|
||||
if result.url:
|
||||
result_text = f"[link={result.url}]{result_text}[/link]"
|
||||
|
||||
if result.label:
|
||||
result_text += f" [pink]{result.label}[/]"
|
||||
if result.description:
|
||||
@@ -143,7 +144,7 @@ def result(service: Service, profile: Optional[str] = None, **_: Any) -> None:
|
||||
result_text += f"\n[bright_black]id: {result.id}[/]"
|
||||
search_results.add(result_text + "\n")
|
||||
|
||||
# update cookies
|
||||
# update cookie
|
||||
cookie_file = dl.get_cookie_path(service_tag, profile)
|
||||
if cookie_file:
|
||||
dl.save_cookies(cookie_file, service.session.cookies)
|
||||
|
||||
@@ -9,6 +9,7 @@ class SearchResult:
|
||||
description: Optional[str] = None,
|
||||
label: Optional[str] = None,
|
||||
url: Optional[str] = None,
|
||||
image: Optional[str] = None
|
||||
):
|
||||
"""
|
||||
A Search Result for any support Title Type.
|
||||
@@ -33,12 +34,15 @@ class SearchResult:
|
||||
raise TypeError(f"Expected label to be a {str}, not {type(label)}")
|
||||
if not isinstance(url, (str, type(None))):
|
||||
raise TypeError(f"Expected url to be a {str}, not {type(url)}")
|
||||
|
||||
if not isinstance(image, (str, type(None))):
|
||||
raise TypeError(f"Expected image to be a {str}, not {type(image)}")
|
||||
|
||||
self.id = id_
|
||||
self.title = title
|
||||
self.description = description
|
||||
self.label = label
|
||||
self.url = url
|
||||
self.image = image
|
||||
|
||||
|
||||
__all__ = ("SearchResult",)
|
||||
|
||||
@@ -22,8 +22,8 @@ class STV(Service):
|
||||
Service code for STV Player streaming service (https://player.stv.tv/).
|
||||
|
||||
\b
|
||||
Version: 1.0.3
|
||||
Author: stabbedbybrick
|
||||
Version: 1.0.4
|
||||
Author: stabbedbybrick; search corrected by Angela
|
||||
Authorization: None
|
||||
Robustness:
|
||||
L3: 1080p
|
||||
@@ -68,6 +68,7 @@ class STV(Service):
|
||||
synopsis = result['attributes']["long_description"]
|
||||
|
||||
label = result["attributes"]["subGenre"]
|
||||
#image = result["attributes"]["images"][0]["_filepath"].split("&w")[0] if result["attributes"]["images"] else None
|
||||
|
||||
yield SearchResult(
|
||||
id_= self.config["endpoints"]["prefix"].strip("/") + result["attributes"]["permalink"],
|
||||
@@ -75,6 +76,7 @@ class STV(Service):
|
||||
description=synopsis,
|
||||
label=label,
|
||||
url=url,
|
||||
#image=image
|
||||
)
|
||||
|
||||
def get_titles(self) -> Union[Movies, Series]:
|
||||
|
||||
@@ -43,10 +43,10 @@ class TPTV(Service):
|
||||
Service code for TPTVencore streaming service (https://www.TPTVencore.co.uk/).
|
||||
|
||||
\b
|
||||
version 1.1.0
|
||||
Date: June 2026
|
||||
version 1.3.0
|
||||
Date: July 2026
|
||||
Author: A_n_g_e_l_a
|
||||
Authorization: email/password for service in envied.yaml
|
||||
Authorization: email/password for service in envied.yaml
|
||||
Robustness:
|
||||
DRM free... with rare exceptions L3
|
||||
|
||||
@@ -190,8 +190,29 @@ class TPTV(Service):
|
||||
self.authorization = tokens
|
||||
|
||||
def search(self) -> Generator[SearchResult, None, None]:
|
||||
print(f"Searching not implemented in Envied for TPTVencore. Please use VineFeeder instead.")
|
||||
return None
|
||||
|
||||
search_term = self.title.replace(" ", "+")
|
||||
response = self.session.get(self.config["endpoints"]["search"].format(query=search_term))
|
||||
response.raise_for_status()
|
||||
results = json.loads(response.content.decode("utf-8"))
|
||||
|
||||
for result in results["data"]:
|
||||
url = result['video']['playback'].replace("api/core/play", "playback")
|
||||
title = result['title']
|
||||
synopsis = result['description'].replace('\n', ' ')
|
||||
label = result["subtype"]
|
||||
id = result["video"]["playback"].replace("api/core/play", "playback")
|
||||
|
||||
|
||||
yield SearchResult(
|
||||
id_= id,
|
||||
title=title,
|
||||
description=synopsis,
|
||||
label=label,
|
||||
url=url,
|
||||
)
|
||||
|
||||
|
||||
|
||||
def get_titles(self) -> Union[Movies, Series]:
|
||||
data = self.get_data(self.title)
|
||||
|
||||
Reference in New Issue
Block a user