Skip to content

Commit b56fa28

Browse files
chore: android player fix
1 parent 9278f1f commit b56fa28

3 files changed

Lines changed: 12 additions & 9 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.6"
1+
__core__ = "1.8.1.7"

flix_cli/core/utils/__player__.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,22 @@ def play(file: str, name: str, referer: str, subtitles: list[str]) -> None:
3434

3535
try:
3636
if check_android():
37-
safe_file = urllib.parse.quote(file)
38-
safe_subs = urllib.parse.quote(','.join(subtitles))
37+
print("~ Android Detected ~")
3938

40-
vlc_url = f"vlc-x-callback://x-callback-url/stream?url={safe_file}&sub={safe_subs}"
41-
42-
subprocess.run([
39+
args = [
4340
"am",
4441
"start",
42+
"--user",
43+
"0"
4544
"-a",
4645
"android.intent.action.VIEW",
4746
"-d",
48-
f"{vlc_url}"
49-
], check=True, capture_output=True)
47+
f"{file}",
48+
"-n", "org.videolan.vlc/org.videolan.vlc.gui.video.VideoPlayerActivity",
49+
"-e", "title", f"Playing {name}"
50+
]
51+
args.extend(f"-e subtitles_location {_}" for _ in subtitles)
52+
subprocess.run(args, check=True, capture_output=True)
5053

5154
print(f"~ Opened in VLC ~")
5255

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.6"
7+
version = "1.8.1.7"
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)