-
Notifications
You must be signed in to change notification settings - Fork 0
/
vid.php
40 lines (32 loc) · 1.21 KB
/
vid.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<!-- Return Array link -->
<?php
include './index.php';
require './vendor/autoload.php';
if (isset($_SESSION['link'])) {
$link = $_SESSION['link'];
}
$httpClient = new \GuzzleHttp\Client();
$response = $httpClient->get($link);
// $htmlString = (string) $response->getBody();
//add this line to suppress any warnings
libxml_use_internal_errors(true);
// $doc = new DOMDocument();
// $doc->loadHTML($htmlString);
// $xpath = new DOMXPath($doc);
// $videos = $xpath->evaluate('//*[@id="-"]/div/div/div/div[data-testid="column"]');
$linkVideos = [];
// echo "<h3>Crawl result for domain:". $link ." </h3>";
// foreach ($videos as $video) {
// $link_value = $video->value;
// echo "<a class='link-download' href='" ;
// array_push($linkVideos, $link_value);
// echo $link_value;
// echo "'>link". $link_value . "</a>";
// }
// $saveDirectory = __DIR__ . '/downloads/';
// $serialized_array = serialize($linkVideos);
// ?>
// <form method="post" action="/WebCrawler/download.php">
// <input type="hidden" name="array_data" value="<?php echo htmlspecialchars($serialized_array); ?>">
// <button class="download-submit" type="submit" name="download">Download</button>
// </form>