原文

代码

    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, "");//替换无用掉残留字符串
    }

相关文章:

  • 2021-11-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-25
  • 2022-12-23
  • 2021-11-04
猜你喜欢
  • 2022-12-23
  • 2022-02-09
  • 2022-12-23
  • 2022-01-09
  • 2021-11-30
  • 2021-11-03
  • 2022-03-01
相关资源
相似解决方案