Skip to content

Commit 580e0f9

Browse files
chore: android subtitle test
1 parent a623040 commit 580e0f9

3 files changed

Lines changed: 16 additions & 4 deletions

File tree

flix_cli/core/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__core__ = "1.8.1.10"
1+
__core__ = "1.8.1.11"

flix_cli/core/utils/__player__.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import platform as plt
22
import subprocess
3-
import urllib.parse
3+
import os
44

55
import httpx
66

@@ -48,7 +48,19 @@ def play(file: str, name: str, referer: str, subtitles: list[str]) -> None:
4848
"-n", "org.videolan.vlc/org.videolan.vlc.gui.video.VideoPlayerActivity",
4949
"-e", "title", f"Playing {name}"
5050
]
51-
args.extend(["--es", "subtitles_location", f"{subtitles[0]}"])
51+
52+
sub = subtitles[0]
53+
resp = client.get(sub)
54+
55+
path = "/data/data/com.termux/files/flix-cli"
56+
57+
if not path.exists():
58+
path.mkdir(parent=True, exists_ok=True)
59+
60+
with open(f"{path}/{name}.srt", "wb") as f:
61+
f.write(resp.content)
62+
63+
args.extend(["--es", "subtitles_location", f"content://com.termux.fileprovider/root/{path}/{name}.srt"])
5264
subprocess.run(args, check=True, capture_output=True)
5365

5466
print(f"~ Opened in VLC ~")

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "flix-cli"
7-
version = "1.8.1.10"
7+
version = "1.8.1.11"
88
description = "A high efficient, powerful and fast movie scraper."
99
authors = [{name = "DemonKingSwarn", email = "rockingswarn@gmail.com"}]
1010
license = {text = "GPLv3"}

0 commit comments

Comments
 (0)