Pyckplayer 1.0.9__tar.gz → 1.0.12__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.
Files changed (60) hide show
  1. {pyckplayer-1.0.9/src/Pyckplayer.egg-info → pyckplayer-1.0.12}/PKG-INFO +1 -1
  2. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/setup.py +1 -1
  3. {pyckplayer-1.0.9 → pyckplayer-1.0.12/src/Pyckplayer.egg-info}/PKG-INFO +1 -1
  4. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/src/pyckplayer/core.py +10 -39
  5. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/LICENSE +0 -0
  6. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/MANIFEST.in +0 -0
  7. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/README.md +0 -0
  8. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/pyproject.toml +0 -0
  9. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/setup.cfg +0 -0
  10. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/src/Pyckplayer.egg-info/SOURCES.txt +0 -0
  11. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/src/Pyckplayer.egg-info/dependency_links.txt +0 -0
  12. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/src/Pyckplayer.egg-info/entry_points.txt +0 -0
  13. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/src/Pyckplayer.egg-info/requires.txt +0 -0
  14. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/src/Pyckplayer.egg-info/top_level.txt +0 -0
  15. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/src/pyckplayer/__init__.py +0 -0
  16. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/src/pyckplayer/ckplayer/LICENSE +0 -0
  17. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/src/pyckplayer/ckplayer/css/ckplayer.css +0 -0
  18. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/src/pyckplayer/ckplayer/css/ckplayer.ixigua.css +0 -0
  19. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/src/pyckplayer/ckplayer/css/ckplayer.red.css +0 -0
  20. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/src/pyckplayer/ckplayer/css/images/adclose.png +0 -0
  21. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/src/pyckplayer/ckplayer/css/images/buffer.png +0 -0
  22. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/src/pyckplayer/ckplayer/css/images/ckplayer.48.png +0 -0
  23. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/src/pyckplayer/ckplayer/css/images/ckplayer.png +0 -0
  24. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/src/pyckplayer/ckplayer/css/images/ckplayer_ixigua.48.png +0 -0
  25. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/src/pyckplayer/ckplayer/css/images/ckplayer_ixigua.png +0 -0
  26. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/src/pyckplayer/ckplayer/css/images/ckplayer_red.48.png +0 -0
  27. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/src/pyckplayer/ckplayer/css/images/ckplayer_red.png +0 -0
  28. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/src/pyckplayer/ckplayer/css/images/favicon.ico +0 -0
  29. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/src/pyckplayer/ckplayer/css/images/loading.png +0 -0
  30. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/src/pyckplayer/ckplayer/css/images/logo.png +0 -0
  31. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/src/pyckplayer/ckplayer/css/images/play.png +0 -0
  32. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/src/pyckplayer/ckplayer/flv.js/LICENSE +0 -0
  33. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/src/pyckplayer/ckplayer/flv.js/README.md +0 -0
  34. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/src/pyckplayer/ckplayer/flv.js/flv.js +0 -0
  35. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/src/pyckplayer/ckplayer/flv.js/flv.js.map +0 -0
  36. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/src/pyckplayer/ckplayer/flv.js/flv.min.js +0 -0
  37. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/src/pyckplayer/ckplayer/flv.js/flv.min.js.map +0 -0
  38. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/src/pyckplayer/ckplayer/hls.js/LICENSE +0 -0
  39. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/src/pyckplayer/ckplayer/hls.js/README.md +0 -0
  40. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/src/pyckplayer/ckplayer/hls.js/hls-demo.js +0 -0
  41. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/src/pyckplayer/ckplayer/hls.js/hls-demo.js.map +0 -0
  42. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/src/pyckplayer/ckplayer/hls.js/hls.js +0 -0
  43. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/src/pyckplayer/ckplayer/hls.js/hls.js.d.ts +0 -0
  44. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/src/pyckplayer/ckplayer/hls.js/hls.js.map +0 -0
  45. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/src/pyckplayer/ckplayer/hls.js/hls.light.js +0 -0
  46. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/src/pyckplayer/ckplayer/hls.js/hls.light.js.map +0 -0
  47. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/src/pyckplayer/ckplayer/hls.js/hls.light.min.js +0 -0
  48. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/src/pyckplayer/ckplayer/hls.js/hls.light.min.js.map +0 -0
  49. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/src/pyckplayer/ckplayer/hls.js/hls.min.js +0 -0
  50. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/src/pyckplayer/ckplayer/hls.js/hls.min.js.map +0 -0
  51. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/src/pyckplayer/ckplayer/js/ckplayer.js +0 -0
  52. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/src/pyckplayer/ckplayer/js/ckplayer.min.js +0 -0
  53. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/src/pyckplayer/ckplayer/language/en.js +0 -0
  54. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/src/pyckplayer/ckplayer/language/zh.cn.js +0 -0
  55. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/src/pyckplayer/ckplayer/language/zh.hk.js +0 -0
  56. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/src/pyckplayer/ckplayer/mpegts.js/LICENSE +0 -0
  57. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/src/pyckplayer/ckplayer/mpegts.js/mpegts.js +0 -0
  58. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/src/pyckplayer/ckplayer/mpegts.js/mpegts.js.map +0 -0
  59. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/src/pyckplayer/ckplayer/mpegts.js/mpegts.min.js +0 -0
  60. {pyckplayer-1.0.9 → pyckplayer-1.0.12}/src/pyckplayer/cli.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Pyckplayer
3
- Version: 1.0.9
3
+ Version: 1.0.12
4
4
  Summary: 一个基于CKPlayer的Python视频播放器包装器
5
5
  Home-page: https://github.com/yourusername/pyckplayer
6
6
  Author: lenvy1
@@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
5
5
 
6
6
  setuptools.setup(
7
7
  name="Pyckplayer",
8
- version="1.0.9",
8
+ version="1.0.12",
9
9
  author="lenvy1",
10
10
  author_email="lenvy1@163.com",
11
11
  description="一个基于CKPlayer的Python视频播放器包装器",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Pyckplayer
3
- Version: 1.0.9
3
+ Version: 1.0.12
4
4
  Summary: 一个基于CKPlayer的Python视频播放器包装器
5
5
  Home-page: https://github.com/yourusername/pyckplayer
6
6
  Author: lenvy1
@@ -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
 
@@ -198,7 +167,7 @@ def detect_stream_type(url: str) -> str:
198
167
 
199
168
  if '.m3u8' in url_lower or '/hls/' in url_lower:
200
169
  return 'hls'
201
- elif '.flv' in url_lower:
170
+ elif '.flv' in url_lower or 'flv?' in url_lower:
202
171
  return 'flv'
203
172
  elif '.ts' in url_lower:
204
173
  return 'ts'
@@ -219,7 +188,7 @@ def detect_stream_type(url: str) -> str:
219
188
  elif 'dash' in content_type_lower:
220
189
  return 'dash'
221
190
 
222
- return 'auto'
191
+ return 'flv'
223
192
 
224
193
 
225
194
  def generate_html(video_url: str,
@@ -240,6 +209,7 @@ def generate_html(video_url: str,
240
209
  "autoplay": True,
241
210
  "loop": False,
242
211
  "preload": "auto",
212
+ "crossOrigin": "anonymous",
243
213
  }
244
214
 
245
215
  if stream_type == 'hls':
@@ -278,6 +248,7 @@ def generate_html(video_url: str,
278
248
  <head>
279
249
  <meta charset="UTF-8">
280
250
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
251
+ <meta name="referrer" content="no-referrer">
281
252
  <title>{title}</title>
282
253
  <link rel="icon" href="file:///{favicon_path}" type="image/png">
283
254
  <link rel="shortcut icon" href="file:///{favicon_path}" type="image/png">
@@ -301,7 +272,7 @@ def generate_html(video_url: str,
301
272
 
302
273
 
303
274
  def cleanup_temp_files(temp_files: list) -> None:
304
- time.sleep(10)
275
+ time.sleep(20)
305
276
  for file_path in temp_files:
306
277
  try:
307
278
  if file_path.exists():
@@ -332,13 +303,13 @@ def play_video(url: str,
332
303
  local_poster_uri = download_cover(poster_url, silent=True)
333
304
  html_content = generate_html(url, poster_url=local_poster_uri, title=title)
334
305
 
335
- temp_html_path = Path(__file__).parent.parent / "temp_player.html"
306
+ temp_html_path = Path(__file__).parent.parent.parent / "temp_player.html"
336
307
  with open(temp_html_path, "w", encoding="utf-8") as f:
337
308
  f.write(html_content)
338
309
 
339
310
  temp_files = [
340
311
  temp_html_path,
341
- Path(__file__).parent.parent / "cover_image.jpg"
312
+ Path(__file__).parent.parent.parent / "cover_image.jpg"
342
313
  ]
343
314
  atexit.register(cleanup_temp_files, temp_files)
344
315
 
@@ -366,4 +337,4 @@ def play_video(url: str,
366
337
  return True
367
338
  except Exception:
368
339
  pass
369
- return False
340
+ return False
File without changes
File without changes
File without changes
File without changes
File without changes