查看: 425|回复: 3

[网站源码] 抖音去水印PHP源码 非第三方接口

[复制链接]
累计签到:253 天
连续签到:1 天

1864

主题

-179

回帖

1万

积分

域主

名望
0
星币
3510
星辰
6
好评
72

鼎力支持奖欢乐天使奖灌水天才奖幸运猪我是土豪在线大神

发表于 2023-10-7 13:00:01 | 显示全部楼层 |阅读模式

注册登录后全站资源免费查看下载

您需要 登录 才可以下载或查看,没有账号?立即注册

×


视/频解析接口来自官方抖音视/频接口!非第三方接口!上传PHP环境中即可运行!支持上传二级目录访问!

源码全部开源

支持带有文本的链接和视/频ID或者分享的链接地址

  1. <?php
  2. $finalUrl = "";
  3. $errorMsg = "";

  4. if ($_SERVER["REQUEST_METHOD"] == "POST") {
  5.     $input = $_POST['inputField'];

  6.     // 处理用户输入,尝试获取视/频ID或链接
  7.     $videoIdOrLink = processUserInput($input);
  8.     if (is_numeric($videoIdOrLink)) {
  9.         // 如果输入是纯数字,则认为它是videoId
  10.         $videoId = $videoIdOrLink;
  11.     } else if (preg_match('/v\.douyin\.com\/[a-zA-Z0-9]+/', $videoIdOrLink)) {
  12.         // 从链接中提取视/频ID
  13.         $videoId = extractVideoId($videoIdOrLink);
  14.     } else {
  15.         $errorMsg = "输入无法识别";
  16.     }

  17.     if ($videoId) {
  18.         $apiUrl = "https://www.iesdouyin.com/web/api/v2/aweme/iteminfo/?reflow_source=reflow_page&item_ids={$videoId}&a_bogus=64745b2b5bdc4e75b720a9a85b19867a";
  19.         $response = file_get_contents($apiUrl);
  20.         $data = json_decode($response, true);

  21.         if (!empty($data['item_list'][0]['video']['play_addr']['uri'])) {
  22.             $uri = $data['item_list'][0]['video']['play_addr']['uri'];
  23.             
  24.             $desc = $data['item_list'][0]['desc'];
  25.             
  26.             
  27.             $finalUrl = "www.iesdouyin.com/aweme/v1/play/?video_id={$uri}&ratio=1080p&line=0";
  28.         }
  29.     } else if (!$errorMsg) {
  30.         $errorMsg = "无法获取视/频ID";
  31.     }
  32. }

  33. function processUserInput($input) {
  34.     preg_match('/v\.douyin\.com\/[a-zA-Z0-9]+/', $input, $matches);
  35.     if (!empty($matches)) return $matches[0];

  36.     preg_match('/\d{19}/', $input, $matches);
  37.     if (!empty($matches)) return $matches[0];

  38.     return null;
  39. }

  40. function extractVideoId($link) {
  41.     $redirectLink = getRedirectUrl($link);
  42.     preg_match('/\/video\/(\d+)\//', $redirectLink, $idMatches);
  43.     return !empty($idMatches) ? $idMatches[1] : null;
  44. }

  45. function getRedirectUrl($url) {
  46.     $ch = curl_init($url);
  47.     curl_setopt($ch, CURLOPT_HEADER, true);
  48.     curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
  49.     curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  50.     $response = curl_exec($ch);
  51.     preg_match('/^Location: (.+)$/mi', $response, $matches);
  52.     return !empty($matches[1]) ? trim($matches[1]) : null;
  53. }

  54. ?>
  55. <!DOCTYPE html>
  56. <html lang="zh-CN">
  57. <head>
  58.     <meta charset="UTF-8">
  59.     <meta name="viewport" content="width=device-width, initial-scale=1.0">
  60.     <title>Mzla.cn无水印下载</title>
  61. <meta name="keywords" content="源码分享:https://mzla.cn"/>
  62.     <link rel="stylesheet" href="https://unpkg.com/bootstrap@4.5.2/dist/css/bootstrap.min.css">
  63.     <!-- toastr CSS -->
  64.     <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/css/toastr.min.css">


  65. </head>
  66. <body>

  67. <div class="container mt-5">
  68.     <div class="row justify-content-center">
  69.         <div class="col-md-8">
  70.             <div class="card">
  71.                 <div class="card-header text-center">
  72.                     输入抖音链接
  73.                 </div>
  74.                 <div class="card-body">
  75.                     <form action="" method="post">
  76.                         <div class="form-group">
  77.                             <label for="inputField">输入信息:</label>
  78.                             <input type="text" class="form-control" id="inputField" name="inputField" placeholder="输入包含抖音链接的文本,或者是视/频ID">
  79.                         </div>
  80.                         <div class="form-group text-center">
  81.                             <button type="submit" class="btn btn-primary" id="submit-one">提交</button>
  82.                         </div>
  83.                         <div class="form-group">
  84.                             <label for="resultLink">视/频标题:(双击复制)</label>
  85.                             <input type="text" class="form-control" id="resultdesc" value="<?php echo $desc; ?>" readonly style="width:100%;">
  86.                         </div>
  87.                         
  88.                         <div class="form-group">
  89.                             <label for="resultLink">无水印链接:(双击复制)</label>
  90.                             <input type="text" class="form-control" id="resultLink" value="<?php echo $finalUrl; ?>" readonly style="width:100%;">
  91.                         </div>

  92.                         <?php if($errorMsg): ?>
  93.                         <div class="alert alert-danger" role="alert">
  94.                             错误: <?php echo $errorMsg; ?>
  95.                         </div>
  96.                         <?php endif; ?>
  97.                     </form>
  98.                 </div>
  99.             </div>
  100.         </div>
  101.     </div>
  102. </div>



  103. <script src="https://unpkg.com/jquery@3.5.1/dist/jquery.min.js"></script>
  104. <script src="https://unpkg.com/@popperjs/core@2.9.2/dist/umd/popper.min.js"></script>
  105. <script src="https://unpkg.com/bootstrap@4.5.2/dist/js/bootstrap.min.js"></script>
  106. <script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/js/toastr.min.js"></script>
  107. <script>
  108. $(document).ready(function() {
  109.     // 当用户双击resultLink输入框时,复制其内容
  110.     $("#resultLink").dblclick(function() {
  111.         this.select();
  112.         document.execCommand('copy');
  113.         toastr.options.timeOut = 2000; // 3秒后消失
  114.         toastr.options.positionClass = "toast-top-center"; // 设置位置在顶部中间
  115.             // 使用toastr来显示消息
  116.         toastr.success('链接已复制到剪贴板!');
  117.         // alert("链接已复制到剪贴板!");
  118.     });
  119.    
  120.     // 当用户双击resultdesc输入框时,复制其内容
  121.     $("#resultdesc").dblclick(function() {
  122.         this.select();
  123.         document.execCommand('copy');
  124.         toastr.options.timeOut = 2000; // 3秒后消失
  125.         toastr.options.positionClass = "toast-top-center"; // 设置位置在顶部中间
  126.             // 使用toastr来显示消息
  127.         toastr.success('标题已复制到剪贴板!');
  128.         // alert("链接已复制到剪贴板!");
  129.     });
  130.    
  131.         // 当用户双击resultdesc输入框时,复制其内容
  132.     $("#submit-one").click(function() {
  133.         // this.select();
  134.         // document.execCommand('copy');
  135.         toastr.options.timeOut = 3000; // 3秒后消失
  136.         toastr.options.positionClass = "toast-top-center"; // 设置位置在顶部中间
  137.             // 使用toastr来显示消息
  138.         toastr.success('提交成功');
  139.         // alert("链接已复制到剪贴板!");
  140.     });
  141.    

  142.     // 当表单提交时,清空所有内容
  143.     $("form").submit(function() {
  144.         $("#resultLink").val("");
  145.         $(".alert").hide();
  146.     });
  147. });
  148. </script>

  149. </body>
  150. </html>

  151.    
复制代码



我发的破/解游戏的解压密码都是XDGAME
有任何问题私信版主可爱喵不要私信我,我比较少上线,可爱喵每天都会回复私信
回复

使用道具 举报

累计签到:12 天
连续签到:1 天

0

主题

8

回帖

90

积分

星光

名望
0
星币
75
星辰
0
好评
0
发表于 2023-10-7 16:26:55 | 显示全部楼层
看看隐藏
默认签名:偏爱是我家,发展靠大家! 社区反馈邮箱Mail To:service@pai.al或paijishu@outlook.com
回复 支持 反对

使用道具 举报

累计签到:233 天
连续签到:2 天

0

主题

1478

回帖

3971

积分

练星

名望
0
星币
2448
星辰
0
好评
12

星座专属勋章在线大神灌水天才奖欢乐天使奖幸运猪鼎力支持奖

发表于 2023-10-7 16:55:28 | 显示全部楼层
666
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
回复 支持 反对

使用道具 举报

累计签到:80 天
连续签到:1 天

0

主题

19

回帖

492

积分

星光

名望
0
星币
433
星辰
0
好评
0
发表于 2023-10-23 23:41:57 | 显示全部楼层
666666666666666
默认签名:偏爱是我家,发展靠大家! 社区反馈邮箱Mail To:service@pai.al或paijishu@outlook.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|偏爱技术社区-偏爱技术吧-源码-科学刀-我爱辅助-娱乐网--教开服-游戏源码

偏爱技术社区-偏爱技术吧-源码-科学刀-我爱辅助-娱乐网-游戏源码

Powered by Discuz! X3.5

GMT+8, 2024-4-29 14:23 , Processed in 0.086850 second(s), 44 queries .

快速回复 返回顶部 返回列表