返回首页

bilibili解析

浏览: 27793 最后更新: 2024-04-24 10:10:58

接口说明

bilibili解析-1080p

接口基本信息

API地址

https://api-v1.cenguigui.cn/api/bilibili/api.php

请求方式

GET

返回格式

JSON

接口状态

正常启用

参数说明

以下参数为接口所需调用信息

参数 是否必填 类型 说明 示例
urlb站链接

请求示例

HTTP请求

https://api-v1.cenguigui.cn/api/bilibili/api.php?url=https://www.bilibili.com/video/BV1Dt4y1o7bU

调用示例

代码示例

返回结果

HTTP 200 OK
{
    "code": 1,
    "msg": "解析成功!",
    "title": "『新年おめでとう | 2024』你就如同烟花一般,在我心中绽放!",
    "imgurl": "http://i0.hdslb.com/bfs/archive/dff48a68935660a0f6c28f94fd6fce723c119d65.jpg",
    "desc": "「烟花易逝,人情长存」",
    "data": [
        {
            "title": "『新年おめでとう | 2024』你就如同烟花一般,在我心中绽放!",
            "duration": 72,
            "durationFormat": "00:01:11",
            "accept": [
                "流畅 360P"
            ],
            "video_url": "https://upos-sz-mirrorhw.bilivideo.com/upgcxcode/59/58/1387295859/1387295859-1-16.mp4?e=ig8euxZM2rNcNbRVhwdVhwdlhWdVhwdVhoNvNC8BqJIzNbfq9rVEuxTEnE8L5F6VnEsSTx0vkX8fqJeYTj_lta53NCM=&uipk=5&nbs=1&deadline=1712496301&gen=playurlv2&os=alibv&oi=795696819&trid=094f6b638f0842e290646bff9b8419cbh&mid=0&platform=html5&upsig=73145d73d2a629f023150fcd29919a6b&uparams=e,uipk,nbs,deadline,gen,os,oi,trid,mid,platform&bvc=vod&nettype=0&f=h_0_0&bw=50419&logo=80000000"
        }
    ],
    "user": {
        "name": "蕾姆-老婆",
        "user_img": "https://i0.hdslb.com/bfs/face/88aea887a8f382373fe5fb4f5057b48c05982a9c.jpg"
    },
    "text": {
        "msg": "此接口只支持B站视频 包括番剧 电影 电视剧 都不能解析",
        "copyright": "笒鬼鬼"
    }
}

调用示例

// JavaScript调用示例
fetch("https://api-v1.cenguigui.cn/api/bilibili/api.php?url=https://www.bilibili.com/video/BV1Dt4y1o7bU", {
  method: "GET",
  headers: {
    "Content-Type": "application/json"
  }
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error("Error:", error));
# Python调用示例
import requests

url = "https://api-v1.cenguigui.cn/api/bilibili/api.php?url=https://www.bilibili.com/video/BV1Dt4y1o7bU"

response = requests.get(url)

print(response.json())
// Java调用示例
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.time.Duration;

public class ApiExample {
    public static void main(String[] args) throws Exception {
        HttpClient client = HttpClient.newBuilder()
                .version(HttpClient.Version.HTTP_2)
                .connectTimeout(Duration.ofSeconds(10))
                .build();
                
        HttpRequest request = HttpRequest.newBuilder()
                .uri(URI.create("https://api-v1.cenguigui.cn/api/bilibili/api.php?url=https://www.bilibili.com/video/BV1Dt4y1o7bU"))
                .build();
                
        client.sendAsync(request, HttpResponse.BodyHandlers.ofString())
                .thenApply(HttpResponse::body)
                .thenAccept(System.out::println)
                .join();
    }
}
<?php
// PHP调用示例
$url = "https://api-v1.cenguigui.cn/api/bilibili/api.php?url=https://www.bilibili.com/video/BV1Dt4y1o7bU";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

$response = curl_exec($ch);
curl_close($ch);

$result = json_decode($response, true);
print_r($result);
?>
// C#调用示例
using System;
using System.Net.Http;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        using var client = new HttpClient();
        var url = "https://api-v1.cenguigui.cn/api/bilibili/api.php?url=https://www.bilibili.com/video/BV1Dt4y1o7bU";
        
        var response = await client.GetAsync(url);
        
        var result = await response.Content.ReadAsStringAsync();
        Console.WriteLine(result);
    }
}