Skip to content

Commit

Permalink
Update veo
Browse files Browse the repository at this point in the history
  • Loading branch information
Commandcracker committed Nov 28, 2024
1 parent d188d29 commit 1c49360
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
18 changes: 9 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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"
Expand Down
13 changes: 10 additions & 3 deletions src/gucken/hoster/veo.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,20 @@
from ..networking import AsyncClient
from .common import DirectLink, Hoster


REDIRECT_PATTERN = re_compile("https?://[^\s'\"<>]+")
EXTRACT_VEO_HLS_PATTERN = re_compile(r"'hls': '(?P<hls>.*)'")


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())

0 comments on commit 1c49360

Please sign in to comment.