抖音无水印视频解析
ALAPI 官方文档
根据抖音分享的链接,解析出没有水印的视频
基本说明:
接口地址:https://v1.alapi.cn/api/video/dy
返回格式:json
请求方式:get/post
请求示例:https://v1.alapi.cn/api/video/dy?url=https://h5.pipix.com/s/uW4KXh/
请求参数说明:
名称 类型 必填 说明
url string 必填 抖音视频的分享地址
返回参数说明:
名称 类型 说明
title string 视频标题
video_url string 视频地址
cover_image string 封面图片
JSON返回示例:
{
	"code": 200,
	"msg": "success",
	"data": {
		"status": true,
		"msg": "获取成功",
		"title": "露西高尔夫舞#轻漫计划 @抖音动漫",
		"video_url": [
			"http://v9-dy-z.ixigua.com/de267f24ebb1571009f084143ed6dd14/5d989bc8/video/m/2209c36709d08f346d6b848f341ef203da2116255dc100004e550a0e9e7d/?a=1128&br=1321&cr=0&cs=0&dr=0&ds=6&er=&l=2019100520334401001606613424128A&lr=aweme_self&rc=amhpZWprZGZsbTMzPGkzM0ApZDo2NTY4aTw5NzkzMzkzZ2dqb25xXi40a21fLS0uLS9zcy5eNmE0YzYvLV9iYzMzNWE6Yw%3D%3D",
			"http://7916e63e.tt.x.bsgslb.cn/xdispatch7532417d78344822/v9-dy-z.ixigua.com/de267f24ebb1571009f084143ed6dd14/5d989bc8/video/m/2209c36709d08f346d6b848f341ef203da2116255dc100004e550a0e9e7d/?a=1128&br=1321&cr=0&cs=0&dr=0&ds=6&er=&l=2019100520334401001606613424128A&lr=aweme_self&rc=amhpZWprZGZsbTMzPGkzM0ApZDo2NTY4aTw5NzkzMzkzZ2dqb25xXi40a21fLS0uLS9zcy5eNmE0YzYvLV9iYzMzNWE6Yw%3D%3D&bsxdisp=co"
		],
		"cover_image": "https://p9-dy.byteimg.com/aweme/300x400/17b950012c067520d8587.jpeg"
	},
	"Author": {
		"name": "Alone88",
		"desc": "由Alone88提供的免费API 服务,官方文档:www.alapi.cn"
	}
}
服务级错误码参照
错误码 说明
422 请输入正确的url
完整教学代码示例
<?php

/**
 * Created by PhpStorm.
 * User: FZS
 * Time: 2020/02/01 00:16
 */
class freeApi
{
    private $apiUrl;

    public function __construct()
    {
        $this->apiUrl = 'https://v1.alapi.cn/api/video/dy?url=https://h5.pipix.com/s/uW4KXh/';
    }

    /**
     * 获取结果
     * @return array
     */
    public function getResult()
    {
        return file_get_contents($this->apiUrl);
    }
}
package main

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

const (
	APIURL   = "https://v1.alapi.cn/api/video/dy"
)

func main() {
	queryUrl := fmt.Sprintf("%s?url=https://h5.pipix.com/s/uW4KXh/",APIURL)
	resp, err := http.Get(queryUrl)
	if err != nil {
		log.Println(err)
		return
	}

	defer resp.Body.Close()

	body, err := ioutil.ReadAll(resp.Body)

	if err != nil {
		fmt.Println(err)
		return
	}

	fmt.Println(string(body))
}