Saludes! it turns out that I have this little php code that extracts the source code of a page. HTML
<?php
$file = file('https://ged-tubesex69.rhcloud.com/demo.php');
foreach($file as $line){
$texto = nl2br(htmlspecialchars($line).' ');
echo $texto;
}
?>
The demo.php file contains the following code:
<head>
<title>video get</title>
</head>
<body>
<div id="xplayer">Loading the player...</div>
<script type="text/javascript">
[{image: "http://img-l3.xvideos.com/videos/thumbs169ll/04/c9/cc/04c9cc14e4537a32342eaa7a5340eb32/04c9cc14e4537a32342eaa7a5340eb32.11.jpg"}]
[{file: "http://xvideos-im-acf62f00-7826421-mp4.s.loris.llnwd.net/videos/mp4/0/4/c/xvideos.com_04c9cc14e4537a32342eaa7a5340eb32.mp4?e=1503981742&ri=1024&rs=85&h=a45adb250614cea72c7684c33c7662ce",label: "360P",type: "video/mp4",provider: "video"}],
</script>
</body>
What I'm looking for is to store the contents of demo.php in a variable and extract the url from the video and the image from that variable / strong>.
I tried it this way:
if (preg_match('#\[{file:[^"]*"([^"]*)"#', $line, $datos)) {
$sd = $datos[1];
} else {
$sd = 'error';
}
if (preg_match('#\[{image:[^"]*"([^"]*)"#',$line, $datos)) {
$img = $datos[1];
} else {
$img = 'error';
}
echo video: $sd;
echo imagen: $img;
But it does not work for me. I hope you can help me clarify this problem