做视频剪辑或搬运的时候,需要收集抖音、快手、皮皮虾、B站等视频网站的视频素材,需要去水印。
直接调用智编的接口去水印,支持抖音、快手、皮皮虾、B站多个平台。通过接口就可以用程序实现批量获取无水印的视频,也可以对接到自己的平台里面。
https://zhibian.qyt.com/apistore/detail/37
imagePHP语言
<?php
$host = "http://apis.qyt.com"
$path = "videos/get_video_url";
$method = "POST";
$apikey = "你要调用API的apikey";
$headers = array();
array_push($headers, "Authorization:" . $apikey);
//根据API的要求,定义相对应的Content-Type
array_push($headers, "Content-Type".":"."application/x-www-form-urlencoded; charset=UTF-8");
$querys = "";
$bodys = "code_text=视频分享链接";
$url = $host . $path;
$curl = curl_init();
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_FAILONERROR, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HEADER, true);
if (1 == strpos("$".$host, "https://"))
{
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
}
curl_setopt($curl, CURLOPT_POSTFIELDS, $bodys);
var_dump(curl_exec($curl));
python语言
import requests
import demjson
apiUrl = "http://apis.qyt.com/videos/get_video_url"
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36 QIHU 360SE',
'Authorization': '你要调用的api的apiKey'
}
data = {
"code_text":"视频分享链接"
}
res = requests.post(url, data=data, headers=headers)
if res.status_code == 200:
content = res.text
data = demjson.decode(content)
print(data)
通过上面的代码就可以获取无水印视频的下载地址。
网友评论