summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--about.php4
-rw-r--r--api/v1/images.php3
-rw-r--r--api/v1/news.php3
-rw-r--r--api/v1/videos.php3
-rw-r--r--api/v1/web.php3
-rw-r--r--banner/aves.pngbin86557 -> 25271 bytes
-rw-r--r--banner/aves_2.pngbin51960 -> 14191 bytes
-rw-r--r--banner/bibblebop.pngbin42488 -> 14791 bytes
-rw-r--r--banner/birds birds birdsw_4.jpgbin9643 -> 9373 bytes
-rw-r--r--banner/birds_birds_birdsw.jpgbin6641 -> 6394 bytes
-rw-r--r--banner/birds_birds_birdsw_2.jpgbin6959 -> 6706 bytes
-rw-r--r--banner/birds_birds_birdsw_3.jpgbin6231 -> 6096 bytes
-rw-r--r--banner/birds_birds_birdsw_4.jpgbin0 -> 9643 bytes
-rw-r--r--banner/deek.pngbin1971 -> 1373 bytes
-rw-r--r--banner/deekchat.gifbin3699 -> 2480 bytes
-rw-r--r--banner/eagle.pngbin17033 -> 5846 bytes
-rw-r--r--banner/eagle2.pngbin5236 -> 1180 bytes
-rw-r--r--banner/eagle3.jpgbin11607 -> 11427 bytes
-rw-r--r--banner/eddd_1.pngbin71856 -> 43851 bytes
-rw-r--r--banner/eddd_2.pngbin33842 -> 10651 bytes
-rw-r--r--banner/eddd_3.pngbin51809 -> 13687 bytes
-rw-r--r--banner/gnuwu.pngbin22305 -> 6666 bytes
-rw-r--r--banner/gnuwu_2.pngbin47351 -> 33693 bytes
-rw-r--r--banner/horse.pngbin69595 -> 20672 bytes
-rw-r--r--banner/linucks.jpgbin63271 -> 60524 bytes
-rw-r--r--banner/real_nig_3.jpgbin67812 -> 64618 bytes
-rw-r--r--banner/sec.pngbin60673 -> 18421 bytes
-rw-r--r--banner/tagmachine.pngbin35288 -> 10717 bytes
-rw-r--r--icons/lolcat.ca.pngbin1408 -> 753 bytes
-rw-r--r--images.php9
-rw-r--r--lib/frontend.php4
-rw-r--r--lib/fuckhtml.php85
-rw-r--r--proxy.php9
-rw-r--r--scraper/brave.php349
-rw-r--r--scraper/google.php486
-rw-r--r--scraper/mojeek.php32
-rw-r--r--settings.php46
-rw-r--r--static/client.js17
-rw-r--r--static/icon/amazon.pngbin2485 -> 1228 bytes
-rw-r--r--static/icon/appstore.pngbin2841 -> 1763 bytes
-rw-r--r--static/icon/facebook.pngbin1575 -> 574 bytes
-rw-r--r--static/icon/gamespot.pngbin2434 -> 1739 bytes
-rw-r--r--static/icon/github.pngbin1250 -> 511 bytes
-rw-r--r--static/icon/googleplay.pngbin1469 -> 1046 bytes
-rw-r--r--static/icon/imdb.pngbin2626 -> 1287 bytes
-rw-r--r--static/icon/instagram.pngbin3309 -> 1827 bytes
-rw-r--r--static/icon/itunes.pngbin3016 -> 1725 bytes
-rw-r--r--static/icon/microsoft.pngbin2147 -> 1218 bytes
-rw-r--r--static/icon/quora.pngbin1716 -> 841 bytes
-rw-r--r--static/icon/reddit.pngbin2009 -> 1086 bytes
-rw-r--r--static/icon/rottentomatoes.pngbin1084 -> 468 bytes
-rw-r--r--static/icon/sciencedirect.pngbin585 -> 354 bytes
-rw-r--r--static/icon/soundcloud.pngbin1289 -> 602 bytes
-rw-r--r--static/icon/spotify.pngbin2114 -> 689 bytes
-rw-r--r--static/icon/steam.pngbin1875 -> 629 bytes
-rw-r--r--static/icon/twitter.pngbin1361 -> 698 bytes
-rw-r--r--static/icon/w3html.pngbin1542 -> 1000 bytes
-rw-r--r--static/icon/website.pngbin2854 -> 1792 bytes
-rw-r--r--static/icon/wikipedia.pngbin1363 -> 1085 bytes
-rw-r--r--static/icon/youtube.pngbin2363 -> 1335 bytes
-rw-r--r--template/home.html8
-rw-r--r--template/images.html2
-rw-r--r--template/search.html2
63 files changed, 772 insertions, 293 deletions
diff --git a/about.php b/about.php
index b3fd6d9..1a7734a 100644
--- a/about.php
+++ b/about.php
@@ -81,7 +81,7 @@ $left =
<div class="code-inline">Escape</div> to exit the image viewer.
<a href="#instances"><h2 id="instances">Instances</h2></a>
- 4get is open source, anyone can create their own 4get instance! If you wish to add your website to this list, please <a href="https://lolcat.ca/contact">contact me</a>.
+ 4get is open source, anyone can create their own 4get instance! If you wish to add your website to this list, please <a href="https://lolcat.ca">contact me</a>.
<table>
<tr>
@@ -102,7 +102,7 @@ $left =
<b>Message to all DMCA enforcers:</b> I don\'t host any of the content. Everything you see here is <u>proxied</u> trough my shitbox with no moderation. Please reach out to the people hosting the infringing content instead.<br><br>
- <a href="https://lolcat.ca/contact" rel="dofollow" class="link">Click here to contact me!</a><br><br>
+ <a href="https://lolcat.ca" rel="dofollow" class="link">Click here to contact me!</a><br><br>
<a href="https://validator.w3.org/nu/?doc=https%3A%2F%2F4get.ca" title="W3 Valid!">
<img src="/static/icon/w3html.png" alt="Valid W3C HTML 4.01" width="88" height="31">
diff --git a/api/v1/images.php b/api/v1/images.php
index e05ba26..694658e 100644
--- a/api/v1/images.php
+++ b/api/v1/images.php
@@ -16,7 +16,8 @@ $get = $frontend->parsegetfilters($_GET, $filters);
try{
echo json_encode(
- $scraper->image($get)
+ $scraper->image($get),
+ JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES
);
}catch(Exception $e){
diff --git a/api/v1/news.php b/api/v1/news.php
index 7e24247..775ef94 100644
--- a/api/v1/news.php
+++ b/api/v1/news.php
@@ -16,7 +16,8 @@ $get = $frontend->parsegetfilters($_GET, $filters);
try{
echo json_encode(
- $scraper->news($get)
+ $scraper->news($get),
+ JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES
);
}catch(Exception $e){
diff --git a/api/v1/videos.php b/api/v1/videos.php
index 60c105a..225611a 100644
--- a/api/v1/videos.php
+++ b/api/v1/videos.php
@@ -16,7 +16,8 @@ $get = $frontend->parsegetfilters($_GET, $filters);
try{
echo json_encode(
- $scraper->video($get)
+ $scraper->video($get),
+ JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES
);
}catch(Exception $e){
diff --git a/api/v1/web.php b/api/v1/web.php
index 7895183..7f6d769 100644
--- a/api/v1/web.php
+++ b/api/v1/web.php
@@ -21,7 +21,8 @@ if(!isset($_GET["extendedsearch"])){
try{
echo json_encode(
- $scraper->web($get)
+ $scraper->web($get),
+ JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES
);
}catch(Exception $e){
diff --git a/banner/aves.png b/banner/aves.png
index ace604f..2b28e79 100644
--- a/banner/aves.png
+++ b/banner/aves.png
Binary files differ
diff --git a/banner/aves_2.png b/banner/aves_2.png
index c78839f..30f17a6 100644
--- a/banner/aves_2.png
+++ b/banner/aves_2.png
Binary files differ
diff --git a/banner/bibblebop.png b/banner/bibblebop.png
index 0c061e0..0fe95c4 100644
--- a/banner/bibblebop.png
+++ b/banner/bibblebop.png
Binary files differ
diff --git a/banner/birds birds birdsw_4.jpg b/banner/birds birds birdsw_4.jpg
index ba7d637..c4a52d8 100644
--- a/banner/birds birds birdsw_4.jpg
+++ b/banner/birds birds birdsw_4.jpg
Binary files differ
diff --git a/banner/birds_birds_birdsw.jpg b/banner/birds_birds_birdsw.jpg
index ff04b23..d820465 100644
--- a/banner/birds_birds_birdsw.jpg
+++ b/banner/birds_birds_birdsw.jpg
Binary files differ
diff --git a/banner/birds_birds_birdsw_2.jpg b/banner/birds_birds_birdsw_2.jpg
index dcd6125..a8d9164 100644
--- a/banner/birds_birds_birdsw_2.jpg
+++ b/banner/birds_birds_birdsw_2.jpg
Binary files differ
diff --git a/banner/birds_birds_birdsw_3.jpg b/banner/birds_birds_birdsw_3.jpg
index 1446207..239f6c8 100644
--- a/banner/birds_birds_birdsw_3.jpg
+++ b/banner/birds_birds_birdsw_3.jpg
Binary files differ
diff --git a/banner/birds_birds_birdsw_4.jpg b/banner/birds_birds_birdsw_4.jpg
new file mode 100644
index 0000000..ba7d637
--- /dev/null
+++ b/banner/birds_birds_birdsw_4.jpg
Binary files differ
diff --git a/banner/deek.png b/banner/deek.png
index ef80354..850416d 100644
--- a/banner/deek.png
+++ b/banner/deek.png
Binary files differ
diff --git a/banner/deekchat.gif b/banner/deekchat.gif
index bba01da..604e2fa 100644
--- a/banner/deekchat.gif
+++ b/banner/deekchat.gif
Binary files differ
diff --git a/banner/eagle.png b/banner/eagle.png
index f074341..705cf6d 100644
--- a/banner/eagle.png
+++ b/banner/eagle.png
Binary files differ
diff --git a/banner/eagle2.png b/banner/eagle2.png
index 175366b..d5bdda6 100644
--- a/banner/eagle2.png
+++ b/banner/eagle2.png
Binary files differ
diff --git a/banner/eagle3.jpg b/banner/eagle3.jpg
index 1e65b59..5c3d44d 100644
--- a/banner/eagle3.jpg
+++ b/banner/eagle3.jpg
Binary files differ
diff --git a/banner/eddd_1.png b/banner/eddd_1.png
index fab460b..4dd69b0 100644
--- a/banner/eddd_1.png
+++ b/banner/eddd_1.png
Binary files differ
diff --git a/banner/eddd_2.png b/banner/eddd_2.png
index 5ce4c2c..c2a59d1 100644
--- a/banner/eddd_2.png
+++ b/banner/eddd_2.png
Binary files differ
diff --git a/banner/eddd_3.png b/banner/eddd_3.png
index b4ca48d..8531a88 100644
--- a/banner/eddd_3.png
+++ b/banner/eddd_3.png
Binary files differ
diff --git a/banner/gnuwu.png b/banner/gnuwu.png
index 634b59d..6b95ca4 100644
--- a/banner/gnuwu.png
+++ b/banner/gnuwu.png
Binary files differ
diff --git a/banner/gnuwu_2.png b/banner/gnuwu_2.png
index 493a6d9..1612132 100644
--- a/banner/gnuwu_2.png
+++ b/banner/gnuwu_2.png
Binary files differ
diff --git a/banner/horse.png b/banner/horse.png
index 0075a9c..e4cd7f5 100644
--- a/banner/horse.png
+++ b/banner/horse.png
Binary files differ
diff --git a/banner/linucks.jpg b/banner/linucks.jpg
index 8874451..3148c6f 100644
--- a/banner/linucks.jpg
+++ b/banner/linucks.jpg
Binary files differ
diff --git a/banner/real_nig_3.jpg b/banner/real_nig_3.jpg
index 8091146..60bac39 100644
--- a/banner/real_nig_3.jpg
+++ b/banner/real_nig_3.jpg
Binary files differ
diff --git a/banner/sec.png b/banner/sec.png
index 3c1a49e..b02b978 100644
--- a/banner/sec.png
+++ b/banner/sec.png
Binary files differ
diff --git a/banner/tagmachine.png b/banner/tagmachine.png
index c8b82a0..2fca9a2 100644
--- a/banner/tagmachine.png
+++ b/banner/tagmachine.png
Binary files differ
diff --git a/icons/lolcat.ca.png b/icons/lolcat.ca.png
index c7e4785..bf47a44 100644
--- a/icons/lolcat.ca.png
+++ b/icons/lolcat.ca.png
Binary files differ
diff --git a/images.php b/images.php
index 2c0799e..ff420c9 100644
--- a/images.php
+++ b/images.php
@@ -62,8 +62,13 @@ foreach($results["image"] as $image){
'<div class="image-wrapper" title="' . htmlspecialchars($image["title"]) .'" data-json="' . htmlspecialchars(json_encode($image["source"])) . '">' .
'<div class="image">' .
'<a href="' . htmlspecialchars($image["source"][0]["url"]) . '" rel="noreferrer nofollow" class="thumb">' .
- '<img src="' . $frontend->htmlimage($image["source"][count($image["source"]) - 1]["url"], "thumb") . '" alt="thumbnail">' .
- '<div class="duration">' . $image["source"][0]["width"] . 'x' . $image["source"][0]["height"] . '</div>' .
+ '<img src="' . $frontend->htmlimage($image["source"][count($image["source"]) - 1]["url"], "thumb") . '" alt="thumbnail">';
+
+ if($image["source"][0]["width"] !== null){
+ $payload["images"] .= '<div class="duration">' . $image["source"][0]["width"] . 'x' . $image["source"][0]["height"] . '</div>';
+ }
+
+ $payload["images"] .=
'</a>' .
'<a href="' . htmlspecialchars($image["url"]) . '" rel="noreferrer nofollow">' .
'<div class="title">' . htmlspecialchars(parse_url($image["url"], PHP_URL_HOST)) . '</div>' .
diff --git a/lib/frontend.php b/lib/frontend.php
index 16e5693..7f65354 100644
--- a/lib/frontend.php
+++ b/lib/frontend.php
@@ -892,6 +892,7 @@ class frontend{
"option" => [
"ddg" => "DuckDuckGo",
"yandex" => "Yandex",
+ "brave" => "Brave"//,
//"google" => "Google"
]
];
@@ -903,6 +904,7 @@ class frontend{
"option" => [
"yt" => "YouTube",
"ddg" => "DuckDuckGo",
+ "brave" => "Brave"//,
//"google" => "Google"
]
];
@@ -1285,7 +1287,7 @@ class frontend{
return htmlspecialchars($image);
}
- return "/proxy?i=" . urlencode($image) . "&s=" . $format;
+ return "/proxy.php?i=" . urlencode($image) . "&s=" . $format;
}
public function htmlnextpage($gets, $npt, $page){
diff --git a/lib/fuckhtml.php b/lib/fuckhtml.php
index 8802511..5c65417 100644
--- a/lib/fuckhtml.php
+++ b/lib/fuckhtml.php
@@ -356,6 +356,91 @@ class fuckhtml{
return $out;
}
+
+ public function parseJsObject(string $json){
+
+ $bracket = false;
+ $is_close_bracket = false;
+ $escape = false;
+ $json_out = null;
+ $last_char = null;
+
+ for($i=0; $i<strlen($json); $i++){
+
+ switch($json[$i]){
+
+ case "\"":
+ case "'":
+ if($escape === true){
+
+ break;
+ }
+
+ if($json[$i] == $bracket){
+
+ $bracket = false;
+ $is_close_bracket = true;
+ }else{
+
+ if($bracket === false){
+
+ $bracket = $json[$i];
+ }
+ }
+ break;
+
+ default:
+ $is_close_bracket = false;
+ break;
+ }
+
+ $escape = $json[$i] == "\\" ? true : false;
+
+ if(
+ $bracket === false &&
+ $is_close_bracket === false
+ ){
+
+ // here we know we're not iterating over a quoted string
+ switch($json[$i]){
+
+ case "[":
+ case "{":
+ // dont execute whats in "default"
+ $json_out .= $json[$i];
+ break;
+
+ case "]":
+ case "}":
+ case ",":
+ case ":":
+ if(!in_array($last_char, ["[", "{", "}", "]", "\""])){
+
+ $json_out .= "\"";
+ }
+
+ $json_out .= $json[$i];
+ break;
+
+ default:
+ if(in_array($last_char, ["{", "[", ",", ":"])){
+
+ $json_out .= "\"";
+ }
+
+ $json_out .= $json[$i];
+ break;
+ }
+ }else{
+
+ $json_out .= $json[$i];
+ }
+
+ $last_char = $json[$i];
+ }
+
+ return json_decode($json_out, true);
+ }
}
?>
diff --git a/proxy.php b/proxy.php
index d8b3c1b..bcf552e 100644
--- a/proxy.php
+++ b/proxy.php
@@ -57,6 +57,7 @@ try{
}
$image->readImageBlob($payload["body"]);
+
$image_width = $image->getImageWidth();
$image_height = $image->getImageHeight();
@@ -102,16 +103,16 @@ try{
$image_width = $image_height * $ratio;
}
- $image->setImageBackgroundColor(new ImagickPixel("#504945"));
- $image->mergeImageLayers(Imagick::LAYERMETHOD_FLATTEN);
-
- $image->resizeImage($image_width, $image_height, Imagick::FILTER_LANCZOS, 1);
+ $image->setImageBackgroundColor("#504945");
+ $image->setImageAlphaChannel(Imagick::ALPHACHANNEL_REMOVE);
$image->stripImage();
$image->setFormat("jpeg");
$image->setImageCompressionQuality(90);
$image->setImageCompression(Imagick::COMPRESSION_JPEG2000);
+ $image->resizeImage($image_width, $image_height, Imagick::FILTER_LANCZOS, 1);
+
$proxy->getfilenameheader($payload["headers"], $_GET["i"]);
header("Content-Type: image/jpeg");
diff --git a/scraper/brave.php b/scraper/brave.php
index 4d48c33..c598c80 100644
--- a/scraper/brave.php
+++ b/scraper/brave.php
@@ -86,6 +86,8 @@ class brave{
];
break;
+ case "images":
+ case "videos":
case "news":
return [
"country" => [
@@ -143,7 +145,7 @@ class brave{
}
}
- private function get($url, $get = [], $nsfw, $country/*, $is_post = false, $additional_cookies = null*/){
+ private function get($url, $get = [], $nsfw, $country){
switch($nsfw){
@@ -152,13 +154,6 @@ class brave{
case "no": $nsfw = "strict"; break;
}
- //$cookie = "safesearch={$nsfw}; country={$country}; useLocation=0";
- /*
- if($additional_cookies !== null){
-
- $cookie = $additional_cookies . "; " . $cookie;
- }*/
-
$headers = [
"User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:107.0) Gecko/20100101 Firefox/110.0",
"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8",
@@ -171,8 +166,7 @@ class brave{
"Sec-Fetch-Dest: document",
"Sec-Fetch-Mode: navigate",
"Sec-Fetch-Site: none",
- "Sec-Fetch-User: ?1"//,
- //"Content-Type: application/json"
+ "Sec-Fetch-User: ?1"
];
if($country == "any"){
@@ -182,22 +176,10 @@ class brave{
$curlproc = curl_init();
- /*if($is_post){
-
- curl_setopt($curlproc, CURLOPT_POST, true);
- curl_setopt(
- $curlproc,
- CURLOPT_POSTFIELDS,
- json_encode($get)
- );
-
- }else{
- */
- if($get !== []){
- $get = http_build_query($get);
- $url .= "?" . $get;
- }
- //}
+ if($get !== []){
+ $get = http_build_query($get);
+ $url .= "?" . $get;
+ }
curl_setopt($curlproc, CURLOPT_URL, $url);
@@ -1950,18 +1932,24 @@ class brave{
return $out;
}
- /*
- public function bypasscaptcha($html, $nsfw, $country){
+ public function image($get){
- // @TODO figure out why I still cant go trough
- // the captcha wall even after breaking it
+ $search = $get["s"];
+ $country = $get["country"];
+ $nsfw = $get["nsfw"];
+
+ $out = [
+ "status" => "ok",
+ "npt" => null,
+ "image" => []
+ ];
try{
$html =
$this->get(
- "https://search.brave.com/goggles",
+ "https://search.brave.com/images",
[
- "q" => "site:dailymotion.com my bloody valentine"
+ "q" => $search
],
$nsfw,
$country
@@ -1969,177 +1957,192 @@ class brave{
}catch(Exception $error){
- throw new Exception("Could not fetch html");
+ throw new Exception("Could not fetch search page");
}
+ /*
+ $handle = fopen("scraper/brave-image.html", "r");
+ $html = fread($handle, filesize("scraper/brave-image.html"));
+ fclose($handle);*/
- // Bypass brave search captcha
- // this captcha only appears on the goggles page
preg_match(
- '/this\.img\.src = &#34;(.*)&#34;/',
+ '/const data = (\[{.*}\]);/',
$html,
- $image
+ $json
);
- $image =
- base64_decode(
- explode(
- "data:image/png;base64,",
- $image[1]
- )[1]
- );
-
- $im = new Imagick();
- $im->readImageBlob($image);
-
- $im->blurImage(20, 20);
- $im->posterizeImage(2, imagick::IMGTYPE_COLORSEPARATION);
+ if(!isset($json[1])){
+
+ throw new Exception("Failed to get data object");
+ }
- // if we encounter a white line thats longer than 45px
- // we found the circle position
- $iterator = $im->getPixelRegionIterator(0, 77, 310, 1);
+ $json =
+ $this->fuckhtml
+ ->parseJsObject(
+ $json[1]
+ );
- $found = null;
foreach(
- $iterator as $row
+ $json[1]
+ ["data"]
+ ["body"]
+ ["response"]
+ ["results"]
+ as $result
){
- $whitecount = 0;
- $count = 0;
-
- foreach($row as $pixel){
-
- if($pixel->getColor()["r"] === 255){
-
- $whitecount++;
- $pixel->setColor("rgba(255,0,0,0)");
-
- if($whitecount === 45){
-
- $found = $count - 45;
- break 2;
- }
- }else{
-
- $whitecount = 0;
- }
-
- $count++;
- $iterator->syncIterator();
- }
+ $out["image"][] = [
+ "title" => $result["title"],
+ "source" => [
+ [
+ "url" => $result["properties"]["url"],
+ "width" => null,
+ "height" => null
+ ],
+ [
+ "url" => $result["thumbnail"]["src"],
+ "width" => null,
+ "height" => null
+ ]
+ ],
+ "url" => $result["url"]
+ ];
}
- $found = $found + 10;
+ return $out;
+ }
+
+ public function video($get){
- //header("Content-Type: image/png");
- //echo $im;
- //die();
+ $search = $get["s"];
+ $country = $get["country"];
+ $nsfw = $get["nsfw"];
+
+ $out = [
+ "status" => "ok",
+ "npt" => null,
+ "video" => [],
+ "author" => [],
+ "livestream" => [],
+ "playlist" => [],
+ "reel" => []
+ ];
- if($found === null){
+ try{
+ $html =
+ $this->get(
+ "https://search.brave.com/videos",
+ [
+ "q" => $search
+ ],
+ $nsfw,
+ $country
+ );
+
+ }catch(Exception $error){
- throw new Exception("Could not bypass captcha");
+ throw new Exception("Could not fetch search page");
}
+ /*
+ $handle = fopen("scraper/brave-video.html", "r");
+ $html = fread($handle, filesize("scraper/brave-video.html"));
+ fclose($handle);*/
preg_match(
- '/data="{&#34;captcha_id&#34;:&#34;([0-9A-z-]+)&#34;}"/',
+ '/const data = (\[{.*}\]);/',
$html,
- $key
+ $json
);
- $key = $key[1];
- // we bypassed captcha, send POST data
- $order =
- $this->get(
- "https://search.brave.com/api/captcha?brave=0&captcha_id={$key}",
- [
- "solution" => (string)$found
- ],
- $nsfw,
- $country,
- true
- );
-
- $order = json_decode($order, true)["orderId"];
+ if(!isset($json[1])){
+
+ throw new Exception("Failed to get data object");
+ }
- $orderpayload =
- $this->get(
- "https://search.brave.com/api/rewards/v1/orders/{$order}",
- [],
- $nsfw,
- $country
+ $json =
+ $this->fuckhtml
+ ->parseJsObject(
+ $json[1]
);
- $orderpayload = json_decode($orderpayload, true);
-
- $creds =
- $this->get(
- "https://search.brave.com/api/rewards/v1/orders/{$order}/credentials",
- [
- "itemId" => $orderpayload["items"][0]["id"],
- "blindedCreds" => [
- "fuYAVcB/m7BU66vf3wkNGxJCSaRhshB9o+8km3F1h2c=",
- "uswvcWJuPK/1qFlVdzBP3eQd0+V1EQgfAtnEoMIK+Uk=",
- "fJWKGLBxl3Gyn4n9FjTLq1PjupfABT7Ni8MeB+iGzUs=",
- "Aq9enJ/VZP9GxQIza3n65ZK7xQhY4VwDxv53BCb/Txg=",
- "FMJA9eSLHq71K+Pcwgm4gIQOmdR/6KMy5cMgXhpd5Ro=",
- "2NVhIAbvI317SP9/xXbVe/U57eWgvHyqVbHL/5+Gdmw=",
- "6mpjsjSCmYEzK2xlbL8DI2P4LuhWUOxjTLvsTAL9l24=",
- "kAn4wuHvIlKWhfuFfPTSfD4tZ5le9t7/61YbdEc/L3k=",
- "BjjUyG16aTfd1c0h4oBzgQQOekrH1f+a5CmcXqMPTR4=",
- "SBNgpCt4/V44yaQTfh+D027Yv1GJFHkjUEpPw6rAwRI=",
- "XDENAtdQ7PyYx+Qx1wQGQtDWgg8WpIMgWGmd4RDOVWE=",
- "tF7rB4sqamsiUk3K7fojdQSI0Q6iip72yKyhnvg/bC0=",
- "VsAqflirAd/u4VsLdfRS2UvnH24ZNkFh6YN3DctLjzQ=",
- "MntLbXkoI0LdcisCbNazmooiHXJyX91L1KERDAu1JRU=",
- "TH6Zs8JBvFDbTDWgKbfGE4M5/cSwCtHD8ms5Y/U8zHQ=",
- "jsZg0Z+qDPHymrbhdnesodhLNJ26QdunyMko1aVe4So=",
- "rpKsyj6/vdnuMgLI2BApeijtGq9g5USRDL0w6X2bnlQ=",
- "vCzliGT8A9vcLXj2sFf2kavOuYw69d70NpfgA22B4lI=",
- "7OWoxSCtYXWcaBSifF7AXNBif/sjcuO0IelzXG/3PFk=",
- "iiXtByNlT6nDMN9De5B58Jl8J0p6LCjnZ9aS3w2FEQU=",
- "zDhd7gsJ4h4JkDeGK0Y0mfFd8IBdkLhMOANzwO+4Dig=",
- "qANZ+AikwFReEA61JF009d/c3IHM/aSfIYwljckhJWE=",
- "nNC30pDLxtXvUr+WDwfDSrAInNBpfSZkPsV2JlpheWI=",
- "kGXE1pkt25P71kdJzmKIg4+yMR1VA5wNmbpBb/FhJQ8=",
- "aLqPsY1Qiz2UCa2Jx3YNNt8r4JINMphks/43EiyZfXU=",
- "bHGYZoQARZEM5LdFF6B74PkRqNd9EKxzuTvGYxjq+hk=",
- "JOsYQjfE/9Y1u29hR+GvEkNyxUI8blgLhX1iJI/aGRQ=",
- "yKjHjH5j600TJD/3WPsA1N3OmItDLifdjlysq4H6NV0=",
- "9lTnUbsPp7BJ7XVN5/T4yGfzD9DJdqWB7xk72s19MAA=",
- "5KHG8iY45em7zDhO/HlI0ydcZ0Ubn+XSyjifMmy7qXM="
- ]
- ],
- $nsfw,
- $country,
- true
- );
+ foreach(
+ $json
+ [1]
+ ["data"]
+ ["body"]
+ ["response"]
+ ["results"]
+ as $result
+ ){
+
+ if($result["video"]["author"] != "null"){
+
+ $author = [
+ "name" => $result["video"]["author"]["name"] == "null" ? null : $result["video"]["author"]["name"],
+ "url" => $result["video"]["author"]["url"] == "null" ? null : $result["video"]["author"]["url"],
+ "avatar" => $result["video"]["author"]["img"] == "null" ? null : $result["video"]["author"]["img"]
+ ];
+ }else{
+
+ $author = [
+ "name" => null,
+ "url" => null,
+ "avatar" => null
+ ];
+ }
+
+ if($result["thumbnail"] != "null"){
+
+ $thumb = [
+ "url" => $result["thumbnail"]["original"],
+ "ratio" => "16:9"
+ ];
+ }else{
+
+ $thumb = [
+ "url" => null,
+ "ratio" => null
+ ];
+ }
+
+ $out["video"][] = [
+ "title" => $result["title"],
+ "description" => $result["description"] == "null" ? null : $this->titledots($result["description"]),
+ "author" => $author,
+ "date" => $result["age"] == "null" ? null : strtotime($result["age"]),
+ "duration" => $result["video"]["duration"] == "null" ? null : $this->hms2int($result["video"]["duration"]),
+ "views" => $result["video"]["views"] == "null" ? null : (int)$result["video"]["views"],
+ "thumb" => $thumb,
+ "url" => $result["url"]
+ ];
+ }
+
+ return $out;
+ }
+
+ private function hms2int($time){
- var_dump($creds);
+ $parts = explode(":", $time, 3);
+ $time = 0;
- sleep(2);
- $test =
- $this->get(
- "https://search.brave.com/api/rewards/v1/orders/{$order}/credentials",
- [],
- $nsfw,
- $country
- );
+ if(count($parts) === 3){
+
+ // hours
+ $time = $time + ((int)$parts[0] * 3600);
+ array_shift($parts);
+ }
- var_dump($test);
+ if(count($parts) === 2){
+
+ // minutes
+ $time = $time + ((int)$parts[0] * 60);
+ array_shift($parts);
+ }
- $html =
- $this->get(
- "https://search.brave.com/goggles",
- [
- "q" => "site:dailymotion.com my bloody valentine"
- ],
- $nsfw,
- $country,
- false,
- "__Secure-sku#brave-search-captcha=eyJ0eXBlIjoic2luZ2xlLXVzZSIsInZlcnNpb24iOjEsInNrdSI6ImJyYXZlLXNlYXJjaC1jYXB0Y2hhIiwicHJlc2VudGF0aW9uIjoiZXlKcGMzTjFaWElpT2lKaWNtRjJaUzVqYjIwL2MydDFQV0p5WVhabExYTmxZWEpqYUMxallYQjBZMmhoSWl3aWMybG5ibUYwZFhKbElqb2lNRzl0VDBneWQxZ3dTazkzU0VFMVJ6QTJaR1V5WjFOQ1dDdGhSM3B2Y2xsTVQwVTJZVVJtTUc5a1IweG1Wa3RhZEd0cU4xbHdia3BPT0VOVGNGbE5lVWR2YmpGRlNTOUhhMlZYU1RWNGQxTjJPWGxJTTNjOVBTSXNJblFpT2lKWlJWWldaVzR5TTJwQ01tSnZkakJ2U1hGNGJtSndUMGxEUW5Kd1drRjBRbWQxVnpoRlNURTNVREY2UVRaQlpUTXJSVGRFYm5NeVFqUmhka0pGYTFWM2FGY3JWRVZJVjNWcE9TdFllRU1yYlVSTVkyMTBRVDA5SW4wPSJ9"
- );
+ // seconds
+ $time = $time + (int)$parts[0];
- var_dump($html);
- }*/
+ return $time;
+ }
private function appendtext($payload, &$text, &$index){
diff --git a/scraper/google.php b/scraper/google.php
index 28ede6d..af243ba 100644
--- a/scraper/google.php
+++ b/scraper/google.php
@@ -808,6 +808,7 @@ class google{
->getElementsByTagName("style");
$this->computedstyle = [];
+ $this->ask = [];
foreach($styles as $style){
@@ -860,6 +861,22 @@ class google{
$image_grep[1][0]
);
}
+
+ // even more javascript crap
+ // "People also ask" node is loaded trough javascript
+ preg_match_all(
+ '/window\.jsl\.dh\(\'([^\']+)\',\'(.+)\'\);/',
+ $script["innerHTML"],
+ $ask_grep
+ );
+
+ for($i=0; $i<count($ask_grep[0]); $i++){
+
+ $this->ask[trim($ask_grep[1][$i])] =
+ stripcslashes(
+ $ask_grep[2][$i]
+ );
+ }
}
// get nodes
@@ -926,22 +943,22 @@ class google{
"div"
);
- $carousel_title =
- $this->fuckhtml
- ->getElementsByClassName(
- $this->findstyles(
- [
- "font-size" => "16px",
- "line-height" => "20px",
- "font-weight" => "400"
- ],
- self::is_class
- ),
- "div"
- );
-
if(count($carousel) !== 0){
+ $carousel_title =
+ $this->fuckhtml
+ ->getElementsByClassName(
+ $this->findstyles(
+ [
+ "font-size" => "16px",
+ "line-height" => "20px",
+ "font-weight" => "400"
+ ],
+ self::is_class
+ ),
+ "div"
+ );
+
$sublink = []; // twitter carousel sublinks
foreach($carousel as $item){
@@ -1212,6 +1229,136 @@ class google{
continue;
}
+ $people_title =
+ $this->fuckhtml
+ ->getElementsByClassName(
+ $this->findstyles(
+ [
+ "font-weight" => "bold",
+ "font-size" => "16px",
+ "color" => "#000",
+ "margin" => "0",
+ "padding" => "12px 16px 0 16px"
+ ],
+ self::is_class
+ ),
+ "div"
+ );
+
+ if(
+ count($people_title) !== 0 &&
+ strtolower(
+ $this->fuckhtml
+ ->getTextContent(
+ $people_title[0]
+ )
+ ) == "people also ask"
+ ){
+ /*
+ Parse "people also ask" node
+ */
+
+ $div =
+ $this->fuckhtml
+ ->getElementsByTagName("div");
+
+ // add suggestions
+ $suggestions =
+ $this->fuckhtml
+ ->getElementsByClassName(
+ $this->findstyles(
+ [
+ "display" => "inline-block",
+ "padding-right" => "26px"
+ ],
+ self::is_class
+ ),
+ $div
+ );
+
+ foreach($suggestions as $suggestion){
+
+ $out["related"][] =
+ $this->fuckhtml
+ ->getTextContent($suggestion);
+ }
+
+ // parse websites
+ foreach($div as $d){
+
+ if(
+ isset($d["attributes"]["id"]) &&
+ strpos(
+ $d["attributes"]["id"],
+ "accdef_"
+ ) !== false
+ ){
+
+ $this->fuckhtml->load(
+ $this->ask[
+ $d["attributes"]["id"]
+ ]
+ );
+
+ $description =
+ $this->titledots(
+ $this->fuckhtml
+ ->getTextContent(
+ $this->fuckhtml
+ ->getElementsByClassName(
+ $this->findstyles(
+ [
+ "white-space" => "pre-line",
+ "word-wrap" => "break-word"
+ ],
+ self::is_class
+ ),
+ "div"
+ )[0]
+ )
+ );
+
+ $a =
+ $this->fuckhtml
+ ->getElementsByTagName("a")
+ [0];
+
+ $this->fuckhtml->load($a);
+
+ $out["web"][] = [
+ "title" =>
+ $this->titledots(
+ $this->fuckhtml
+ ->getTextContent(
+ $this->fuckhtml
+ ->getElementsByTagName("span")[0]
+ )
+ ),
+ "description" => $description,
+ "url" =>
+ $this->decodeurl(
+ $this->fuckhtml
+ ->getTextContent(
+ $a
+ ["attributes"]
+ ["href"]
+ )
+ ),
+ "date" => null,
+ "type" => "web",
+ "thumb" => [
+ "url" => null,
+ "ratio" => null
+ ],
+ "sublink" => [],
+ "table" => []
+ ];
+ }
+ }
+
+ continue;
+ }
+
if(count($title) !== 0){
/*
@@ -1231,6 +1378,19 @@ class google{
"url" => $this->getimage($thumb[0]["attributes"]["id"]),
"ratio" => "1:1"
];
+
+ if(parse_url($thumb["url"], PHP_URL_HOST) == "i.ytimg.com"){
+
+ $thumb = [
+ "url" =>
+ str_replace(
+ "default.jpg",
+ "maxresdefault.jpg",
+ $thumb["url"]
+ ),
+ "ratio" => "16:9"
+ ];
+ }
}else{
$thumb = [
@@ -1287,18 +1447,33 @@ class google{
$cat = explode(":", $cat, 2);
- $table[
+ $name =
$this->fuckhtml
->getTextContent(
$cat[0]
- )
- ] =
- $this->titledots(
- $this->fuckhtml
- ->getTextContent(
- $cat[1]
- )
);
+
+ if(strtolower($name) != "posted"){
+
+ $table[$name] =
+ $this->titledots(
+ $this->fuckhtml
+ ->getTextContent(
+ $cat[1]
+ )
+ );
+ }else{
+
+ $date =
+ strtotime(
+ $this->titledots(
+ $this->fuckhtml
+ ->getTextContent(
+ $cat[1]
+ )
+ )
+ );
+ }
}
continue;
}
@@ -1307,6 +1482,7 @@ class google{
$this->fuckhtml
->getElementsByTagName("span");
+ $encounter_rating = false;
foreach($spans as $span){
// replace element with nothing
@@ -1319,10 +1495,53 @@ class google{
);
}
+ if($encounter_rating !== false){
+
+ switch($encounter_rating){
+
+ case 3:
+ $table["Votes"] =
+ number_format(
+ str_replace(
+ [
+ "(",
+ ")",
+ ","
+ ],
+ "",
+ $this->fuckhtml
+ ->getTextContent(
+ $span["innerHTML"]
+ )
+ )
+ );
+ break;
+
+ case 6:
+ $table["Price"] =
+ $this->fuckhtml
+ ->getTextContent(
+ $span["innerHTML"]
+ );
+ break;
+
+ case 8:
+ $table["Support"] =
+ $this->fuckhtml
+ ->getTextContent(
+ $span["innerHTML"]
+ );
+ break;
+ }
+
+ $encounter_rating++;
+ }
+
// get rating
if(isset($span["attributes"]["aria-hidden"])){
$table["Rating"] = $span["innerHTML"];
+ $encounter_rating = 0;
continue;
}
}
@@ -1565,16 +1784,7 @@ class google{
}
/*
- Detect if its a wikipedia thing
- */
- $h3 =
- $this->fuckhtml
- ->getElementsByTagName("h3");
-
-
-
- /*
- Fallback to parsing the word definitions
+ Parse instant answers with parts
*/
$parts =
$this->fuckhtml
@@ -1588,15 +1798,8 @@ class google{
"div"
);
- if(count($parts) === 0){
-
- continue;
- }
-
- $head = $parts[0];
+ if(count($parts) !== 0){
- if(count($h3) !== 0){
-
$table = [
"title" => null,
"description" => [],
@@ -1606,30 +1809,130 @@ class google{
"sublink" => []
];
- $h3 = $h3[0];
-
- $table["title"] =
+ // get thumb
+ $thumb =
$this->fuckhtml
- ->getTextContent(
- $h3
+ ->getElementsByClassName(
+ $this->findstyles(
+ [
+ "float" => "right",
+ "padding-left" => "16px"
+ ],
+ self::is_class
+ ),
+ "div"
);
+
+ if(count($thumb) !== 0){
+
+ $this->fuckhtml->load($thumb[0]);
+
+ $img =
+ $this->fuckhtml
+ ->getElementsByTagName("img");
+
+ if(count($img) !== 0){
+
+ $table["thumb"] =
+ $this->getimage(
+ $img[0]["attributes"]["id"]
+ );
+ }
+
+ $this->fuckhtml->load($container);
+ }
- $head["innerHTML"] =
- str_replace(
- $h3["outerHTML"],
- "",
- $head["innerHTML"]
+ $h =
+ $this->fuckhtml
+ ->getElementsByTagName("h3");
+
+ if(count($h) === 0){
+
+ $h =
+ $this->fuckhtml
+ ->getElementsByTagName("h2");
+ }
+
+ if(count($h) !== 0){
+ // set title + subtext for when a word definition
+ // appears
+ $h = $h[0];
+
+ $table["title"] =
+ $this->fuckhtml
+ ->getTextContent(
+ $h
+ );
+
+ $parts[0]["innerHTML"] =
+ str_replace(
+ $h["outerHTML"],
+ "",
+ $parts[0]["innerHTML"]
+ );
+
+ $table["description"][] =
+ [
+ "type" => "quote",
+ "value" =>
+ $this->fuckhtml
+ ->getTextContent(
+ $parts[0]
+ )
+ ];
+ }else{
+
+ // parse it as a wikipedia header
+
+ }
+
+ // get table elements
+ $tables =
+ $this->fuckhtml
+ ->getElementsByClassName(
+ $this->findstyles(
+ [
+ "display" => "table",
+ "width" => "100%",
+ "padding-right" => "16px",
+ "-webkit-box-sizing" => "border-box"
+ ],
+ self::is_class
+ ),
+ "div"
);
- $table["description"][] =
- [
- "type" => "quote",
- "value" =>
+ foreach($tables as $tbl){
+
+ $this->fuckhtml->load($tbl);
+
+ $images =
+ $this->fuckhtml
+ ->getElementsByTagName("img");
+
+ if(count($images) !== 0){
+
+ $image = $this->getimage($images[0]["attributes"]["id"]);
+
+ $text =
$this->fuckhtml
->getTextContent(
- $head
- )
- ];
+ $tbl
+ );
+
+ $table["description"][] = [
+ "type" => "link",
+ "value" => $text,
+ "url" => "?s=" . urlencode($text) . "&scraper=google"
+ ];
+
+ $table["description"][] = [
+ "type" => "image",
+ "url" => $image
+ ];
+ }
+
+ }
$audio =
$this->fuckhtml
@@ -1828,9 +2131,9 @@ class google{
}
}
}
+
+ $out["answer"][] = $table;
}
-
- $out["answer"][] = $table;
}
if($dmca_table){
@@ -2136,20 +2439,65 @@ class google{
$match
);
- if(count($match) !== 0){
+ if(count($match) === 0){
- if(!empty($match[1])){
-
- return urldecode($match[1]);
- }
+ return null;
+ }
+
+ $url = empty($match[1]) ? urldecode($match[2]) : urldecode($match[1]);
+
+ $domain = parse_url($url, PHP_URL_HOST);
+
+ if(
+ preg_match(
+ '/wikipedia.org$/',
+ $domain
+ )
+ ){
- if(!empty($match[2])){
-
- return urldecode($match[2]);
- }
+ // rewrite wikipedia mobile URLs to desktop
+ $url =
+ $this->replacedomain(
+ $url,
+ preg_replace(
+ '/([a-z0-9]+)(\.m\.)/',
+ '$1.',
+ $domain
+ )
+ );
}
- return null;
+ if(
+ preg_match(
+ '/imdb\.com$|youtube\.[^.]+$/',
+ $domain
+ )
+ ){
+
+ // rewrite imdb and youtube mobile URLs too
+ $url =
+ $this->replacedomain(
+ $url,
+ preg_replace(
+ '/^m\./',
+ "",
+ $domain
+ )
+ );
+
+ }
+
+ return $url;
+ }
+
+ private function replacedomain($url, $domain){
+
+ return
+ preg_replace(
+ '/(https?:\/\/)([^\/]+)/',
+ '$1' . $domain,
+ $url
+ );
}
private function titledots($title){
diff --git a/scraper/mojeek.php b/scraper/mojeek.php
index a0b5016..e7e8abc 100644
--- a/scraper/mojeek.php
+++ b/scraper/mojeek.php
@@ -909,6 +909,23 @@ class mojeek{
$a = $a[0];
+ $date =
+ explode(
+ " - ",
+ $this->fuckhtml
+ ->getTextContent(
+ $this->fuckhtml
+ ->getElementsByTagName(
+ "span"
+ )[0]
+ )
+ );
+
+ $date =
+ strtotime(
+ $date[count($date) - 1]
+ );
+
$out["news"][] = [
"title" =>
html_entity_decode(
@@ -918,20 +935,7 @@ class mojeek{
)
),
"description" => null,
- "date" =>
- strtotime(
- explode(
- " - ",
- $this->fuckhtml
- ->getTextContent(
- $this->fuckhtml
- ->getElementsByTagName(
- "span"
- )[0]
- ),
- 2
- )[1]
- ),
+ "date" => $date,
"thumb" => [
"url" => null,
"ratio" => null
diff --git a/settings.php b/settings.php
index 96c31c8..c2d06e7 100644
--- a/settings.php
+++ b/settings.php
@@ -70,10 +70,10 @@ $settings = [
"value" => "brave",
"text" => "Brave"
],
- //[
- // "value" => "google",
- // "text" => "Google"
- //],
+ /*[
+ "value" => "google",
+ "text" => "Google"
+ ],*/
[
"value" => "mojeek",
"text" => "Mojeek"
@@ -99,11 +99,15 @@ $settings = [
[
"value" => "yandex",
"text" => "Yandex"
- ]//,
- //[
- // "value" => "google",
- // "text" => "Google"
- //]
+ ],
+ [
+ "value" => "brave",
+ "text" => "Brave"
+ ]/*,
+ [
+ "value" => "google",
+ "text" => "Google"
+ ]*/
]
],
[
@@ -117,11 +121,15 @@ $settings = [
[
"value" => "ddg",
"text" => "DuckDuckGo"
- ]//,
- //[
- // "value" => "google",
- // "text" => "Google"
- //]
+ ],
+ [
+ "value" => "brave",
+ "text" => "Brave"
+ ]/*,
+ [
+ "value" => "google",
+ "text" => "Google"
+ ]*/
]
],
[
@@ -136,10 +144,10 @@ $settings = [
"value" => "brave",
"text" => "Brave"
],
- //[
- // "value" => "google",
- // "text" => "Google"
- //],
+ /*[
+ "value" => "google",
+ "text" => "Google"
+ ],*/
[
"value" => "mojeek",
"text" => "Mojeek"
@@ -219,7 +227,7 @@ echo
'<head>' .
'<meta http-equiv="Content-Type" content="text/html;charset=utf-8">' .
'<title>Settings</title>' .
- '<link rel="stylesheet" href="/static/style.css?v2">' .
+ '<link rel="stylesheet" href="/static/style.css">' .
'<meta name="viewport" content="width=device-width,initial-scale=1">' .
'<meta name="robots" content="index,follow">' .
'<link rel="icon" type="image/x-icon" href="/favicon.ico">' .
diff --git a/static/client.js b/static/client.js
index 545f0bc..89e9a5e 100644
--- a/static/client.js
+++ b/static/client.js
@@ -360,6 +360,23 @@ if(image_class !== null){
elem.getAttribute("data-json")
);
+ var imagesize = elem.getElementsByTagName("img")[0];
+
+ if(imagesize.complete){
+
+ var imagesize_w = imagesize.naturalWidth;
+ var imagesize_h = imagesize.naturalHeight;
+ }
+
+ for(var i=0; i<collection.length; i++){
+
+ if(collection[i].width === null){
+
+ collection[i].width = imagesize_w;
+ collection[i].height = imagesize_h;
+ }
+ }
+
var title = elem.title;
}
diff --git a/static/icon/amazon.png b/static/icon/amazon.png
index 75b52a7..85c9454 100644
--- a/static/icon/amazon.png
+++ b/static/icon/amazon.png
Binary files differ
diff --git a/static/icon/appstore.png b/static/icon/appstore.png
index 46a0be0..85663bb 100644
--- a/static/icon/appstore.png
+++ b/static/icon/appstore.png
Binary files differ
diff --git a/static/icon/facebook.png b/static/icon/facebook.png
index e40590c..794458d 100644
--- a/static/icon/facebook.png
+++ b/static/icon/facebook.png
Binary files differ
diff --git a/static/icon/gamespot.png b/static/icon/gamespot.png
index a5b781e..8c66a7d 100644
--- a/static/icon/gamespot.png
+++ b/static/icon/gamespot.png
Binary files differ
diff --git a/static/icon/github.png b/static/icon/github.png
index f0455f4..81ea36c 100644
--- a/static/icon/github.png
+++ b/static/icon/github.png
Binary files differ
diff --git a/static/icon/googleplay.png b/static/icon/googleplay.png
index f59ca3d..05ffc19 100644
--- a/static/icon/googleplay.png
+++ b/static/icon/googleplay.png
Binary files differ
diff --git a/static/icon/imdb.png b/static/icon/imdb.png
index 8ddb803..348c259 100644
--- a/static/icon/imdb.png
+++ b/static/icon/imdb.png
Binary files differ
diff --git a/static/icon/instagram.png b/static/icon/instagram.png
index f1bf8e6..db9cabe 100644
--- a/static/icon/instagram.png
+++ b/static/icon/instagram.png
Binary files differ
diff --git a/static/icon/itunes.png b/static/icon/itunes.png
index cf99ab4..b8652eb 100644
--- a/static/icon/itunes.png
+++ b/static/icon/itunes.png
Binary files differ
diff --git a/static/icon/microsoft.png b/static/icon/microsoft.png
index 830fadf..46d048a 100644
--- a/static/icon/microsoft.png
+++ b/static/icon/microsoft.png
Binary files differ
diff --git a/static/icon/quora.png b/static/icon/quora.png
index 2bcbb48..1b39044 100644
--- a/static/icon/quora.png
+++ b/static/icon/quora.png
Binary files differ
diff --git a/static/icon/reddit.png b/static/icon/reddit.png
index 8f24212..6522815 100644
--- a/static/icon/reddit.png
+++ b/static/icon/reddit.png
Binary files differ
diff --git a/static/icon/rottentomatoes.png b/static/icon/rottentomatoes.png
index 01f553a..dd462e7 100644
--- a/static/icon/rottentomatoes.png
+++ b/static/icon/rottentomatoes.png
Binary files differ
diff --git a/static/icon/sciencedirect.png b/static/icon/sciencedirect.png
index 17e03c0..20cef17 100644
--- a/static/icon/sciencedirect.png
+++ b/static/icon/sciencedirect.png
Binary files differ
diff --git a/static/icon/soundcloud.png b/static/icon/soundcloud.png
index 9c86c48..4e93f41 100644
--- a/static/icon/soundcloud.png
+++ b/static/icon/soundcloud.png
Binary files differ
diff --git a/static/icon/spotify.png b/static/icon/spotify.png
index 07fd1f3..c7a35ca 100644
--- a/static/icon/spotify.png
+++ b/static/icon/spotify.png
Binary files differ
diff --git a/static/icon/steam.png b/static/icon/steam.png
index 749ba3e..03671d9 100644
--- a/static/icon/steam.png
+++ b/static/icon/steam.png
Binary files differ
diff --git a/static/icon/twitter.png b/static/icon/twitter.png
index a6d4389..bce2863 100644
--- a/static/icon/twitter.png
+++ b/static/icon/twitter.png
Binary files differ
diff --git a/static/icon/w3html.png b/static/icon/w3html.png
index c010842..2f107db 100644
--- a/static/icon/w3html.png
+++ b/static/icon/w3html.png
Binary files differ
diff --git a/static/icon/website.png b/static/icon/website.png
index 02b2670..aa691f8 100644
--- a/static/icon/website.png
+++ b/static/icon/website.png
Binary files differ
diff --git a/static/icon/wikipedia.png b/static/icon/wikipedia.png
index 18cf9a0..7324c9e 100644
--- a/static/icon/wikipedia.png
+++ b/static/icon/wikipedia.png
Binary files differ
diff --git a/static/icon/youtube.png b/static/icon/youtube.png
index 6951c84..2e068c8 100644
--- a/static/icon/youtube.png
+++ b/static/icon/youtube.png
Binary files differ
diff --git a/template/home.html b/template/home.html
index 8ca6377..4e32ebc 100644
--- a/template/home.html
+++ b/template/home.html
@@ -14,7 +14,9 @@
<div id="center">
<form method="GET" autocomplete="off" action="web">
<div class="logo">
- <img src="{%banner%}" alt="4get">
+ <a href="/">
+ <img src="{%banner%}" alt="4get">
+ </a>
</div>
<div class="searchbox">
<input type="submit" value="Search" tabindex="-1">
@@ -28,9 +30,9 @@
<div class="subtext">
Clearnet: <a href="https://4get.ca">4get.ca</a><br>
Tor: <a href="http://4getwebfrq5zr4sxugk6htxvawqehxtdgjrbcn2oslllcol2vepa23yd.onion">4getwebfrq5zr4sxugk6htxvawqehxtdgjrbcn2oslllcol2vepa23yd.onion</a><br>
- Report a problem: <a href="https://lolcat.ca/contact">lolcat.ca/contact</a>
+ Report a problem: <a href="https://lolcat.ca">lolcat.ca</a>
</div>
</div>
- <script src="/static/client.js?v2"></script>
+ <script src="/static/client.js?v3"></script>
</body>
</html>
diff --git a/template/images.html b/template/images.html
index 61e319c..1c5b23a 100644
--- a/template/images.html
+++ b/template/images.html
@@ -2,6 +2,6 @@
{%images%}
</div>
{%nextpage%}
- <script src="/static/client.js?v2"></script>
+ <script src="/static/client.js?v3"></script>
</body>
</html>
diff --git a/template/search.html b/template/search.html
index c187102..5210807 100644
--- a/template/search.html
+++ b/template/search.html
@@ -11,6 +11,6 @@
{%left%}
</div>
</div>
- <script src="/static/client.js?v2"></script>
+ <script src="/static/client.js?v3"></script>
</body>
</html>