Synced
youtube scraper rewrite (c7165e0658) use mqdefault cause the other endpoint cucks me with blurry thumbnails (0cc5a85399) apparently mqdefault sucks too, gotta pull the highres thumbnail fix your shit google (f95485a17a) well i guess you guys are gonna need to deal with blurry thumbnails cause maxresdefault is not always available either and black bars sucks even more so fuck this (0e01969075) table generator for readme, fix broken autocomplete (e789e7ef04)
This commit is contained in:
parent
0cf2aeaa4e
commit
5a3485ba2c
4 changed files with 698 additions and 946 deletions
25
README.md
25
README.md
|
|
@ -22,21 +22,20 @@ tl;dr FOSS-Q is the best way to browse for stuff.
|
||||||
| Brave | Yandex | Vimeo | Brave | Swisscows | DuckDuckGo |
|
| Brave | Yandex | Vimeo | Brave | Swisscows | DuckDuckGo |
|
||||||
| Yandex | Brave | Sepia Search | Google | | Yandex |
|
| Yandex | Brave | Sepia Search | Google | | Yandex |
|
||||||
| Google | Google | DuckDuckGo | Yahoo! JAPAN | | Google |
|
| Google | Google | DuckDuckGo | Yahoo! JAPAN | | Google |
|
||||||
| Google API | Google API | Brave | Startpage | | Startpage |
|
| Google API | Google API | Brave | Startpage | | Qwant |
|
||||||
| Google CSE | Google CSE | Yandex | Qwant | | Kagi |
|
| Google CSE | Google CSE | Yandex | Baidu | | Marginalia |
|
||||||
| Yahoo! JAPAN | Yahoo! JAPAN | Google | Mojeek | | Qwant |
|
| Yahoo! JAPAN | Yahoo! JAPAN | Google | | | YouTube |
|
||||||
| Startpage | Startpage | Yahoo! JAPAN | Baidu | | Ghostery |
|
| Startpage | Startpage | Yahoo! JAPAN | | | SoundCloud |
|
||||||
| Qwant | Qwant | Startpage | | | Yep |
|
| Yep | Naver | Startpage | | | Startpage |
|
||||||
| Ghostery | Baidu | Qwant | | | Marginalia |
|
| Mwmbl | Baidu | Naver | | | Kagi |
|
||||||
| Yep | Solofield | Baidu | | | YouTube |
|
| Mojeek | Solofield | Baidu | | | |
|
||||||
| Mwmbl | Pinterest | Coc Coc | | | SoundCloud |
|
| Naver | Pinterest | Cốc Cốc | | | |
|
||||||
| Mojeek | Cara | Solofield | | | |
|
| Baidu | Flickr | Purili | | | |
|
||||||
| Baidu | Flickr | | | | |
|
| Cốc Cốc | Pexels | Solofield | | | |
|
||||||
| Coc Coc | Pexels | | | | |
|
|
||||||
| Solofield | Pixabay | | | | |
|
| Solofield | Pixabay | | | | |
|
||||||
| Marginalia | Unsplash | | | | |
|
| Marginalia | Unsplash | | | | |
|
||||||
| wiby | 500px | | | | |
|
| Purili | 500px | | | | |
|
||||||
| | VSCO | | | | |
|
| wiby | VSCO | | | | |
|
||||||
| | Imgur | | | | |
|
| | Imgur | | | | |
|
||||||
| | FindThatMeme | | | | |
|
| | FindThatMeme | | | | |
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,13 +15,11 @@ class autocomplete{
|
||||||
"yandex" => "https://suggest.yandex.com/suggest-ff.cgi?part={searchTerms}&uil=en&v=3&sn=5&lr=21276&yu=4861394161661655015",
|
"yandex" => "https://suggest.yandex.com/suggest-ff.cgi?part={searchTerms}&uil=en&v=3&sn=5&lr=21276&yu=4861394161661655015",
|
||||||
"google" => "https://www.google.com/complete/search?client=mobile-gws-lite&q={searchTerms}",
|
"google" => "https://www.google.com/complete/search?client=mobile-gws-lite&q={searchTerms}",
|
||||||
"qwant" => "https://api.qwant.com/v3/suggest/?q={searchTerms}&client=opensearch",
|
"qwant" => "https://api.qwant.com/v3/suggest/?q={searchTerms}&client=opensearch",
|
||||||
"yep" => "https://api.yep.com/ac/?query={searchTerms}",
|
|
||||||
"marginalia" => "https://search.marginalia.nu/suggest/?partial={searchTerms}",
|
"marginalia" => "https://search.marginalia.nu/suggest/?partial={searchTerms}",
|
||||||
"yt" => "https://suggestqueries-clients6.youtube.com/complete/search?client=youtube&q={searchTerms}",
|
"yt" => "https://suggestqueries-clients6.youtube.com/complete/search?client=youtube&q={searchTerms}",
|
||||||
"sc" => "",
|
"sc" => "",
|
||||||
"startpage" => "https://www.startpage.com/suggestions?q={searchTerms}&format=opensearch&segment=startpage.defaultffx&lui=english",
|
"startpage" => "https://www.startpage.com/suggestions?q={searchTerms}&format=opensearch&segment=startpage.defaultffx&lui=english",
|
||||||
"kagi" => "https://kagi.com/api/autosuggest?q={searchTerms}",
|
"kagi" => "https://kagi.com/api/autosuggest?q={searchTerms}"
|
||||||
"ghostery" => "https://ghosterysearch.com/suggest?q={searchTerms}"
|
|
||||||
];
|
];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
151
extra/gen_table.php
Normal file
151
extra/gen_table.php
Normal file
|
|
@ -0,0 +1,151 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$scrapers = [
|
||||||
|
"web" => [
|
||||||
|
"DuckDuckGo",
|
||||||
|
"Brave",
|
||||||
|
"Yandex",
|
||||||
|
"Google",
|
||||||
|
"Google API",
|
||||||
|
"Google CSE",
|
||||||
|
"Yahoo! JAPAN",
|
||||||
|
"Startpage",
|
||||||
|
"Yep",
|
||||||
|
"Mwmbl",
|
||||||
|
"Mojeek",
|
||||||
|
"Naver",
|
||||||
|
"Baidu",
|
||||||
|
"Cốc Cốc",
|
||||||
|
"Solofield",
|
||||||
|
"Marginalia",
|
||||||
|
"Purili",
|
||||||
|
"wiby"
|
||||||
|
],
|
||||||
|
"images" => [
|
||||||
|
"DuckDuckGo",
|
||||||
|
"Yandex",
|
||||||
|
"Brave",
|
||||||
|
"Google",
|
||||||
|
"Google API",
|
||||||
|
"Google CSE",
|
||||||
|
"Yahoo! JAPAN",
|
||||||
|
"Startpage",
|
||||||
|
"Naver",
|
||||||
|
"Baidu",
|
||||||
|
"Solofield",
|
||||||
|
"Pinterest",
|
||||||
|
"Flickr",
|
||||||
|
"Pexels",
|
||||||
|
"Pixabay",
|
||||||
|
"Unsplash",
|
||||||
|
"500px",
|
||||||
|
"VSCO",
|
||||||
|
"Imgur",
|
||||||
|
"FindThatMeme"
|
||||||
|
],
|
||||||
|
"videos" => [
|
||||||
|
"YouTube",
|
||||||
|
"Vimeo",
|
||||||
|
"Sepia Search",
|
||||||
|
"DuckDuckGo",
|
||||||
|
"Brave",
|
||||||
|
"Yandex",
|
||||||
|
"Google",
|
||||||
|
"Yahoo! JAPAN",
|
||||||
|
"Startpage",
|
||||||
|
"Naver",
|
||||||
|
"Baidu",
|
||||||
|
"Cốc Cốc",
|
||||||
|
"Purili",
|
||||||
|
"Solofield"
|
||||||
|
],
|
||||||
|
"news" => [
|
||||||
|
"DuckDuckGo",
|
||||||
|
"Brave",
|
||||||
|
"Google",
|
||||||
|
"Yahoo! JAPAN",
|
||||||
|
"Startpage",
|
||||||
|
"Baidu"
|
||||||
|
],
|
||||||
|
"music" => [
|
||||||
|
"SoundCloud",
|
||||||
|
"Swisscows"
|
||||||
|
],
|
||||||
|
"autocomplete" => [
|
||||||
|
"Brave",
|
||||||
|
"DuckDuckGo",
|
||||||
|
"Yandex",
|
||||||
|
"Google",
|
||||||
|
"Qwant",
|
||||||
|
"Marginalia",
|
||||||
|
"YouTube",
|
||||||
|
"SoundCloud",
|
||||||
|
"Startpage",
|
||||||
|
"Kagi"
|
||||||
|
]
|
||||||
|
];
|
||||||
|
|
||||||
|
$lines = [
|
||||||
|
0 => "",
|
||||||
|
1 => ""
|
||||||
|
];
|
||||||
|
|
||||||
|
// get longest scraper string
|
||||||
|
// also get list of scrapers with most entries
|
||||||
|
$biggest_category_len = 0;
|
||||||
|
foreach($scrapers as $category_name => $category){
|
||||||
|
|
||||||
|
$count = count($category);
|
||||||
|
|
||||||
|
if($count > $biggest_category_len){
|
||||||
|
|
||||||
|
$biggest_category_len = $count;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach($scrapers as $category_name => $category){
|
||||||
|
|
||||||
|
// get longest string of the category
|
||||||
|
$longest_len = mb_strlen($category_name);
|
||||||
|
foreach($category as $scraper){
|
||||||
|
|
||||||
|
$strlen = mb_strlen($scraper);
|
||||||
|
|
||||||
|
if($strlen > $longest_len){
|
||||||
|
|
||||||
|
$longest_len = $strlen;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// add header
|
||||||
|
$lines[0] .= mb_str_pad("| {$category_name}", $longest_len + 3);
|
||||||
|
$lines[1] .= "|" . str_repeat("-", $longest_len + 2);
|
||||||
|
|
||||||
|
for($i=2; $i<count($category) + 2; $i++){
|
||||||
|
|
||||||
|
if(!isset($lines[$i])){
|
||||||
|
|
||||||
|
$lines[$i] = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
$lines[$i] .= mb_str_pad("| {$category[$i - 2]}", $longest_len + 3);
|
||||||
|
}
|
||||||
|
|
||||||
|
if($i - 2 < $biggest_category_len){
|
||||||
|
|
||||||
|
for($k=$i; $k<$biggest_category_len + 2; $k++){
|
||||||
|
|
||||||
|
if(!isset($lines[$k])){
|
||||||
|
|
||||||
|
$lines[$k] = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
$lines[$k] .= "|" . str_repeat(" ", $longest_len + 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach($lines as $line){
|
||||||
|
|
||||||
|
echo $line . "|\n";
|
||||||
|
}
|
||||||
1502
scraper/yt.php
1502
scraper/yt.php
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue