Skip to content

Commit

Permalink
Version 1.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
adegans committed Aug 27, 2024
1 parent ddf5c6d commit 015f73f
Show file tree
Hide file tree
Showing 34 changed files with 743 additions and 438 deletions.
18 changes: 10 additions & 8 deletions assets/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,15 @@ input[type="search"]::-webkit-search-cancel-button { -webkit-appearance:none; -w
.result-grid .result, .result-grid .meta { margin:0; padding:0; }

/* Magnet highlight/Share/Boxoffice popup */
.goosebox { display:none; position:fixed; inset:0; z-index:10000; overflow:auto; background-color:rgb(0, 0, 0, .75); }
.goosebox { display:none; position:fixed; inset:0; z-index:2; overflow:auto; background-color:rgb(0, 0, 0, .75); }
.goosebox.open { display:block; }
.goosebox-body { margin:50px auto; padding:20px; width:50%; background:var(--background-popup); border:1px solid var(--border); border-radius:10px; }
.goosebox-body h2 { padding:0 0 .3em 0; }
.goosebox-body h3 { font-size:1.2rem; }
.goosebox-body a { cursor:pointer; }
.goosebox-body a:visited { color:var(--link); }
.goosebox-body img { margin:0; padding:0 5px 5px 0; width:8em; border:0; border-radius:10px; float:left; }
.goosebox-body hr { clear:both; content:" "; border:0; }
.goosebox-body button { margin:5px auto; padding:5px 10px; width:100%; height:35px; border:1px solid var(--border-alt); border-radius:10px; color:var(--button-text); background-color:var(--button-bg); text-align:center; font-size:1rem; }
.goosebox-body button:hover { text-decoration:none; background-color:var(--button-hover); }
.goosebox-body .share-field, .goosebox-body .share-button { box-sizing:border-box; position:relative; padding:5px 10px; width:100%; height:40px; font-size:1rem; }
Expand All @@ -147,15 +149,14 @@ input[type="search"]::-webkit-search-cancel-button { -webkit-appearance:none; -w
/* Stats display (stats page) */
.statspage .content h1 { margin-bottom:10px; padding:0; text-align:center; font-size:2.5em; font-weight:400; }
.statspage .content h2 { margin-bottom:10px; padding:0; text-align:center; font-size:1.5em; }
.statspage p { font-family:'Courier New'; }
.statspage p { font-family:'American Typewriter', 'Courier New', serif; }

/* oAUTH page */
.oauthpage { background-color:var(--background-alt); color:var(--text-alt); }
.oauthpage .oauth-form { text-align:center; margin-top:20px; }
.oauthpage .oauth-form p, .oauth-form small { margin-bottom:15px; color:var(--text-alt); }
.oauthpage .oauth-form .field { padding:5px 10px; width:300px; color:#f0f6fc; background-color:var(--background-alt); font-size:1.2rem; border:1px solid var(--startpage-border); border-radius:10px; }
.oauthpage .oauth-buttons button { margin:30px 20px 10px 20px; padding:13px 10px; min-width:130px; color:var(--text-alt); background-color:var(--startpage-button-bg); border:1px solid var(--startpage-border); font-size:1.2rem; border-radius:6px; }
.oauthpage .oauth-buttons button:hover { border:1px solid var(--startpage-border-alt); background-color:var(--startpage-button-bg-alt); text-decoration:none; }
.oauth-form { margin-top:20px; }
.oauth-form p, .oauth-form small { margin-bottom:15px; color:var(--text-alt); }
.oauth-form .field { padding:5px 10px; width:300px; color:#f0f6fc; background-color:var(--background-alt); font-size:1.2rem; border:1px solid var(--startpage-border); border-radius:10px; }
.oauth-buttons button { margin:30px 0 10px 0; padding:13px 10px; min-width:130px; color:var(--text-alt); background-color:var(--startpage-button-bg); border:1px solid var(--startpage-border); font-size:1.2rem; border-radius:6px; }
.oauth-buttons button:hover { border:1px solid var(--startpage-border-alt); background-color:var(--startpage-button-bg-alt); text-decoration:none; }

/* Tooltips */
.tooltip-question::before { content:""; display:inline-block; width:1.1em; height:1.1em; background:var(--link); vertical-align:text-bottom; mask-image:url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pjxzdmcgdmlld0JveD0iMCAwIDI0IDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xMS4yOSwxNS4yOWExLjU4LDEuNTgsMCwwLDAtLjEyLjE1Ljc2Ljc2LDAsMCwwLS4wOS4xOC42NC42NCwwLDAsMC0uMDYuMTgsMS4zNiwxLjM2LDAsMCwwLDAsLjIuODQuODQsMCwwLDAsLjA4LjM4LjkuOSwwLDAsMCwuNTQuNTQuOTQuOTQsMCwwLDAsLjc2LDAsLjkuOSwwLDAsMCwuNTQtLjU0QTEsMSwwLDAsMCwxMywxNmExLDEsMCwwLDAtLjI5LS43MUExLDEsMCwwLDAsMTEuMjksMTUuMjlaTTEyLDJBMTAsMTAsMCwxLDAsMjIsMTIsMTAsMTAsMCwwLDAsMTIsMlptMCwxOGE4LDgsMCwxLDEsOC04QTgsOCwwLDAsMSwxMiwyMFpNMTIsN0EzLDMsMCwwLDAsOS40LDguNWExLDEsMCwxLDAsMS43MywxQTEsMSwwLDAsMSwxMiw5YTEsMSwwLDAsMSwwLDIsMSwxLDAsMCwwLTEsMXYxYTEsMSwwLDAsMCwyLDB2LS4xOEEzLDMsMCwwLDAsMTIsN1oiIGZpbGw9IiM2NTYzZmYiLz48L3N2Zz4='); }
Expand Down Expand Up @@ -191,6 +192,7 @@ input[type="search"]::-webkit-search-cancel-button { -webkit-appearance:none; -w

/* Misc */
.goosle-g { color:var(--color-accent); }
.plainpage { background-color:var(--background-alt); color:var(--text-alt); }
.green { color:var(--green); }
.red { color:var(--red); }
.yellow { color:var(--yellow); }
Expand Down
21 changes: 7 additions & 14 deletions box-office.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<div class="header">
<form action="results.php" method="get" autocomplete="off">
<h1 class="logo"><a href="./?a=<?php echo $opts->user_auth; ?>"><span class="goosle-g">G</span>oosle</a></h1>
<input tabindex="1" class="search-field" type="search" value="<?php echo (strlen($search->nice_query) > 0) ? htmlspecialchars($search->nice_query) : "" ; ?>" name="q" /><input tabindex="2" class="button" type="submit" value="Search" />
<input tabindex="1" class="search-field" type="search" value="<?php echo (strlen($search->query) > 0) ? htmlspecialchars($search->query) : "" ; ?>" name="q" /><input tabindex="2" class="button" type="submit" value="Search" />

<input type="hidden" name="t" value="<?php echo $search->type; ?>"/>
<input type="hidden" name="a" value="<?php echo $opts->user_auth; ?>">
Expand Down Expand Up @@ -140,19 +140,12 @@
<p class="text-center"><small>Goosle does not index, offer or distribute torrent files.</small></p>
</div>

<div class="footer grid-container">
<div class="footer-grid">
&copy; <?php echo the_date('Y'); ?> Goosle <?php echo $current_version; ?> <?php echo show_update_notification(); ?>
</div>
<div class="footer-grid">
<a href="./?a=<?php echo $opts->user_auth; ?>">Start</a> - <a href="./box-office.php?a=<?php echo $opts->user_auth; ?>&t=9">Box office</a> - <a href="./help.php?a=<?php echo $opts->user_auth; ?>">Help</a> - <a href="./stats.php?a=<?php echo $opts->hash; ?>">Stats</a>
</div>
</div>

<?php } else { ?>
<div class="auth-error">Redirecting</div>
<meta http-equiv="refresh" content="1; url=<?php echo get_base_url($opts->siteurl); ?>/error.php" />
<?php } ?>
<?php
include_once('footer.php');
} else {
include_once('error.php');
}
?>

</body>
</html>
27 changes: 26 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,30 @@
# Goosle
## The best Meta Search Engine to find everything

### 1.7.1 - August 26, 2024
- NOTICE: config.default.php has changed, update your config.php!!
- [new] Engine timeouts for specific response codes when a search engine returns some kind of error or quota limitation
- [new] Engine timeouts status page at /functions/timeout-status.php
- [new] GloTorrents (Glodls) Magnet results
- [new] Use multiple search overrides (eg: 'size:large safe:off goose gone wild')
- [fix] Search suggestions re-added and they now work (Scraped from Mojeek, Google, DuckduckGo and Yahoo Images)
- [fix] Limetorrents search query is now properly formatted
- [fix] Search overrides (Safe search, image size, etc.) trigger no longer included in search query
- [fix] Search query no longer sent out double encoded
- [fix] Strings (Search queries, seo texts, etc.) are now properly limited to max length where required
- [fix] Multiple currency conversions now also works when caching is enabled
- [fix] Multiple ip lookups (from different user IPs) now also works when caching is enabled
- [update] Oauth page no longer center aligned
- [update] Updated Language explanation in config.default.php
- [change] Moved footer code to footer.php
- [change] Redid error.php to only include the error html
- [change] Openverse adds image category tags to image alt text
- [change] Pixabay uses image tags as image alt text
- [change] Image alt text now has a 1.5x multiplier for result ranking (was 1x)
- [change] Added imdb.com link to Box office popup
- [change] Added movie poster to Box office popup
- [change] Simplified verified uploader popup text

### 1.7 - August 7, 2024
- NOTICE: config.default.php has changed, update your config.php!!
- [new] Mojeek search results
Expand All @@ -18,9 +42,10 @@
- [change] Replaced 'porn' with 'nsfw' for safe search switch
- [change] Removed 'xxx' as an keyword to disable safe search
- [change] Don't search on nyaa.si and YTS if you search with safemode off
- [change] Only search on sukebei.nyaa.si if you search with safemode off
- [change] Moved image size override into search object
- [change] Added a little space between rows for image results on mobile
- [change] Stats font is now 'Courier'
- [change] Stats font is now 'Courier New'
- [fix] Google search query not providing good results
- [fix] Search query not always properly urlencoded
- [removed] Removed search suggestions as they didn't work
Expand Down
22 changes: 13 additions & 9 deletions config.default.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,20 @@
/* ------------------------------------------------------------------------------------
LANGUAGE:
To not fit the USA mold, Goosle defaults to the United Kingdom for english results.
DuckDuckGo and Google are language agnostic.
DuckDuckGo and Google are mostly language agnostic.
Invalid values either cause the search engine to fail or will default to English depending on how wrong the value is.
Google has no language setting because as soon as you specify it all 'anonymous' settings stop working.
Google uses a search region and defaults to the United Kingdom. This usually applies to a country (us, uk, es, fr, nl, etc.)
DuckDuckGo uses language regions and defaults to the United Kingdom. To change it see if your region is available - https://duckduckgo.com/duckduckgo-help-pages/settings/params/.
Wikipedia needs to be told which language you want. This changes the search url. Use any of their supported languages (en, es, fr, nl, etc.)
DuckDuckGo uses language regions and defaults to the United Kingdom. A list of all regions: https://duckduckgo.com/duckduckgo-help-pages/settings/params/.
Qwant uses a locale similar to DuckDuckGo and defaults to the United Kingdom as well.
Available locales are: bg_bg, br_fr, ca_ad, ca_es, ca_fr, co_fr, cs_cz, cy_gb, da_dk, de_at, de_ch, de_de, ec_ca, el_gr, en_au, en_ca, en_gb, en_ie, en_my, en_nz, en_us, es_ad, es_ar, es_cl, es_co, es_es, es_mx, es_pe, et_ee, eu_es, eu_fr, fc_ca, fi_fi, fr_ad, fr_be, fr_ca, fr_ch, fr_fr, gd_gb, he_il, hu_hu, it_ch, it_it, ko_kr, nb_no, nl_be, nl_nl, pl_pl, pt_ad, pt_pt, ro_ro, sv_se, th_th, zh_cn, zh_hk.
Mojeek supports a few search regions: uk, de, fr, eu and '' (empty, no preference)
Wikipedia needs to be told which language you want. This changes the search url. Use any of their supported languages (en, es, fr, nl, etc.)
SOCIAL MEDIA RELEVANCE:
Show social media results lower in results if you don't value such results.
This includes websites like Facebook, Instagram, Twitter/X, Snapchat, TikTok, LinkedIn and Reddit.
Expand All @@ -90,13 +92,14 @@
Chrome may attract attention because of the lack of Chrome information (tracking) aside from the user agent. The search engine may know something is 'weird'.
Opera/Edge/Brave and many others use Chrome under the hood and are not a good pick for that reason.
Do not use user agents for mobile devices. Where possible Goosle explicitly tells the service it's a desktop computer to get a certain format for results.
Do NOT use user agents for mobile devices or tablets. Where possible Goosle explicitly tells the service it's a desktop computer to get a certain format for results.
Contradicting the request with a mobile user agent may get your banned.
MAGNET TRACKERS:
Add more or less magnet trackers to the list but keep at least five or so!
These are added to the magnet links Goosle creates by itself.
Generally you do not need to change these.
No one tracker knows everything, more trackers is usually better for faster discovery and downloads.
Some search engines only provide torrent hashes. Goosle then uses these magnets to create a magnet link.
Generally you do not need to change these unless you need some specific tracker.
------------------------------------------------------------------------------------ */

return (object) array(
Expand Down Expand Up @@ -138,6 +141,7 @@
'magnet' => array(
'limetorrents' => 'on', // Default: on (Anything)
'piratebay' => 'on', // Default: on (Anything)
'glotorrents' => 'on', // Default: on (Anything)
'yts' => 'on', // Default: on (Movies)
'eztv' => 'on', // Default: on (TV-Shows)
'nyaa' => 'on', // Default: on (Anime)
Expand Down Expand Up @@ -170,7 +174,7 @@
),

'show_nsfw_magnets' => 'off', // Default: off (Set to 'off' to try and hide adult content. Override with 'safe:off' or 'nsfw')
'show_zero_seeders' => 'off', // Default: off
'show_zero_seeders' => 'off', // Default: off (Set to 'off' to hide torrents with 0 seeds)
'show_yts_highlight' => 'on', // Default: off (Show latest YTS movies above Magnet search results)
'show_share_option' => 'on', // Default: on (Show a share option for Magnet results)
'piratebay_categories_blocked' => array(206, 210), // Default: 206, 210 (Comma separated numbers, see /engines/magnet/thepiratebay.php for all categories)
Expand Down
24 changes: 14 additions & 10 deletions engines/boxoffice/eztv.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Copyright 2023-2024 Arnan de Gans. All Rights Reserved.
*
* COPYRIGHT NOTICES AND ALL THE COMMENTS SHOULD REMAIN INTACT.
* By using this code you agree to indemnify Arnan de Gans from any
* By using this code you agree to indemnify Arnan de Gans from any
* liability that might arise from its use.
------------------------------------------------------------------------------------ */
function eztv_boxoffice($opts) {
Expand All @@ -17,15 +17,15 @@ function eztv_boxoffice($opts) {
return fetch_cached_results($opts->cache_type, $opts->hash, $api_url);
}

$response = do_curl_request(
$response = do_curl_request(
$api_url, // (string) Where?
array('Accept: application/json, */*;q=0.7', 'User-Agent: '.$opts->user_agents[0].';'), // (array) User agent + Headers
'get', // (string) post/get
null // (assoc array|null) Post body
);
$json_response = json_decode($response, true);
$results = $results_temp = array();

// No response
if(empty($json_response)) {
if($opts->querylog == 'on') querylog('BoxofficeEZTV', 'a', $api_url, 'No response', 0);
Expand All @@ -37,9 +37,11 @@ function eztv_boxoffice($opts) {
if($opts->querylog == 'on') querylog('BoxofficeEZTV', 'a', $api_url, 'No Results', 0);
return $results;
}

foreach($json_response['torrents'] as $result) {
$title = (!empty($result['title'])) ? sanitize($result['title']) : null;
$imdb = sanitize($result['imdb_id']);

$year = (!empty($result['date_released_unix'])) ? gmdate('Y', sanitize($result['date_released_unix'])) : null;
$hash = (!empty($result['hash'])) ? strtolower(sanitize($result['hash'])) : null;
$thumbnail = (!empty($result['small_screenshot'])) ? sanitize($result['small_screenshot']) : null;
Expand All @@ -54,9 +56,10 @@ function eztv_boxoffice($opts) {
// Add codec to quality
if(!empty($codec)) $quality = $quality.' '.$codec;

// Clean up show name
// Clean up show name and fix up the imdb ID
$title = (preg_match('/.+?(?=[0-9]{3,4}p|xvid|divx|(x|h)26(4|5))/i', $title, $clean_name)) ? $clean_name[0] : $title; // Break off show name before video resolution
$title = trim(str_replace(array('S0E0', 'S00E00'), '', $title)); // Strip spaces and empty season/episode indicator from name
$imdb = 'tt'.$imdb;

// Group the same episodes in one result
if(count($results) > 0) {
Expand All @@ -70,9 +73,9 @@ function eztv_boxoffice($opts) {
if($found_id !== false) {
// Add the download to a previous result
$results[$found_id]['magnet_links'][] = array(
'hash' => $hash,
'magnet' => $magnet_link,
'filesize' => $filesize,
'hash' => $hash,
'magnet' => $magnet_link,
'filesize' => $filesize,
'quality' => $quality,
'audio' => $audio
);
Expand All @@ -83,11 +86,12 @@ function eztv_boxoffice($opts) {
$results[$result_id] = array (
'id' => $result_id, // string
'title' => $title, // string
'imdb_id' => $imdb, // string
'year' => $year, // int(4)
'thumbnail' => $thumbnail, // string
'magnet_links' => array(array( // Yes, two array (For merging results)...
'hash' => $hash, // string
'magnet' => $magnet_link, // string
'magnet' => $magnet_link, // string
'filesize' => $filesize, // int
'quality' => $quality, // string
'audio' => $audio // string
Expand All @@ -107,4 +111,4 @@ function eztv_boxoffice($opts) {

return $results;
}
?>
?>
22 changes: 12 additions & 10 deletions engines/boxoffice/yts.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Copyright 2023-2024 Arnan de Gans. All Rights Reserved.
*
* COPYRIGHT NOTICES AND ALL THE COMMENTS SHOULD REMAIN INTACT.
* By using this code you agree to indemnify Arnan de Gans from any
* By using this code you agree to indemnify Arnan de Gans from any
* liability that might arise from its use.
------------------------------------------------------------------------------------ */
function yts_boxoffice($opts, $what) {
Expand All @@ -17,7 +17,7 @@ function yts_boxoffice($opts, $what) {
return fetch_cached_results($opts->cache_type, $opts->hash, $api_url);
}

$response = do_curl_request(
$response = do_curl_request(
$api_url, // (string) Where?
array('Accept: application/json, */*;q=0.7', 'User-Agent: '.$opts->user_agents[0].';'), // (array) User agent + Headers
'get', // (string) post/get
Expand All @@ -40,6 +40,7 @@ function yts_boxoffice($opts, $what) {

foreach($json_response['data']['movies'] as $result) {
$title = sanitize($result['title']);
$imdb = sanitize($result['imdb_code']);

$year = (!empty($result['year'])) ? sanitize($result['year']) : 0;
$category = (!empty($result['genres'])) ? $result['genres'] : null;
Expand All @@ -55,7 +56,7 @@ function yts_boxoffice($opts, $what) {
if(is_array($category)) {
// Block these categories
if(count(array_uintersect($category, $opts->yts_categories_blocked, 'strcasecmp')) > 0) continue;

// Set actual category
$category = sanitize(implode(', ', $category));
}
Expand All @@ -76,10 +77,10 @@ function yts_boxoffice($opts, $what) {
if(!empty($bitrate)) $quality = $quality.' '.$bitrate.'bit';

$downloads[] = array (
'hash' => $hash,
'magnet' => $magnet,
'filesize' => $filesize,
'type' => $type,
'hash' => $hash,
'magnet' => $magnet,
'filesize' => $filesize,
'type' => $type,
'quality' => $quality,
'audio' => $audio
);
Expand All @@ -91,6 +92,7 @@ function yts_boxoffice($opts, $what) {
$results[$result_id] = array (
'id' => $result_id, // Semi random string to separate results
'title' => $title, // string
'imdb_id' => $imdb, // string
'year' => $year, // int(4)
'category' => $category, // string|null
'language' => $language, // string|null
Expand All @@ -100,8 +102,8 @@ function yts_boxoffice($opts, $what) {
'thumbnail' => $thumbnail, // string|empty
'magnet_links' => $downloads // array
);
unset($result, $title, $thumbnail, $year, $category, $language, $rating, $url, $summary, $downloads);

unset($result, $title, $imdb, $thumbnail, $year, $category, $language, $rating, $url, $summary, $downloads);
}
unset($response, $json_response);

Expand All @@ -114,4 +116,4 @@ function yts_boxoffice($opts, $what) {

return $results;
}
?>
?>
Loading

0 comments on commit 015f73f

Please sign in to comment.