We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
document.body.innerHTML.replace(/[\s\S]appsrc : '([\s\S]?)movie([\s\S]?)-list.m3u8'[\s\S]/, "$1mobilev$2.mp4");
下面代码来自直接用 monkey-videos 懒得分析 我自己直接用了
var mp4Url //拿到视频资源的MP4地址 var scripts = document.querySelectorAll('script'), script, reg = /<source[\s\S]+src="([^"]+)"/, match, m3u8Reg = /appsrc\s:\s*'([\s\S]+).m3u8'/, m3u8Match, i;
for (i = 0; script = scripts[i]; i += 1) { match = reg.exec(script.innerHTML); console.log(match); if (match && match.length > 1) { mp4Url = match[1].replace('-mobile.mp4', '.flv'); return mp4Url; } m3u8Match = m3u8Reg.exec(script.innerHTML); console.log(m3u8Match); if (m3u8Match && m3u8Match.length > 1) { mp4Url = m3u8Match[1].replace('-list', '') + '.mp4'; return mp4Url; } } return mp4Url;
The text was updated successfully, but these errors were encountered:
No branches or pull requests
document.body.innerHTML.replace(/[\s\S]appsrc : '([\s\S]?)movie([\s\S]?)-list.m3u8'[\s\S]/, "$1mobilev$2.mp4");
下面代码来自直接用 monkey-videos
懒得分析 我自己直接用了
var mp4Url
//拿到视频资源的MP4地址
var scripts = document.querySelectorAll('script'),
script,
reg = /<source[\s\S]+src="([^"]+)"/,
match,
m3u8Reg = /appsrc\s:\s*'([\s\S]+).m3u8'/,
m3u8Match,
i;
for (i = 0; script = scripts[i]; i += 1) {
match = reg.exec(script.innerHTML);
console.log(match);
if (match && match.length > 1) {
mp4Url = match[1].replace('-mobile.mp4', '.flv');
return mp4Url;
}
m3u8Match = m3u8Reg.exec(script.innerHTML);
console.log(m3u8Match);
if (m3u8Match && m3u8Match.length > 1) {
mp4Url = m3u8Match[1].replace('-list', '') + '.mp4';
return mp4Url;
}
}
return mp4Url;
The text was updated successfully, but these errors were encountered: