您好,登錄后才能下訂單哦!
這里說的解析獲取無水印視頻是通過調用第三方接口的方式實現的,具體的代碼如下:
以PHP代碼為例:
<?php //www.videoparse.cn后臺生成的appid $appId = ''; //www.videoparse.cn生成的appsecret $appSecret = ''; //需要解析的url $url = ''; $param = [ 'appid' => $appId, 'appsecret' => $appSecret, 'url' => $url, ]; //得到請求的地址:https://api-sv.videoparse.cn/api/video/normalParse?appid=2m3Ju99MPXrNtkgH&appsecret=bNG3JYjT83qp4cib&url=http%3A%2F%2Fv.douyin.com%2Fa2X5ab%2F $apiUrl = 'https://api-sv.videoparse.cn/api/video/normalParse?'.http_build_query($param); $videoInfo = file_get_contents($apiUrl); print_r($videoInfo);
Python代碼實例如下:
#!/usr/bin/env python
# encoding: utf-8 import requests, urllib, json appId = "" appSecret = "" url = "" params = { "appId": appId, "appSecret": appSecret, "url": url } api_url = "https://api-sv.videoparse.cn/api/video/normalParse" def get(url): ''' :param url: :return: ''' msg = {"code": 0, "msg": "", "body": ""} url = url + "?" + urllib.parse.urlencode(params) response = requests.get(url=url, timeout=30) if response.status_code != 200: msg['code'] = 1 msg["msg"] = "請求出現問題" return msg # result = json.loads(response.text) 如果你直接拿到系統中使用請將返回參數直接轉為json result = response.text # 如果你不需要轉換json,則直接接受數據并返回 return result def post(url, data): ''' :param url: :param data: :param headers: :return: ''' msg = {"code": 0, "msg": "", "body": ""} response = requests.post(url=url, data=data, timeout=30) if response.status_code != 200: msg['code'] = 1 msg["msg"] = "請求出現問題" return msg #result = json.loads(response.text) 如果你直接拿到系統中使用請將返回參數直接轉為json result = response.text # 如果你不需要轉換json,則直接接受數據并返回 return result
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。