Pyckplayer 1.0.9__tar.gz → 1.0.10__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.9/src/Pyckplayer.egg-info → pyckplayer-1.0.10}/PKG-INFO +1 -1
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/setup.py +1 -1
- {pyckplayer-1.0.9 → pyckplayer-1.0.10/src/Pyckplayer.egg-info}/PKG-INFO +1 -1
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/src/pyckplayer/core.py +6 -37
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/LICENSE +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/MANIFEST.in +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/README.md +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/pyproject.toml +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/setup.cfg +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/src/Pyckplayer.egg-info/SOURCES.txt +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/src/Pyckplayer.egg-info/dependency_links.txt +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/src/Pyckplayer.egg-info/entry_points.txt +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/src/Pyckplayer.egg-info/requires.txt +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/src/Pyckplayer.egg-info/top_level.txt +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/src/pyckplayer/__init__.py +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/src/pyckplayer/ckplayer/LICENSE +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/src/pyckplayer/ckplayer/css/ckplayer.css +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/src/pyckplayer/ckplayer/css/ckplayer.ixigua.css +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/src/pyckplayer/ckplayer/css/ckplayer.red.css +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/src/pyckplayer/ckplayer/css/images/adclose.png +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/src/pyckplayer/ckplayer/css/images/buffer.png +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/src/pyckplayer/ckplayer/css/images/ckplayer.48.png +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/src/pyckplayer/ckplayer/css/images/ckplayer.png +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/src/pyckplayer/ckplayer/css/images/ckplayer_ixigua.48.png +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/src/pyckplayer/ckplayer/css/images/ckplayer_ixigua.png +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/src/pyckplayer/ckplayer/css/images/ckplayer_red.48.png +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/src/pyckplayer/ckplayer/css/images/ckplayer_red.png +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/src/pyckplayer/ckplayer/css/images/favicon.ico +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/src/pyckplayer/ckplayer/css/images/loading.png +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/src/pyckplayer/ckplayer/css/images/logo.png +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/src/pyckplayer/ckplayer/css/images/play.png +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/src/pyckplayer/ckplayer/flv.js/LICENSE +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/src/pyckplayer/ckplayer/flv.js/README.md +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/src/pyckplayer/ckplayer/flv.js/flv.js +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/src/pyckplayer/ckplayer/flv.js/flv.js.map +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/src/pyckplayer/ckplayer/flv.js/flv.min.js +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/src/pyckplayer/ckplayer/flv.js/flv.min.js.map +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/src/pyckplayer/ckplayer/hls.js/LICENSE +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/src/pyckplayer/ckplayer/hls.js/README.md +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/src/pyckplayer/ckplayer/hls.js/hls-demo.js +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/src/pyckplayer/ckplayer/hls.js/hls-demo.js.map +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/src/pyckplayer/ckplayer/hls.js/hls.js +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/src/pyckplayer/ckplayer/hls.js/hls.js.d.ts +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/src/pyckplayer/ckplayer/hls.js/hls.js.map +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/src/pyckplayer/ckplayer/hls.js/hls.light.js +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/src/pyckplayer/ckplayer/hls.js/hls.light.js.map +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/src/pyckplayer/ckplayer/hls.js/hls.light.min.js +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/src/pyckplayer/ckplayer/hls.js/hls.light.min.js.map +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/src/pyckplayer/ckplayer/hls.js/hls.min.js +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/src/pyckplayer/ckplayer/hls.js/hls.min.js.map +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/src/pyckplayer/ckplayer/js/ckplayer.js +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/src/pyckplayer/ckplayer/js/ckplayer.min.js +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/src/pyckplayer/ckplayer/language/en.js +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/src/pyckplayer/ckplayer/language/zh.cn.js +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/src/pyckplayer/ckplayer/language/zh.hk.js +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/src/pyckplayer/ckplayer/mpegts.js/LICENSE +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/src/pyckplayer/ckplayer/mpegts.js/mpegts.js +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/src/pyckplayer/ckplayer/mpegts.js/mpegts.js.map +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/src/pyckplayer/ckplayer/mpegts.js/mpegts.min.js +0 -0
- {pyckplayer-1.0.9 → pyckplayer-1.0.10}/src/pyckplayer/cli.py +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import os
|
|
2
|
+
import sys
|
|
2
3
|
import time
|
|
3
4
|
import subprocess
|
|
4
5
|
import requests
|
|
@@ -76,7 +77,7 @@ def download_cover(poster_url: Optional[str], silent: bool = True) -> Optional[s
|
|
|
76
77
|
if not poster_url:
|
|
77
78
|
return None
|
|
78
79
|
|
|
79
|
-
cover_path = Path(__file__).parent.parent / "cover_image.jpg"
|
|
80
|
+
cover_path = Path(__file__).parent.parent.parent / "cover_image.jpg"
|
|
80
81
|
|
|
81
82
|
try:
|
|
82
83
|
response = requests.get(
|
|
@@ -115,23 +116,6 @@ def get_content_type(url: str) -> Optional[str]:
|
|
|
115
116
|
return None
|
|
116
117
|
|
|
117
118
|
|
|
118
|
-
def is_streaming_content(content_type: str) -> bool:
|
|
119
|
-
streaming_content_types = [
|
|
120
|
-
'application/vnd.apple.mpegurl',
|
|
121
|
-
'application/dash+xml',
|
|
122
|
-
'audio/mpegurl',
|
|
123
|
-
'video/mp4',
|
|
124
|
-
'video/flv',
|
|
125
|
-
'video/quicktime',
|
|
126
|
-
'application/x-mpegURL',
|
|
127
|
-
'application/octet-stream'
|
|
128
|
-
]
|
|
129
|
-
if content_type:
|
|
130
|
-
content_type_lower = content_type.lower()
|
|
131
|
-
return any(ct in content_type_lower for ct in streaming_content_types)
|
|
132
|
-
return False
|
|
133
|
-
|
|
134
|
-
|
|
135
119
|
def get_video_info(video_url: str) -> Optional[Dict[str, Any]]:
|
|
136
120
|
if cv2 is None:
|
|
137
121
|
return None
|
|
@@ -169,27 +153,12 @@ def get_video_info(video_url: str) -> Optional[Dict[str, Any]]:
|
|
|
169
153
|
|
|
170
154
|
|
|
171
155
|
def is_live_url(url: str) -> bool:
|
|
172
|
-
url_lower = url.lower()
|
|
173
|
-
live_keywords = [
|
|
174
|
-
'/live/', '/stream/', '/broadcast/', '/live-stream/',
|
|
175
|
-
'live.', 'stream.', 'live_', 'stream_',
|
|
176
|
-
'?live', '&live', '=live',
|
|
177
|
-
'douyincdn.com', 'live.kuaishou.com', 'live.bilibili.com',
|
|
178
|
-
'live.douyin.com', 'live.qq.com', 'live.weibo.com'
|
|
179
|
-
]
|
|
180
|
-
if any(keyword in url_lower for keyword in live_keywords):
|
|
181
|
-
return True
|
|
182
|
-
|
|
183
156
|
video_info = get_video_info(url)
|
|
184
157
|
if video_info is not None:
|
|
185
158
|
duration = video_info.get("duration", 0)
|
|
186
159
|
if duration < 0:
|
|
187
160
|
return True
|
|
188
161
|
|
|
189
|
-
content_type = get_content_type(url)
|
|
190
|
-
if content_type:
|
|
191
|
-
return is_streaming_content(content_type)
|
|
192
|
-
|
|
193
162
|
return False
|
|
194
163
|
|
|
195
164
|
|
|
@@ -200,7 +169,7 @@ def detect_stream_type(url: str) -> str:
|
|
|
200
169
|
return 'hls'
|
|
201
170
|
elif '.flv' in url_lower:
|
|
202
171
|
return 'flv'
|
|
203
|
-
|
|
172
|
+
if '.ts' in url_lower:
|
|
204
173
|
return 'ts'
|
|
205
174
|
elif '.mp4' in url_lower:
|
|
206
175
|
return 'mp4'
|
|
@@ -301,7 +270,7 @@ def generate_html(video_url: str,
|
|
|
301
270
|
|
|
302
271
|
|
|
303
272
|
def cleanup_temp_files(temp_files: list) -> None:
|
|
304
|
-
time.sleep(
|
|
273
|
+
time.sleep(20)
|
|
305
274
|
for file_path in temp_files:
|
|
306
275
|
try:
|
|
307
276
|
if file_path.exists():
|
|
@@ -332,13 +301,13 @@ def play_video(url: str,
|
|
|
332
301
|
local_poster_uri = download_cover(poster_url, silent=True)
|
|
333
302
|
html_content = generate_html(url, poster_url=local_poster_uri, title=title)
|
|
334
303
|
|
|
335
|
-
temp_html_path = Path(__file__).parent.parent / "temp_player.html"
|
|
304
|
+
temp_html_path = Path(__file__).parent.parent.parent / "temp_player.html"
|
|
336
305
|
with open(temp_html_path, "w", encoding="utf-8") as f:
|
|
337
306
|
f.write(html_content)
|
|
338
307
|
|
|
339
308
|
temp_files = [
|
|
340
309
|
temp_html_path,
|
|
341
|
-
Path(__file__).parent.parent / "cover_image.jpg"
|
|
310
|
+
Path(__file__).parent.parent.parent / "cover_image.jpg"
|
|
342
311
|
]
|
|
343
312
|
atexit.register(cleanup_temp_files, temp_files)
|
|
344
313
|
|
|
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.9 → pyckplayer-1.0.10}/src/pyckplayer/ckplayer/css/images/ckplayer_ixigua.48.png
RENAMED
|
File without changes
|
{pyckplayer-1.0.9 → pyckplayer-1.0.10}/src/pyckplayer/ckplayer/css/images/ckplayer_ixigua.png
RENAMED
|
File without changes
|
{pyckplayer-1.0.9 → pyckplayer-1.0.10}/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
|