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