一个基于CKPlayer的Python视频播放器包装器
Project description
Pyckplayer
一个基于 CKPlayer 的 Python 视频播放器包装器,支持在 Windows 系统上使用 Edge 浏览器或系统默认浏览器播放网络视频。
功能特点
- 🎬 支持多种视频格式:mp4, flv, m3u8, ts 等
- 📱 支持移动端和 PC 端
- 🔗 支持点播、直播、直播+回放
- 🎨 提供封面图支持
- ⚡ 自动计算窗口大小,保持视频比例
- 🧹 自动清理临时文件
安装方法
pip install Pyckplayer
使用方法
命令行方式
# 基本用法
pyckplayer <视频URL>
# 指定视频尺寸
pyckplayer <视频URL> -w 720 -h 1280
# 添加封面图
pyckplayer <视频URL> -p <封面图URL>
# 指定播放器标题
pyckplayer <视频URL> -t "我的视频"
# 使用系统默认浏览器(不使用Edge)
pyckplayer <视频URL> --no-edge
Python API
from pyckplayer import play_video
# 基本用法
play_video("https://example.com/video.mp4")
# 完整参数
play_video(
url="https://example.com/video.mp4",
width=720,
height=1280,
poster_url="https://example.com/cover.jpg",
title="我的视频",
use_edge=True
)
参数说明
| 参数 | 类型 | 说明 |
|---|---|---|
| url | str | 视频URL(必需) |
| width | int/float | 视频宽度(像素) |
| height | int/float | 视频高度(像素) |
| poster_url | str | 封面图URL |
| title | str | 播放器标题,默认为 "CKPlayer" |
| use_edge | bool | 是否使用Edge浏览器,默认为 True |
支持的平台
- Windows 10/11
- Python 3.8+
依赖
- requests >= 2.31.0
开源协议
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyckplayer-1.0.12.tar.gz
(3.3 MB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyckplayer-1.0.12.tar.gz.
File metadata
- Download URL: pyckplayer-1.0.12.tar.gz
- Upload date:
- Size: 3.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ad188e65af1da98956be12206d11071e0688e180a52f4c0a7780daa6bfb14534
|
|
| MD5 |
bcd9304adedc1163f73323cb8b596f4d
|
|
| BLAKE2b-256 |
c2ab52b0e6c94422f3b4614595400b4a09ab039b7cd146fb2e2556549beecc7d
|
File details
Details for the file pyckplayer-1.0.12-py3-none-any.whl.
File metadata
- Download URL: pyckplayer-1.0.12-py3-none-any.whl
- Upload date:
- Size: 3.3 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
687fc6cf23e94e1c4a306f56ad70f8138d0e6cbb9bed546be0d98ca6619c6373
|
|
| MD5 |
7d1eb5f7d771e3c87b232850843c5b68
|
|
| BLAKE2b-256 |
372540e5293f80cd3e1c64b73d0e0618c0687b7cd917cd72a06bf5438b14a794
|