广告赞助

php教程

抖音短视频去水印官方API接口源码

我的站长站 2023-10-04 258人阅读 加入收藏

抖音短视频去水印官方API接口源码,非第三方接口,官方接口,效果如下:

抖音短视频去水印官方API接口源码

API源码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<?php
$finalUrl "";
$errorMsg "";
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    $input $_POST['inputField'];
    // 处理用户输入,尝试获取视频ID或链接
    $videoIdOrLink = processUserInput($input);
    if (is_numeric($videoIdOrLink)) {
        // 如果输入是纯数字,则认为它是videoId
        $videoId $videoIdOrLink;
    else if (preg_match('/v\.douyin\.com\/[a-zA-Z0-9]+/'$videoIdOrLink)) {
        // 从链接中提取视频ID
        $videoId = extractVideoId($videoIdOrLink);
    else {
        $errorMsg "输入无法识别";
    }
    if ($videoId) {
        $apiUrl "https://www.iesdouyin.com/web/api/v2/aweme/iteminfo/?reflow_source=reflow_page&item_ids={$videoId}&a_bogus=64745b2b5bdc4e75b720a9a85b19867a";
        $response file_get_contents($apiUrl);
        $data = json_decode($response, true);
        if (!empty($data['item_list'][0]['video']['play_addr']['uri'])) {
            $uri $data['item_list'][0]['video']['play_addr']['uri'];
             
            $desc $data['item_list'][0]['desc'];
             
             
            $finalUrl "www.iesdouyin.com/aweme/v1/play/?video_id={$uri}&ratio=1080p&line=0";
        }
    else if (!$errorMsg) {
        $errorMsg "无法获取视频ID";
    }
}
function processUserInput($input) {
    preg_match('/v\.douyin\.com\/[a-zA-Z0-9]+/'$input$matches);
    if (!empty($matches)) return $matches[0];
    preg_match('/\d{19}/'$input$matches);
    if (!empty($matches)) return $matches[0];
    return null;
}
function extractVideoId($link) {
    $redirectLink = getRedirectUrl($link);
    preg_match('/\/video\/(\d+)\//'$redirectLink$idMatches);
    return !empty($idMatches) ? $idMatches[1] : null;
}
function getRedirectUrl($url) {
    $ch = curl_init($url);
    curl_setopt($ch, CURLOPT_HEADER, true);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    $response = curl_exec($ch);
    preg_match('/^Location: (.+)$/mi'$response$matches);
    return !empty($matches[1]) ? trim($matches[1]) : null;
}
?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>无水印下载</title>
<meta name="keywords" content="程序项目更新地址https://zhiyun66.github.io/htm/index.html"/>
    <link rel="stylesheet" href="https://unpkg.com/bootstrap@4.5.2/dist/css/bootstrap.min.css">
    <!-- toastr CSS -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/css/toastr.min.css">
</head>
<body>
<div class="container mt-5">
    <div class="row justify-content-center">
        <div>
            <div>
                <div class="card-header text-center">
                    输入抖音链接
                </div>
                <div>
                    <form action="" method="post">
                        <div>
                            <label for="inputField">输入信息:</label>
                            <input type="text" id="inputField" name="inputField" placeholder="输入包含抖音链接的文本,或者是视频ID">
                        </div>
                        <div class="form-group text-center">
                            <button type="submit" class="btn btn-primary" id="submit-one">提交</button>
                        </div>
                        <div>
                            <label for="resultLink">视频标题:(双击复制)</label>
                            <input type="text" id="resultdesc" value="<?php echo $desc; ?>" readonly style="width:100%;">
                        </div>
                         
                        <div>
                            <label for="resultLink">无水印链接:(双击复制)</label>
                            <input type="text" id="resultLink" value="<?php echo $finalUrl; ?>" readonly style="width:100%;">
                        </div>
                        <?php if($errorMsg): ?>
                        <div class="alert alert-danger" role="alert">
                            错误: <?php echo $errorMsg; ?>
                        </div>
                        <?php endif; ?>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="https://unpkg.com/jquery@3.5.1/dist/jquery.min.js"></script>
<script src="https://unpkg.com/@popperjs/core@2.9.2/dist/umd/popper.min.js"></script>
<script src="https://unpkg.com/bootstrap@4.5.2/dist/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/js/toastr.min.js"></script>
<script>
$(document).ready(function() {
    // 当用户双击resultLink输入框时,复制其内容
    $("#resultLink").dblclick(function() {
        this.select();
        document.execCommand('copy');
        toastr.options.timeOut = 2000; // 3秒后消失
        toastr.options.positionClass = "toast-top-center"// 设置位置在顶部中间
            // 使用toastr来显示消息
        toastr.success('链接已复制到剪贴板!');
        // alert("链接已复制到剪贴板!");
    });
     
    // 当用户双击resultdesc输入框时,复制其内容
    $("#resultdesc").dblclick(function() {
        this.select();
        document.execCommand('copy');
        toastr.options.timeOut = 2000; // 3秒后消失
        toastr.options.positionClass = "toast-top-center"// 设置位置在顶部中间
            // 使用toastr来显示消息
        toastr.success('标题已复制到剪贴板!');
        // alert("链接已复制到剪贴板!");
    });
     
        // 当用户双击resultdesc输入框时,复制其内容
    $("#submit-one").click(function() {
        // this.select();
        // document.execCommand('copy');
        toastr.options.timeOut = 3000; // 3秒后消失
        toastr.options.positionClass = "toast-top-center"// 设置位置在顶部中间
            // 使用toastr来显示消息
        toastr.success('提交成功');
        // alert("链接已复制到剪贴板!");
    });
     
    // 当表单提交时,清空所有内容
    $("form").submit(function() {
        $("#resultLink").val("");
        $(".alert").hide();
    });
});
</script>
</body>
</html>


    


相关专题
短视频
短视频
2022-06-23 95

短视频是目前最热门的互联网领域了,如果你也在学习短视频,可以看看我的站长站为您整理的分享的短视频专题,包含各类型的短视频源码下载,短视频解析软件,短视频下...

广告赞助
相关推荐
  • 抖音解析
  • 抖音去水印
  • 短视频去水印
  • 抖音去水印解析下载源码,原生解析接口
    抖音去水印解析下载源码,原生解析接口

    源码介绍分享一款抖音去水印解析下载源码,自带PHP原生解析接口,不采用第三方接口,避免接口快速失效和谐的烦恼。支持无水印解析;抖音短视频 ,抖音图集,快手短视频 ,快手图集。源码截图顺带分享下自带的...

    php源码 120 2年前
  • 简单的PHP解析抖音小视频地址方法

    写这个抖音小视频地址解析文章完全是最近不知道写什么,本来想写个头条西瓜视频解析的,写了一半发现头条用js加密了,解析比较麻烦,改天有空了再搞吧。先看看今天的抖音小视频解析源码,源码非常简单,保证一看就会。PHP解析抖音小视频地址方法第一步你需要在...

    php教程 477 4年前
  • PHP抖音解析下载API接口代码

    PHP抖音解析下载API接口代码<?phpfunction GetVideos($url) {$ch = curl_init();curl_setopt($ch, CURLOPT_URL, $url);curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);curl_setopt($ch, CURLOPT_HEADER, false);curl_setopt($ch, CURLOPT_SSL_VER...

    php教程 230 4年前
  • php+api单文件短视频去水印解析网站源码
    php+api单文件短视频去水印解析网站源码

    源码介绍php+api单文件短视频去水印解析网站源码,无需数据库,无需安装,上传即用,不保证解析API接口永久可用,失效自行替换。源码截图...

    php源码 165 3年前
  • 巨人短视频去水印API静态模板
    巨人短视频去水印API静态模板

    模板说明巨人短视频去水印API网页模板,无需环境、数据库,调用的API接口,输入视频地址直接解析播放或下载保存。目前我们支持很多平台,支持:抖音|快手|皮皮虾|西瓜|红书|微视|最右|哔哩哔哩,.皮皮搞笑....

    html模板 183 4年前
  • HTML在线短视频去水印解析下载网页模板
    HTML在线短视频去水印解析下载网页模板

    HTML在线短视频去水印解析下载网页模板,目前支持 抖音/皮皮虾/火山/微视/微博/绿洲/最右/轻视频/instagram/哔哩哔哩/快手/全民小视频/皮皮搞笑/全民k歌等上百个平台!短视频去水印网页模板截图温馨...

    html模板 264 4年前
广告赞助
最新更新
广告赞助