Detect Text In Script And Obtain Text Within Script Tag Using Jsoup
I want to code get value stream but fail. url detect http://m.xemtvhd.com/vtv1.php How to get value stream : http://123.30.215.65/hls/4545780bfa790819/5/3/d836ad614748cdab11c9df291
Solution 1:
There is some mistakes in your regex, for ex you put the {
after source
in fact it's before and you need to double escape it because {i,j}
are quantifiers, and the ,
is also not at good place, I don't know why you did that, it's not the same order than the sentence
So to fix use : Pattern.compile("player = new Clappr\\.Player\\(\\{source: \"(http:.*)\",.*");
When you use regex, try online like regex101 and write the regex like word by word, and at the end you can try to replace word/group by \d, \w,... to reduce
Solution 2:
@zaro why code regex not support get code script.it with a similar format
<head>
<style>html,body{margin:0;padding:0;background:#000;;}</style>
<meta charset="utf-8">
<script src="https://code.jquery.com/jquery-2.1.4.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/clappr/latest/clappr.min.js"></script>
<meta name="referrer" content="no-referrer">
</head>
<body>
<div style="width: 100%;">
</div>
<div id="player"></div>
<script>
player = new Clappr.Player({source:"http://123.30.215.47/hls/4545780bfa790819/5/3/4b3850f3b3e966aea6ee715c73493ee773f6c45ec2a942b35c941abff6b44e16/dnR2MQ==_m.m3u8",
parentId: '#player',
width: '100%', height: "50%",
hideMediaControl: true,
mediacontrol: {seekbar: "#f00", buttons: "#ff0"},
poster: 'https://lh3.googleusercontent.com/-jHMLMVGcPhI/VqRirYSK0OI/AAAAAAAACEQ/F34hsicLLsU/s600-Ic42/xemtv.png',
position: 'top-right',
autoPlay: true
});
</script>
<iframe scrolling="no" src="vtv1-pc.php" allowfullscreen="true" width="100%" frameborder="0" height="50%"></iframe>
</body>
</html>
Post a Comment for "Detect Text In Script And Obtain Text Within Script Tag Using Jsoup"