一个基于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.14.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.14.tar.gz.
File metadata
- Download URL: pyckplayer-1.0.14.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 |
88a01f0aa295c2d159d92174b043b124465b2bf4d51b1181858a550b303227e4
|
|
| MD5 |
0762f16ccbadd6ac0562fb24e8e2579a
|
|
| BLAKE2b-256 |
41f9373fcf4e8568c9e497b365fa726b1a779fa4ba49aeee3662e838b9ec4e70
|
File details
Details for the file pyckplayer-1.0.14-py3-none-any.whl.
File metadata
- Download URL: pyckplayer-1.0.14-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 |
802b845ff49f6a7959306bb50975918e769779aca1d05fa7f32de30b6dc670e1
|
|
| MD5 |
cbf76826d72da8705887efa23bcb45ed
|
|
| BLAKE2b-256 |
3d931726b3edfea0c6f6219ec09a387db3e2cc93f685c9df62e235e7b840fae3
|