group-telegram.com/HackerOnion/5253
Last Update:
<?php
header('Content-Type: application/json');
error_reporting(0);
$search = $_GET['search'];
if (isset($search)) {
$get = file_get_contents("https://www.youtube.com/results?search_query=" . urlencode($search));
$pattrn = '/\\,{"videoRenderer":{"videoId":"(.*?)","thumbnail":{"thumbnails":\[{"url":"(.*?)"\\b(.*?)\\"title":{"runs":\[{"text":"(.*?)\"\\b(.*?)\\,"simpleText":"(.*?)"},"viewCountText":{"simpleText":"(.*?)"}/';
preg_match_all($pattrn, $get, $json);
function unescapeUTF8EscapeSeq($str)
{
return preg_replace_callback(
"/\\\u([0-9a-f]{4})/i",
create_function(
'$matches',
'return html_entity_decode(\'&#x\'.$matches[1].\';\', ENT_QUOTES, \'UTF-8\');'
),
$str
);
}
$array['ok'] = true;
for ($i = 0; $i <= count($json[1]) - 1; $i++) {
$title = str_replace('",', null, preg_replace('#[0-9@=|()!-/"\}]]#', null, unescapeUTF8EscapeSeq($json[4][$i])));
$url = $json[1][$i];
$image = str_replace('",', null, $json[2][$i]);
$time = $json[6][$i];
$view = str_replace("weergaven", "views", $json[7][$i]);
$array['results'][] = [
'title' => $title,
'url' => $url,
'time' => $time,
'view' => $view,
'image' => $image,
];
}
echo json_encode($array, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
}
BY Hacker onion
Warning: Undefined variable $i in /var/www/group-telegram/post.php on line 260
Share with your friend now:
group-telegram.com/HackerOnion/5253