Skip to main content
Glama

Short Video MCP Server

by yangbuyiya
MIT License
38
doupai.py1.1 kB
import httpx from ..utils.helpers import get_val_from_url_by_query_key from .base import BaseParser, VideoAuthor, VideoInfo class DouPai(BaseParser): """ 逗拍 """ async def parse_share_url(self, share_url: str) -> VideoInfo: video_id = get_val_from_url_by_query_key(share_url, "id") return await self.parse_video_id(video_id) async def parse_video_id(self, video_id: str) -> VideoInfo: req_url = f"https://v2.doupai.cc/topic/{video_id}.json" async with httpx.AsyncClient() as client: response = await client.get(req_url, headers=self.get_default_headers()) response.raise_for_status() json_data = response.json() data = json_data["data"] video_info = VideoInfo( video_url=data["videoUrl"], cover_url=data["imageUrl"], title=data["name"], author=VideoAuthor( uid=data["userId"]["id"], name=data["userId"]["name"], avatar=data["userId"]["avatar"], ), ) return video_info

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/yangbuyiya/yby6-crawling-short-video-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server