From 1c4936060a15d136d56c34aabe1ec094f1bad132 Mon Sep 17 00:00:00 2001 From: Commandcracker <49335821+Commandcracker@users.noreply.github.com> Date: Thu, 28 Nov 2024 17:47:28 +0100 Subject: [PATCH] Update veo --- pyproject.toml | 18 +++++++++--------- src/gucken/hoster/veo.py | 13 ++++++++++--- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 61a8474..259340f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,17 +7,17 @@ maintainers = [{name="Commandcracker"}] license = {file = "LICENSE.txt"} readme = "README.md" dependencies = [ - "textual>=0.67.0", + "textual==0.67.0", # 0.87.1 "beautifulsoup4>=4.12.3", - "httpx[http2]>=0.27.0", + "httpx[http2]>=0.28.0", "pypresence>=4.3.0", - "packaging>=24.1", - "platformdirs>=4.2.2", + "packaging>=24.2", + "platformdirs>=4.3.6", "toml>=0.10.2", "fuzzywuzzy>=0.18.0", "async_lru>=2.0.4" - #"yt-dlp>=2024.4.9", - #"mpv>=1.0.6", + #"yt-dlp>=2024.11.18", + #"mpv>=1.0.7", ] keywords = [ "gucken", @@ -49,10 +49,10 @@ classifiers = [ [project.optional-dependencies] speedups = [ - "levenshtein>=0.25.1", - "orjson>=3.10.4" + "levenshtein>=0.26.1", + "orjson>=3.10.12" ] -socks = ["httpx[socks]>=0.27.0"] +socks = ["httpx[socks]>=0.28.0"] [project.urls] Repository = "https://github.com/Commandcracker/gucken" diff --git a/src/gucken/hoster/veo.py b/src/gucken/hoster/veo.py index 84afc2c..9d13280 100644 --- a/src/gucken/hoster/veo.py +++ b/src/gucken/hoster/veo.py @@ -4,6 +4,8 @@ from ..networking import AsyncClient from .common import DirectLink, Hoster + +REDIRECT_PATTERN = re_compile("https?://[^\s'\"<>]+") EXTRACT_VEO_HLS_PATTERN = re_compile(r"'hls': '(?P.*)'") @@ -11,6 +13,11 @@ class VOEHoster(Hoster): async def get_direct_link(self) -> DirectLink: async with AsyncClient(verify=False) as client: response = await client.get(self.url) - match = EXTRACT_VEO_HLS_PATTERN.search(response.text) - link = match.group("hls") - return DirectLink(b64decode(link).decode()) + match = REDIRECT_PATTERN.search(response.text) + link = match.group() + + response2 = await client.get(link) + match2 = EXTRACT_VEO_HLS_PATTERN.search(response2.text) + link2 = match2.group("hls") + + return DirectLink(b64decode(link2).decode())