-
09-06
-
12-27
-
01-08
-
12-31
-
12-31
Warning: error_log(/home/wwwroot/zym.qw1688.net/cache/error_log.php): failed to open stream: Permission denied in /home/wwwroot/zym.qw1688.net/yzmphp/core/class/debug.class.php on line 63
发布时间:2021-01-08 13:13:51
文章来源:原创
访问次数:5
09-06
12-27
01-08
12-31
12-31
代码
var str = "视频地址$https://iqiyi.com/index.m3u8$$$DVD国语中字$https://iqiyi.com/share/395db788289ee286662bbcabe78d99da";
console.log(getPlayUrl(str));
function getPlayUrl(str) {
var one = str.indexOf('$') + 1;//获取条件一首次出现位置
var two = str.indexOf('.m3u8');//获取条件二首次出现位置
var three = str.substr(one, two);//获取需要的字符串
console.log(three);
return three.replace(/\$/g, "");//替换无用掉残留字符串
}本文链接:http://www.hzlm.net/javascript/88.html