微博视频解析

解析微博视频,获取视频下载链接和详细信息

API 文档

  • 接口地址: https://api.makuo.cc/api/get.video.weibo
  • 返回格式: JSON
  • 请求方式: GET
  • 请求示例: https://api.makuo.cc/api/get.video.weibo?url=https://video.weibo.com/show?fid=1034:5201778053152960

请求参数说明:

名称 必填 类型 说明
token string 登录获取token
url string 视频地址

返回参数说明:

名称 类型 说明
code integer 返回的状态码
data object 返回的数据/数据对象
msg string 返回的消息
time string 请求时间
data.titlestring标题
data.authorstring作者
data.author_idnumber作者ID
data.author_avatarstring作者头像
data.urls.[]string视频地址
data.coverstring封面图
data.timenumber发布时间
data.durationstring时长

返回示例:

{
  "code": 200,
  "msg": "视频解析成功",
  "time": "2025-09-20 11:56:23",
  "api_source": "API官网:api.makuo.CC",
  "data": {
    "title": "内娱日记的微博视频",
    "author": "内娱日记",
    "author_id": 5862006754,
    "author_avatar": "//tvax3.sinaimg.cn/small/006oInK2ly1i4950p1937j30u00u0n0g.jpg?KID=imgbed,tva&Expires=1758351383&ssig=GkFEP39Gb0",
    "urls": {
      "高清 1080P": "//f.video.weibocdn.com/o0/oCb5ePkGlx08qLhfUXqM01041201BiWT0E010.mp4?label=mp4_1080p&template=1440x1080.25.0&media_id=5201778053152960&tp=8x8A3El:YTkl0eM8&us=0&ori=1&bf=4&ot=h&ps=3lckmu&uid=6KchQJ&ab=,15568-g4,8012-g2,8013-g0,3601-g41,3601-g36,3601-g36,3601-g27,3601-g38&Expires=1758344183&ssig=6WPHXS8Kel&KID=unistore,video",
      "高清 720P": "//f.video.weibocdn.com/o0/fI6TFGIDlx08qLhekLkk01041200WWh70E010.mp4?label=mp4_720p&template=960x720.25.0&media_id=5201778053152960&tp=8x8A3El:YTkl0eM8&us=0&ori=1&bf=4&ot=h&ps=3lckmu&uid=6KchQJ&ab=,15568-g4,8012-g2,8013-g0,3601-g41,3601-g36,3601-g36,3601-g27,3601-g38&Expires=1758344183&ssig=qf2MDsq%2BHA&KID=unistore,video",
      "标清 480P": "//f.video.weibocdn.com/o0/Dd6C3z4xlx08qLhcChoA01041200wto80E010.mp4?label=mp4_hd&template=640x480.25.0&media_id=5201778053152960&tp=8x8A3El:YTkl0eM8&us=0&ori=1&bf=4&ot=h&ps=3lckmu&uid=6KchQJ&ab=,15568-g4,8012-g2,8013-g0,3601-g41,3601-g36,3601-g36,3601-g27,3601-g38&Expires=1758344183&ssig=VGjnu8I4bE&KID=unistore,video"
    },
    "cover": "//wx2.sinaimg.cn/orj480/006oInK2ly1i4kh33n7qtj31400u0dht.jpg",
    "time": 1755683995,
    "duration": "2:17"
  }
}

错误码格式说明:

名称 类型 说明
200 string 返回状态码(成功)
500 string 返回的状态码(失败)

代码示例:


<?php
// 初始化cURL会话
$ch = curl_init();
// 设置请求URL,用户中心获取token,自行替换其他参数
curl_setopt($ch, CURLOPT_URL, "https://api.makuo.cc/api/get.video.weibo?url=https://video.weibo.com/show?fid=1034:5201778053152960");
// 设置请求头
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Authorization: YOUR_TOKEN'
));
// 返回响应而不是直接输出
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// 执行请求并获取响应
$response = curl_exec($ch);
// 关闭cURL会话
curl_close($ch);
// 将响应解析为JSON格式
$data = json_decode($response, true);
// 输出JSON数据
print_r($data);
?>
            

import requests

# 设置请求URL和头部,用户中心获取token,自行替换其他参数
url = "https://api.makuo.cc/api/get.video.weibo?url=https://video.weibo.com/show?fid=1034:5201778053152960"
headers = {
    'Authorization': 'YOUR_TOKEN'
}

# 发送GET请求
response = requests.get(url, headers=headers)
# 将响应解析为JSON格式
data = response.json()
# 输出JSON数据
print(data)
            

// 发送GET请求,用户中心获取token,自行替换其他参数
fetch("https://api.makuo.cc/api/get.video.weibo?url=https://video.weibo.com/show?fid=1034:5201778053152960", {
    method: "GET",
    headers: {
        "Authorization": "YOUR_TOKEN"
    }
})
.then(response => response.json()) // 将响应解析为JSON格式
.then(data => console.log(data)) // 输出JSON数据
.catch(error => console.error('Error:', error));
            

import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;

public class Main {
    public static void main(String[] args) throws Exception {
        // 创建URL对象,用户中心获取token,自行替换其他参数
        URL url = new URL("https://api.makuo.cc/api/get.video.weibo?url=https://video.weibo.com/show?fid=1034:5201778053152960");
        // 打开连接
        HttpURLConnection conn = (HttpURLConnection) url.openConnection();
        // 设置请求方法
        conn.setRequestMethod("GET");
        // 设置请求头
        conn.setRequestProperty("Authorization", "YOUR_TOKEN");

        // 读取响应
        BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
        String inputLine;
        StringBuffer content = new StringBuffer();
        while ((inputLine = in.readLine()) != null) {
            content.append(inputLine);
        }
        in.close();
        // 输出JSON数据
        System.out.println(content.toString());
    }
}
            

using System;
using System.Net.Http;
using System.Threading.Tasks;

class Program {
    static async Task Main() {
        using (HttpClient client = new HttpClient()) {
            // 设置请求头
            client.DefaultRequestHeaders.Add("Authorization", "YOUR_TOKEN");
            // 发送GET请求,用户中心获取token,自行替换其他参数
            HttpResponseMessage response = await client.GetAsync("https://api.makuo.cc/api/get.video.weibo?url=https://video.weibo.com/show?fid=1034:5201778053152960");
            // 将响应解析为字符串
            string responseBody = await response.Content.ReadAsStringAsync();
            // 输出JSON数据
            Console.WriteLine(responseBody);
        }
    }
}
            

require 'net/http'
require 'uri'

# 创建URI对象,用户中心获取token,自行替换其他参数
uri = URI.parse("https://api.makuo.cc/api/get.video.weibo?url=https://video.weibo.com/show?fid=1034:5201778053152960")
# 创建GET请求
request = Net::HTTP::Get.new(uri)
# 设置请求头
request["Authorization"] = "YOUR_TOKEN"

# 发送请求并获取响应
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end

# 输出JSON数据
puts response.body
            

package main

import (
    "fmt"
    "io/ioutil"
    "net/http"
)

func main() {
    client := &http.Client{}
    // 创建GET请求,用户中心获取token,自行替换其他参数
    req, err := http.NewRequest("GET", "https://api.makuo.cc/api/get.video.weibo?url=https://video.weibo.com/show?fid=1034:5201778053152960", nil)
    if err != nil {
        panic(err)
    }
    // 设置请求头
    req.Header.Add("Authorization", "YOUR_TOKEN")

    // 发送请求并获取响应
    resp, err := client.Do(req)
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()

    // 读取响应体
    body, err := ioutil.ReadAll(resp.Body)
    if err != nil {
        panic(err)
    }
    // 输出JSON数据
    fmt.Println(string(body))
}