-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
replaced brave video search with invidious, fixed the broken json, fi…
…xed the broken main tor instance
- Loading branch information
Showing
13 changed files
with
103 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<?php | ||
function get_video_results($query) | ||
{ | ||
global $config; | ||
|
||
$instance_url = $config->invidious_instance_for_video_results; | ||
|
||
$url = "$instance_url/api/v1/search?q=$query"; | ||
$response = request($url); | ||
$json_response = json_decode($response, true); | ||
|
||
$results = array(); | ||
|
||
foreach ($json_response as $response) | ||
{ | ||
if ($response["type"] == "video") | ||
{ | ||
$title = $response["title"]; | ||
$url = $instance_url . "/watch?v=" . $response["videoId"]; | ||
$url = check_for_privacy_frontend($url); | ||
$uploader = $response["author"]; | ||
$views = $response["viewCount"]; | ||
$date = $response["publishedText"]; | ||
$thumbnail = $instance_url . "/vi/" . explode("/vi/" ,$response["videoThumbnails"][4]["url"])[1]; | ||
|
||
array_push($results, | ||
array ( | ||
"title" => htmlspecialchars($title), | ||
"url" => htmlspecialchars($url), | ||
"base_url" => htmlspecialchars(get_base_url($url)), | ||
"uploader" => htmlspecialchars($uploader), | ||
"views" => htmlspecialchars($views), | ||
"date" => htmlspecialchars($date), | ||
"thumbnail" => htmlspecialchars($thumbnail) | ||
) | ||
); | ||
} | ||
} | ||
|
||
return $results; | ||
} | ||
|
||
function print_video_results($results) | ||
{ | ||
echo "<div class=\"text-result-container\">"; | ||
|
||
foreach($results as $result) | ||
{ | ||
$title = $result["title"]; | ||
$url = $result["url"]; | ||
$base_url = $result["base_url"]; | ||
$uploader = $result["uploader"]; | ||
$views = $result["views"]; | ||
$date = $result["date"]; | ||
$thumbnail = $result["thumbnail"]; | ||
|
||
echo "<div class=\"text-result-wrapper\">"; | ||
echo "<a href=\"$url\">"; | ||
echo "$base_url"; | ||
echo "<h2>$title</h2>"; | ||
echo "<img class=\"video-img\" src=\"image_proxy.php?url=$thumbnail\">"; | ||
echo "<br>"; | ||
echo "<span>$uploader - $date - $views views</span>"; | ||
echo "</a>"; | ||
echo "</div>"; | ||
} | ||
|
||
echo "</div>"; | ||
} | ||
?> |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"> | ||
<ShortName>LibreX</ShortName> | ||
<Description>A privacy respecting meta search engine.</Description> | ||
<Description>Framework and javascript free privacy respecting meta search engine</Description> | ||
<InputEncoding>UTF-8</InputEncoding> | ||
<LongName>LibreX search</LongName> | ||
<Url rel="results" type="text/html" method="get" template="http://localhost/search.php?q={searchTerms}" /> | ||
<Url rel="results" type="text/html" method="get" template="http://localhost:80/search.php?q={searchTerms}" /> | ||
<Url type="application/opensearchdescription+xml" | ||
rel="self" | ||
template="/opensearch.xml?method=POST" /> | ||
template="/opensearch.xml?method=GET" /> | ||
</OpenSearchDescription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters