HTML代码
<div class="wrap_search"> <input type="text" id="url" placeholder="请将APP里复制的视频链接粘贴到这里" autocomplete="off"> <button type="submit" id="button">解析</button> </div>
API源码
<?php header('Content-type:application/json; charset=utf-8'); !empty($_GET['url']) ? $url = $_GET['url'] : exit(json_encode(['code'=>202,"msg"=>"参数错误"],JSON_UNESCAPED_UNICODE)); $api = file_get_contents('https://umapi.top/api/dy.php?url='.$url); $data = json_decode($api,true); echo json_encode($data,JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE);
js代码
$(document).ready(function(){ $('#button').click(function (){ var text = $('#url').val(); if (text == '') { alert('域名不能为空'); return false; } $.ajax({ url:'api.php', type:'get', dataType:'json', data: {url:text}, beforeSend: function(){ $("#load").html('<div class="preloader"><div class="loader"></div></div>'); $("head").prepend(meta); }, success:function(data){ if (data.code == 200) { var mkhtml = '<div class="mark_title">解析结果</div><div class="water_content"><p>'+data.title+'</p><div class="video"><iframe src="'+data.url+'" width="100%" height="100%" scrolling="no" frameborder="0" allowfullscreen="true" allow="autoplay" referrerpolicy="no-referrer"></iframe></div><div class="download"><a href="'+data.pic+'" target="_blank" rel="nofollow">封面图片</a><a href="'+data.url+'" target="_blank" rel="nofollow" referrerpolicy="no-referrer">下载视频</a></div></div>'; $(".watermark").html(mkhtml); $("#load").empty(); }else{ alert(data.msg); $("#load").empty(); } } }); }); });
HTML、API、JS都给你们了,剩下的就靠自己了,会的人应该一看就懂,分享给大家学习。
- PHP全网视频解析下载网站源码 [2024-09-27]
- 抖音无水印解析PHP接口代码分享 [2024-09-23]
- cobalt多功能视频音乐解析下载工具,支持所有热门视频平台 [2024-08-31]
- ODE(窝的)百度网盘不限速解析下载工具V0.9.8 [2024-08-30]
- 懒人影院VIP视频解析网页源码 [2024-08-23]