Pyckplayer 1.0.0__tar.gz → 1.0.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyckplayer-1.0.0/src/Pyckplayer.egg-info → pyckplayer-1.0.2}/PKG-INFO +1 -1
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/setup.py +1 -1
- {pyckplayer-1.0.0 → pyckplayer-1.0.2/src/Pyckplayer.egg-info}/PKG-INFO +1 -1
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/pyckplayer/core.py +12 -22
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/LICENSE +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/MANIFEST.in +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/README.md +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/pyproject.toml +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/setup.cfg +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/Pyckplayer.egg-info/SOURCES.txt +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/Pyckplayer.egg-info/dependency_links.txt +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/Pyckplayer.egg-info/entry_points.txt +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/Pyckplayer.egg-info/requires.txt +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/Pyckplayer.egg-info/top_level.txt +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/pyckplayer/__init__.py +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/pyckplayer/ckplayer/LICENSE +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/pyckplayer/ckplayer/css/ckplayer.css +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/pyckplayer/ckplayer/css/ckplayer.ixigua.css +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/pyckplayer/ckplayer/css/ckplayer.red.css +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/pyckplayer/ckplayer/css/images/adclose.png +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/pyckplayer/ckplayer/css/images/buffer.png +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/pyckplayer/ckplayer/css/images/ckplayer.48.png +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/pyckplayer/ckplayer/css/images/ckplayer.png +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/pyckplayer/ckplayer/css/images/ckplayer_ixigua.48.png +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/pyckplayer/ckplayer/css/images/ckplayer_ixigua.png +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/pyckplayer/ckplayer/css/images/ckplayer_red.48.png +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/pyckplayer/ckplayer/css/images/ckplayer_red.png +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/pyckplayer/ckplayer/css/images/favicon.ico +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/pyckplayer/ckplayer/css/images/loading.png +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/pyckplayer/ckplayer/css/images/logo.png +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/pyckplayer/ckplayer/css/images/play.png +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/pyckplayer/ckplayer/flv.js/LICENSE +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/pyckplayer/ckplayer/flv.js/README.md +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/pyckplayer/ckplayer/flv.js/flv.js +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/pyckplayer/ckplayer/flv.js/flv.js.map +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/pyckplayer/ckplayer/flv.js/flv.min.js +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/pyckplayer/ckplayer/flv.js/flv.min.js.map +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/pyckplayer/ckplayer/hls.js/LICENSE +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/pyckplayer/ckplayer/hls.js/README.md +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/pyckplayer/ckplayer/hls.js/hls-demo.js +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/pyckplayer/ckplayer/hls.js/hls-demo.js.map +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/pyckplayer/ckplayer/hls.js/hls.js +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/pyckplayer/ckplayer/hls.js/hls.js.d.ts +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/pyckplayer/ckplayer/hls.js/hls.js.map +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/pyckplayer/ckplayer/hls.js/hls.light.js +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/pyckplayer/ckplayer/hls.js/hls.light.js.map +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/pyckplayer/ckplayer/hls.js/hls.light.min.js +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/pyckplayer/ckplayer/hls.js/hls.light.min.js.map +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/pyckplayer/ckplayer/hls.js/hls.min.js +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/pyckplayer/ckplayer/hls.js/hls.min.js.map +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/pyckplayer/ckplayer/js/ckplayer.js +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/pyckplayer/ckplayer/js/ckplayer.min.js +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/pyckplayer/ckplayer/language/en.js +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/pyckplayer/ckplayer/language/zh.cn.js +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/pyckplayer/ckplayer/language/zh.hk.js +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/pyckplayer/ckplayer/mpegts.js/LICENSE +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/pyckplayer/ckplayer/mpegts.js/mpegts.js +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/pyckplayer/ckplayer/mpegts.js/mpegts.js.map +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/pyckplayer/ckplayer/mpegts.js/mpegts.min.js +0 -0
- {pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/pyckplayer/cli.py +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import os
|
|
2
|
+
import time
|
|
2
3
|
import subprocess
|
|
3
4
|
import requests
|
|
4
5
|
import json
|
|
@@ -66,14 +67,13 @@ def calculate_window_size(width: Optional[Union[int, float]] = None,
|
|
|
66
67
|
return int(final_width), int(final_height)
|
|
67
68
|
|
|
68
69
|
|
|
69
|
-
def download_cover(poster_url: Optional[str]) -> Optional[str]:
|
|
70
|
+
def download_cover(poster_url: Optional[str], silent: bool = True) -> Optional[str]:
|
|
70
71
|
if not poster_url:
|
|
71
72
|
return None
|
|
72
73
|
|
|
73
74
|
cover_path = Path(__file__).parent.parent / "cover_image.jpg"
|
|
74
75
|
|
|
75
76
|
try:
|
|
76
|
-
print(f"[*] 正在下载封面图片...")
|
|
77
77
|
response = requests.get(
|
|
78
78
|
poster_url,
|
|
79
79
|
timeout=10,
|
|
@@ -85,14 +85,9 @@ def download_cover(poster_url: Optional[str]) -> Optional[str]:
|
|
|
85
85
|
f.write(response.content)
|
|
86
86
|
|
|
87
87
|
local_cover_uri = quote(cover_path.absolute().as_posix())
|
|
88
|
-
print(f"[+] 封面图片已保存至: {cover_path.absolute()}")
|
|
89
88
|
return f"file:///{local_cover_uri}"
|
|
90
89
|
|
|
91
|
-
except
|
|
92
|
-
print(f"[-] 封面图片下载失败: {e}")
|
|
93
|
-
return None
|
|
94
|
-
except Exception as e:
|
|
95
|
-
print(f"[-] 下载封面图片时发生异常: {e}")
|
|
90
|
+
except Exception:
|
|
96
91
|
return None
|
|
97
92
|
|
|
98
93
|
|
|
@@ -145,13 +140,13 @@ def generate_html(video_url: str,
|
|
|
145
140
|
|
|
146
141
|
|
|
147
142
|
def cleanup_temp_files(temp_files: list) -> None:
|
|
143
|
+
time.sleep(10)
|
|
148
144
|
for file_path in temp_files:
|
|
149
145
|
try:
|
|
150
146
|
if file_path.exists():
|
|
151
147
|
file_path.unlink()
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
print(f"[-] 清理临时文件 {file_path.name} 失败: {e}")
|
|
148
|
+
except Exception:
|
|
149
|
+
pass
|
|
155
150
|
|
|
156
151
|
|
|
157
152
|
def validate_url(url: str) -> bool:
|
|
@@ -172,15 +167,13 @@ def play_video(url: str,
|
|
|
172
167
|
|
|
173
168
|
url = url.strip()
|
|
174
169
|
final_width, final_height = calculate_window_size(width=width, height=height)
|
|
175
|
-
print(f"[*] 计算得到的窗口大小: {final_width}x{final_height}")
|
|
176
170
|
|
|
177
|
-
local_poster_uri = download_cover(poster_url)
|
|
171
|
+
local_poster_uri = download_cover(poster_url, silent=True)
|
|
178
172
|
html_content = generate_html(url, poster_url=local_poster_uri, title=title)
|
|
179
173
|
|
|
180
174
|
temp_html_path = Path(__file__).parent.parent / "temp_player.html"
|
|
181
175
|
with open(temp_html_path, "w", encoding="utf-8") as f:
|
|
182
176
|
f.write(html_content)
|
|
183
|
-
print(f"[+] 成功生成播放页面: {temp_html_path.absolute()}")
|
|
184
177
|
|
|
185
178
|
temp_files = [
|
|
186
179
|
temp_html_path,
|
|
@@ -192,7 +185,6 @@ def play_video(url: str,
|
|
|
192
185
|
edge_path = find_edge_browser() if use_edge else None
|
|
193
186
|
|
|
194
187
|
if edge_path:
|
|
195
|
-
print(f"[+] 正在调用 Edge 浏览器 ({final_width}x{final_height})...")
|
|
196
188
|
try:
|
|
197
189
|
subprocess.Popen([
|
|
198
190
|
edge_path,
|
|
@@ -204,15 +196,13 @@ def play_video(url: str,
|
|
|
204
196
|
"--allow-file-access-from-files",
|
|
205
197
|
], creationflags=subprocess.CREATE_NO_WINDOW)
|
|
206
198
|
return True
|
|
207
|
-
except Exception
|
|
208
|
-
|
|
209
|
-
return False
|
|
199
|
+
except Exception:
|
|
200
|
+
pass
|
|
210
201
|
else:
|
|
211
|
-
print("[-] 未找到 Edge 浏览器,尝试使用系统默认浏览器...")
|
|
212
202
|
import webbrowser
|
|
213
203
|
try:
|
|
214
204
|
webbrowser.open(local_url)
|
|
215
205
|
return True
|
|
216
|
-
except Exception
|
|
217
|
-
|
|
218
|
-
|
|
206
|
+
except Exception:
|
|
207
|
+
pass
|
|
208
|
+
return False
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/pyckplayer/ckplayer/css/images/ckplayer_ixigua.48.png
RENAMED
|
File without changes
|
{pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/pyckplayer/ckplayer/css/images/ckplayer_ixigua.png
RENAMED
|
File without changes
|
{pyckplayer-1.0.0 → pyckplayer-1.0.2}/src/pyckplayer/ckplayer/css/images/ckplayer_red.48.png
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|