you can use regular to matching
>>> import re
>>> js_html = '''<script>
var ap = new APlayer({
element: document.getElementById("player"),
narrow: !1,
autoplay: !1,
theme: "#ffa42f",
music: {
title: "212121",
author: "a",
url: "http://daohuolab.oss-cn-beijing.aliyuncs.com/dd/8525_92433.m4a",
pic: "https://s1.aaaax1x.com/2020/06/13/tj1eln.png"
}
}),
as = $("#as-con"),
mask = $("#as-mask");
function hideActionSheet() {
as.removeClass("weui-actionsheet_toggle"),
mask.hide()
}
mask.on("click", hideActionSheet),
$("#as-cancel").on("click", hideActionSheet),
$("#speed-control-tab").on("click", function() {
as.addClass("weui-actionsheet_toggle"),
mask.show()
}),
$(".speed-item").on("click", function() {
var e = $(this).data("v");
ap.audio.playbackRate = e,
$("#speed-control-tab").find("p").html(e + "x"),
$(".speed-item").removeClass("ycolor"),
$(this).addClass("ycolor"),
hideActionSheet()
});
</script>]'''
>>> res = r'url: "(.*?)"'
>>> surls = re.findall(res, js_html)
>>> surls
['http://daohuolab.oss-cn-beijing.aliyuncs.com/dd/8525_92433.m4a']
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…