<div class=/'container/'>/n  <h1>解析快手视频</h1>/n  <div class=/'form-group/'>/n    <label for=/'url/'>输入视频链接:</label>/n    <input type=/'text/' id=/'url/' name=/'url/' class=/'input/' placeholder=/'请输入快手视频链接/'>/n  </div>/n  <div class=/'actions/'>/n    <button id=/'submit/' class=/'btn btn-primary/'>解析</button>/n    <button id=/'clear/' class=/'btn btn-secondary/'>重置</button>/n  </div>/n  <div class=/'result/'>/n    <p><strong>解析中,请稍等<span class=/'dots/'>...</span></strong></p>/n  </div>/n  <div class=/'actions/'>/n    <button id=/'copy/' class=/'btn btn-secondary/' style=/'display:none;/'>复制链接</button>/n  </div>/n</div>/n<script>/n$(document).ready(function() {/n  $('#submit').click(function() {/n    var url = $('#url').val().trim();/n    if (url == '') {/n      alert('请输入视频链接');/n      return false;/n    } else if (!isValidUrl(url)) {/n      alert('请输入有效的视频链接');/n      return false;/n    }/n    var api_url = 'http://y.ovoa.cc/api/kuaishou.php?url=' + url;/n    $('.result').html('<p><strong>解析中,请稍等<span class=/'dots/'>...</span></strong></p>').show();/n    $('#copy').hide();/n    $.get(api_url, function(data) {/n      if (data.msg == '解析成功') {/n        $('.result').html('<p><strong>解析结果:</strong></p><p><img src=' + data.avatar + ' alt=/'/'><span>' + data.author + '</span></p><p><img src=' + data.cover + ' alt=/'/'><span>' + data.title + '</span></p><p><a href=' + data.url + '>' + data.url + '</a></p>');/n        $('#copy').show();/n      } else {/n        $('.result').html('<p><strong>解析失败:</strong>' + data.msg + '</p>');/n        $('#submit').prop('disabled', false);/n      }/n    }).fail(function() {/n      $('.result').html('<p><strong>请求失败:</strong>请稍后再试</p>');/n      $('#submit').prop('disabled', false);/n    });/n    $(this).prop('disabled', true);/n  });/n/n  $('#clear').click(function() {/n    $('#url').val('');/n    $('.result').hide();/n    $('#copy').hide();/n    $('#submit').prop('disabled', false);/n  });/n/n  $('#copy').click(function() {/n    var url = $('.result a').attr('href');/n    if (url) {/n      navigator.clipboard.writeText(url);/n    }/n  });/n/n  function isValidUrl(url) {/n    var pattern = /^(http|https):////[a-zA-Z0-9/-/.]+/.[a-zA-Z]{2,}(///S*)?$/;/n    return pattern.test(url);/n  }/n/n  if (!navigator.clipboard) {/n    $('#copy').prop('disabled', true);/n  }/n});/n</script>
快手视频解析 - 免费去水印下载

原文地址: https://www.cveoy.top/t/topic/mDCm 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录