Pyckplayer 1.0.1__tar.gz → 1.0.3__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.1/src/Pyckplayer.egg-info → pyckplayer-1.0.3}/PKG-INFO +1 -1
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/setup.py +1 -1
- {pyckplayer-1.0.1 → pyckplayer-1.0.3/src/Pyckplayer.egg-info}/PKG-INFO +1 -1
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/src/pyckplayer/core.py +34 -3
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/LICENSE +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/MANIFEST.in +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/README.md +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/pyproject.toml +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/setup.cfg +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/src/Pyckplayer.egg-info/SOURCES.txt +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/src/Pyckplayer.egg-info/dependency_links.txt +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/src/Pyckplayer.egg-info/entry_points.txt +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/src/Pyckplayer.egg-info/requires.txt +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/src/Pyckplayer.egg-info/top_level.txt +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/src/pyckplayer/__init__.py +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/LICENSE +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/css/ckplayer.css +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/css/ckplayer.ixigua.css +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/css/ckplayer.red.css +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/css/images/adclose.png +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/css/images/buffer.png +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/css/images/ckplayer.48.png +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/css/images/ckplayer.png +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/css/images/ckplayer_ixigua.48.png +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/css/images/ckplayer_ixigua.png +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/css/images/ckplayer_red.48.png +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/css/images/ckplayer_red.png +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/css/images/favicon.ico +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/css/images/loading.png +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/css/images/logo.png +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/css/images/play.png +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/flv.js/LICENSE +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/flv.js/README.md +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/flv.js/flv.js +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/flv.js/flv.js.map +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/flv.js/flv.min.js +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/flv.js/flv.min.js.map +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/hls.js/LICENSE +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/hls.js/README.md +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/hls.js/hls-demo.js +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/hls.js/hls-demo.js.map +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/hls.js/hls.js +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/hls.js/hls.js.d.ts +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/hls.js/hls.js.map +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/hls.js/hls.light.js +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/hls.js/hls.light.js.map +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/hls.js/hls.light.min.js +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/hls.js/hls.light.min.js.map +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/hls.js/hls.min.js +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/hls.js/hls.min.js.map +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/js/ckplayer.js +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/js/ckplayer.min.js +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/language/en.js +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/language/zh.cn.js +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/language/zh.hk.js +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/mpegts.js/LICENSE +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/mpegts.js/mpegts.js +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/mpegts.js/mpegts.js.map +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/mpegts.js/mpegts.min.js +0 -0
- {pyckplayer-1.0.1 → pyckplayer-1.0.3}/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
|
|
@@ -90,6 +91,18 @@ def download_cover(poster_url: Optional[str], silent: bool = True) -> Optional[s
|
|
|
90
91
|
return None
|
|
91
92
|
|
|
92
93
|
|
|
94
|
+
def detect_stream_type(url: str) -> str:
|
|
95
|
+
url_lower = url.lower()
|
|
96
|
+
if '.m3u8' in url_lower or '/hls/' in url_lower:
|
|
97
|
+
return 'hls'
|
|
98
|
+
elif '.flv' in url_lower:
|
|
99
|
+
return 'flv'
|
|
100
|
+
elif '.mp4' in url_lower:
|
|
101
|
+
return 'mp4'
|
|
102
|
+
else:
|
|
103
|
+
return 'auto'
|
|
104
|
+
|
|
105
|
+
|
|
93
106
|
def generate_html(video_url: str,
|
|
94
107
|
poster_url: Optional[str] = None,
|
|
95
108
|
title: str = "CKPlayer") -> str:
|
|
@@ -97,15 +110,31 @@ def generate_html(video_url: str,
|
|
|
97
110
|
css_path = quote((script_dir / "ckplayer" / "css" / "ckplayer.css").as_posix())
|
|
98
111
|
js_path = quote((script_dir / "ckplayer" / "js" / "ckplayer.js").as_posix())
|
|
99
112
|
favicon_path = quote((script_dir / "ckplayer" / "css" / "images" / "logo.png").as_posix())
|
|
113
|
+
|
|
114
|
+
hls_js_path = quote((script_dir / "ckplayer" / "hls.js" / "hls.min.js").as_posix())
|
|
115
|
+
flv_js_path = quote((script_dir / "ckplayer" / "flv.js" / "flv.min.js").as_posix())
|
|
100
116
|
|
|
117
|
+
stream_type = detect_stream_type(video_url)
|
|
118
|
+
|
|
101
119
|
video_object = {
|
|
102
120
|
"container": "#player",
|
|
103
121
|
"variable": "player",
|
|
104
122
|
"video": video_url,
|
|
105
|
-
"autoplay":
|
|
106
|
-
"loop":
|
|
123
|
+
"autoplay": True,
|
|
124
|
+
"loop": False,
|
|
125
|
+
"live": stream_type in ['hls', 'flv'],
|
|
126
|
+
"buffer": 1,
|
|
127
|
+
"preload": "auto",
|
|
128
|
+
"playbackRate": [0.5, 0.75, 1, 1.25, 1.5, 2],
|
|
107
129
|
}
|
|
108
130
|
|
|
131
|
+
if stream_type == 'hls':
|
|
132
|
+
video_object["hls"] = True
|
|
133
|
+
video_object["engine"] = "html5"
|
|
134
|
+
elif stream_type == 'flv':
|
|
135
|
+
video_object["flv"] = True
|
|
136
|
+
video_object["engine"] = "html5"
|
|
137
|
+
|
|
109
138
|
if poster_url:
|
|
110
139
|
video_object["poster"] = poster_url
|
|
111
140
|
|
|
@@ -120,6 +149,8 @@ def generate_html(video_url: str,
|
|
|
120
149
|
<link rel="icon" href="file:///{favicon_path}" type="image/png">
|
|
121
150
|
<link rel="shortcut icon" href="file:///{favicon_path}" type="image/png">
|
|
122
151
|
<link rel="stylesheet" href="file:///{css_path}">
|
|
152
|
+
<script src="file:///{hls_js_path}"></script>
|
|
153
|
+
<script src="file:///{flv_js_path}"></script>
|
|
123
154
|
<script src="file:///{js_path}"></script>
|
|
124
155
|
<style>
|
|
125
156
|
body, html {{ margin: 0; padding: 0; background-color: #000; overflow: hidden; }}
|
|
@@ -130,7 +161,7 @@ def generate_html(video_url: str,
|
|
|
130
161
|
<div id="player"></div>
|
|
131
162
|
<script>
|
|
132
163
|
var videoObject = {video_object_js};
|
|
133
|
-
new ckplayer(videoObject);
|
|
164
|
+
var player = new ckplayer(videoObject);
|
|
134
165
|
</script>
|
|
135
166
|
</body>
|
|
136
167
|
</html>"""
|
|
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.1 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/css/images/ckplayer_ixigua.48.png
RENAMED
|
File without changes
|
{pyckplayer-1.0.1 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/css/images/ckplayer_ixigua.png
RENAMED
|
File without changes
|
{pyckplayer-1.0.1 → pyckplayer-1.0.3}/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
|