皮皮搞笑视频解析API
简单、高效、稳定的视频解析接口,帮助开发者轻松获取皮皮搞笑平台的视频资源
API概述
皮皮搞笑视频解析API是一个RESTful接口,允许开发者通过视频URL获取视频的详细信息及播放地址。本API支持GET请求方式,返回JSON格式数据。
GET
https://api.ihuahui.win/api/video/api/pipigx.php
使用此API,您可以:
- 获取视频的标题、描述、封面图等信息
- 解析视频的真实播放地址
- 获取视频的时长、分辨率等元数据
- 支持多种格式的视频解析(MP4、M3U8等)
使用指南
要使用皮皮搞笑视频解析API,您需要按照以下步骤操作:
- 获取皮皮搞笑平台上的视频分享链接
- 通过GET请求调用API,将视频URL作为参数传递
- 解析API返回的JSON数据,获取视频信息
- 使用返回的视频地址进行播放或下载
基本请求示例
GET https://api.ihuahui.win/api/video/api/pipigx.php?url=https://www.pipigx.com/video/123456789
请求参数
API支持以下查询参数:
| 参数 | 是否必需 | 类型 | 说明 |
|---|---|---|---|
| url | 必需 | 字符串 | 皮皮搞笑视频的完整URL地址 |
| format | 可选 | 字符串 | 指定返回的视频格式,支持:mp4, m3u8(默认:mp4) |
| quality | 可选 | 字符串 | 视频质量,支持:ld(流畅), sd(标清), hd(高清), fhd(超清)(默认:hd) |
| type | 可选 | 字符串 | 返回类型,支持:json, redirect(默认:json) |
响应格式
API返回JSON格式的数据,包含以下字段:
| 字段 | 类型 | 说明 |
|---|---|---|
| code | 整数 | 状态码(200表示成功,其他为错误) |
| msg | 字符串 | 状态消息 |
| data | 对象 | 视频数据对象 |
| data.title | 字符串 | 视频标题 |
| data.duration | 整数 | 视频时长(秒) |
| data.cover | 字符串 | 视频封面图URL |
| data.video_url | 字符串 | 视频播放地址 |
| data.width | 整数 | 视频宽度(像素) |
| data.height | 整数 | 视频高度(像素) |
| data.author | 对象 | 作者信息 |
| data.author.name | 字符串 | 作者昵称 |
| data.author.avatar | 字符串 | 作者头像URL |
成功响应示例
{
"code": 200,
"msg": "success",
"data": {
"title": "搞笑猫咪合集,看完不笑算我输!",
"duration": 186,
"cover": "https://img.pipigx.com/cover/123456.jpg",
"video_url": "https://video.pipigx.com/123456.mp4",
"width": 1280,
"height": 720,
"author": {
"name": "搞笑达人",
"avatar": "https://avatar.pipigx.com/123.jpg"
}
}
}
错误响应示例
{
"code": 404,
"msg": "视频不存在或已被删除"
}
代码示例
JavaScript示例
// 使用Fetch API调用皮皮搞笑视频解析API
async function parseVideo(url) {
try {
const apiUrl = `https://api.ihuahui.win/api/video/api/pipigx.php?url=${encodeURIComponent(url)}`;
const response = await fetch(apiUrl);
const data = await response.json();
if (data.code === 200) {
console.log('视频标题:', data.data.title);
console.log('视频地址:', data.data.video_url);
return data.data;
} else {
console.error('解析失败:', data.msg);
return null;
}
} catch (error) {
console.error('请求出错:', error);
return null;
}
}
// 使用示例
const videoUrl = 'https://www.pipigx.com/video/123456789';
parseVideo(videoUrl);
Python示例
import requests
def parse_video(url):
api_url = "https://api.ihuahui.win/api/video/api/pipigx.php"
params = {
"url": url,
"format": "mp4",
"quality": "hd"
}
try:
response = requests.get(api_url, params=params)
data = response.json()
if data.get("code") == 200:
print("视频标题:", data["data"]["title"])
print("视频地址:", data["data"]["video_url"])
return data["data"]
else:
print("解析失败:", data.get("msg", "未知错误"))
return None
except Exception as e:
print("请求出错:", str(e))
return None
# 使用示例
video_url = "https://www.pipigx.com/video/123456789"
video_data = parse_video(video_url)
API测试工具
您可以在下方直接测试API的功能:
{/* 响应结果将显示在这里 */}