forked from friendica/friendica-addons
Compare commits
10 commits
eeb783d71d
...
1af97e5c9e
Author | SHA1 | Date | |
---|---|---|---|
Tobias Diekershoff | 1af97e5c9e | ||
Michael | 02a6fdd9a2 | ||
Tobias Diekershoff | d11efc108c | ||
Michael | d5dfa8028c | ||
Tobias Diekershoff | 3da448b01f | ||
Michael | 0fc8285f87 | ||
Tobias Diekershoff | 167b7f9466 | ||
Michael | ef7548f5bc | ||
Tobias Diekershoff | c9923e47de | ||
Hypolite Petovan | 6a9287dc6f |
|
@ -61,7 +61,7 @@ function blockbot_init_1()
|
||||||
'adscanner/', 'HeadlessChrome', 'wpif', 'startmebot/', 'Googlebot/', 'Applebot/',
|
'adscanner/', 'HeadlessChrome', 'wpif', 'startmebot/', 'Googlebot/', 'Applebot/',
|
||||||
'GoogleImageProxy', 'bingbot/', 'heritrix/', 'ldspider',
|
'GoogleImageProxy', 'bingbot/', 'heritrix/', 'ldspider',
|
||||||
'AwarioRssBot/', 'TweetmemeBot/', 'dcrawl/', 'PhantomJS/', 'Googlebot-Image/',
|
'AwarioRssBot/', 'TweetmemeBot/', 'dcrawl/', 'PhantomJS/', 'Googlebot-Image/',
|
||||||
'CrowdTanglebot/', 'Mediapartners-Google', 'Baiduspider/', 'datagnionbot',
|
'CrowdTanglebot/', 'Mediapartners-Google', 'Baiduspider', 'datagnionbot',
|
||||||
'MegaIndex.ru/', 'SMUrlExpander', 'Hatena-Favicon/', 'Wappalyzer', 'FlipboardProxy/',
|
'MegaIndex.ru/', 'SMUrlExpander', 'Hatena-Favicon/', 'Wappalyzer', 'FlipboardProxy/',
|
||||||
'NetcraftSurveyAgent/', 'Dataprovider.com', 'SMTBot/', 'Nimbostratus-Bot/',
|
'NetcraftSurveyAgent/', 'Dataprovider.com', 'SMTBot/', 'Nimbostratus-Bot/',
|
||||||
'DuckDuckGo-Favicons-Bot/', 'IndieWebCards/', 'proximic', 'netEstate NE Crawler',
|
'DuckDuckGo-Favicons-Bot/', 'IndieWebCards/', 'proximic', 'netEstate NE Crawler',
|
||||||
|
@ -80,7 +80,13 @@ function blockbot_init_1()
|
||||||
'YurichevBot/', 'Crawling at Home Project', 'InfoTigerBot/', 'AdIdxBot/',
|
'YurichevBot/', 'Crawling at Home Project', 'InfoTigerBot/', 'AdIdxBot/',
|
||||||
'MicrosoftPreview/', 'masscan/', 'Timpibot/', 'everyfeed-spider/', 'AndroidDownloadManager/',
|
'MicrosoftPreview/', 'masscan/', 'Timpibot/', 'everyfeed-spider/', 'AndroidDownloadManager/',
|
||||||
'WebZIP/', 'WDG_Validator/', 'Screaming Frog SEO Spider/', ' Bytespider;', 'ISSCyberRiskCrawler/',
|
'WebZIP/', 'WDG_Validator/', 'Screaming Frog SEO Spider/', ' Bytespider;', 'ISSCyberRiskCrawler/',
|
||||||
'BitSightBot/', 'ev-crawler/',
|
'BitSightBot/', 'ev-crawler/', 'CensysInspect/1.1', 'Protopage/', 'Gaisbot/', 'WellKnownBot/',
|
||||||
|
'SuperBot/', 'Googlebot-Mobile/', 'GPTBot/', 'GenomeCrawlerd/', '2ip bot/', 'Ocarinabot',
|
||||||
|
'Yahoo! Slurp;', 'AdsBot-Google', 'Gregarius/', 'FAST-WebCrawler/', 'Xenu Link Sleuth/',
|
||||||
|
'Ask Jeeves', 'alexa site audit/', 'Yahoo! Slurp China;', 'Microsoft URL Control',
|
||||||
|
'Facebot', 'Googlebot-Video/', 'msnbot/', 'Offline Explorer/', 'YandexNews/', 'msnbot-media/',
|
||||||
|
'EmailWolf', 'Download Demon/', 'FeedFetcher-Google;', 'WebCopier', '+ONB_Bot_Btrix',
|
||||||
|
'scoopit-crawler/'
|
||||||
];
|
];
|
||||||
|
|
||||||
if (DI::config()->get('blockbot', 'block_gab')) {
|
if (DI::config()->get('blockbot', 'block_gab')) {
|
||||||
|
@ -92,8 +98,9 @@ function blockbot_init_1()
|
||||||
'fediverse.space crawler', 'fediverse.network crawler', 'Active_Pods_CheckBot_3.0',
|
'fediverse.space crawler', 'fediverse.network crawler', 'Active_Pods_CheckBot_3.0',
|
||||||
'Social-Relay/', 'Test Certificate Info', 'Uptimebot/', 'GNUSocialBot', 'UptimeRobot/',
|
'Social-Relay/', 'Test Certificate Info', 'Uptimebot/', 'GNUSocialBot', 'UptimeRobot/',
|
||||||
'PTST/', 'Zabbix', 'Poduptime/', 'FediFetcher', 'lemmy-stats-crawler',
|
'PTST/', 'Zabbix', 'Poduptime/', 'FediFetcher', 'lemmy-stats-crawler',
|
||||||
'FedditLemmyverseCrawler/', 'kbinBot/', 'lemmy-explorer-crawler/', 'URIports Validator',
|
'FedditLemmyverseCrawler/', 'lemmy-explorer-crawler/', 'URIports Validator',
|
||||||
'rss-is-dead.lol web bot;',
|
'rss-is-dead.lol web bot;', 'fedistatsCrawler/', 'W3C_CSS_Validator_JFouffa/',
|
||||||
|
'IABot/', 'Slackbot 1', 'BeeperBot/', 'Matrix-Media-Repo/', 'P3P Validator',
|
||||||
];
|
];
|
||||||
|
|
||||||
if (!DI::config()->get('blockbot', 'good_crawlers')) {
|
if (!DI::config()->get('blockbot', 'good_crawlers')) {
|
||||||
|
@ -105,7 +112,9 @@ function blockbot_init_1()
|
||||||
// List of agents from social media systems that fetch preview data via opem graph or twitter cards.
|
// List of agents from social media systems that fetch preview data via opem graph or twitter cards.
|
||||||
$socialmedia_agents = ['Twitterbot', 'facebookexternalhit/', 'SkypeUriPreview Preview/',
|
$socialmedia_agents = ['Twitterbot', 'facebookexternalhit/', 'SkypeUriPreview Preview/',
|
||||||
'TelegramBot', 'WhatsApp/', 'github-camo', 'Bluesky Cardyb/', 'XING-contenttabreceiver/',
|
'TelegramBot', 'WhatsApp/', 'github-camo', 'Bluesky Cardyb/', 'XING-contenttabreceiver/',
|
||||||
'LinkedInBot/', 'Instagram ', 'Synapse (bot; ', 'Discordbot/', 'SummalyBot/'];
|
'LinkedInBot/', 'Instagram ', 'Synapse (bot; ', 'Discordbot/', 'SummalyBot/',
|
||||||
|
'Slackbot-LinkExpanding', 'Slack-ImgProxy', 'Iframely/',
|
||||||
|
];
|
||||||
|
|
||||||
if (!DI::config()->get('blockbot', 'socialmedia_agents')) {
|
if (!DI::config()->get('blockbot', 'socialmedia_agents')) {
|
||||||
$agents = array_merge($agents, $socialmedia_agents);
|
$agents = array_merge($agents, $socialmedia_agents);
|
||||||
|
@ -115,7 +124,8 @@ function blockbot_init_1()
|
||||||
|
|
||||||
// HTTP Libraries
|
// HTTP Libraries
|
||||||
$http_libraries = ['ReactorNetty/', 'GuzzleHttp/', 'Embed PHP library', 'python-urllib3/',
|
$http_libraries = ['ReactorNetty/', 'GuzzleHttp/', 'Embed PHP library', 'python-urllib3/',
|
||||||
'EventMachine HttpClient'];
|
'EventMachine HttpClient', 'HTMLParser/'
|
||||||
|
];
|
||||||
|
|
||||||
if (!DI::config()->get('blockbot', 'http_libraries')) {
|
if (!DI::config()->get('blockbot', 'http_libraries')) {
|
||||||
$agents = array_merge($agents, $http_libraries);
|
$agents = array_merge($agents, $http_libraries);
|
||||||
|
@ -150,7 +160,9 @@ function blockbot_init_1()
|
||||||
'W3C_Validator/', 'NetNewsWire', 'FeedValidator/', 'theoldreader.com', 'axios/',
|
'W3C_Validator/', 'NetNewsWire', 'FeedValidator/', 'theoldreader.com', 'axios/',
|
||||||
'Paw/', 'PeerTube/', 'fedi.inex.dev', 'FediDB/', 'index.community crawler',
|
'Paw/', 'PeerTube/', 'fedi.inex.dev', 'FediDB/', 'index.community crawler',
|
||||||
'Slackbot-LinkExpanding', 'Firefish/', 'Takahe/', 'Akkoma ', 'Misskey/', 'Lynx/',
|
'Slackbot-LinkExpanding', 'Firefish/', 'Takahe/', 'Akkoma ', 'Misskey/', 'Lynx/',
|
||||||
'camo-rs asset proxy', 'gotosocial/',
|
'camo-rs asset proxy', 'gotosocial/', 'incestoma ', 'SpaceCowboys Android RSS Reader',
|
||||||
|
'NewsBlur Feed Finder', 'Lemmy/', 'enby-town/', 'rss2tg bot;', '; HTTrack ',
|
||||||
|
'MbinBot', 'kbinBot', 'Pixelfed/'
|
||||||
];
|
];
|
||||||
|
|
||||||
if (blockbot_match($agents)) {
|
if (blockbot_match($agents)) {
|
||||||
|
|
|
@ -1358,6 +1358,7 @@ function bluesky_add_media(stdClass $embed, array $item, int $fetch_uid, int $le
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'app.bsky.embed.recordWithMedia#view':
|
case 'app.bsky.embed.recordWithMedia#view':
|
||||||
|
bluesky_add_media($embed->media, $item, $fetch_uid, $level, $last_poll);
|
||||||
$original_uri = $uri = bluesky_get_uri($embed->record->record);
|
$original_uri = $uri = bluesky_get_uri($embed->record->record);
|
||||||
$uri = bluesky_fetch_missing_post($uri, $item['uid'], $fetch_uid, Item::PR_FETCHED, $item['contact-id'], $level, $last_poll);
|
$uri = bluesky_fetch_missing_post($uri, $item['uid'], $fetch_uid, Item::PR_FETCHED, $item['contact-id'], $level, $last_poll);
|
||||||
if ($uri) {
|
if ($uri) {
|
||||||
|
|
|
@ -677,11 +677,20 @@ function tumblr_send_npf(array $post): bool
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$post['body'] = Post\Media::addAttachmentsToBody($post['uri-id'], $post['body']);
|
$post['body'] = Post\Media::addAttachmentsToBody($post['uri-id'], $post['body'], [Post\Media::IMAGE, Post\Media::AUDIO, Post\Media::VIDEO, Post\Media::ACTIVITY]);
|
||||||
if (!empty($post['title'])) {
|
if (!empty($post['title'])) {
|
||||||
$post['body'] = '[h1]' . $post['title'] . "[/h1]\n" . $post['body'];
|
$post['body'] = '[h1]' . $post['title'] . "[/h1]\n" . $post['body'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!empty($post['quote-uri-id'])) {
|
||||||
|
$quote = Post::selectFirstPost(['uri', 'plink'], ['uri-id' => $post['quote-uri-id']]);
|
||||||
|
if (!empty($quote)) {
|
||||||
|
if ((strpos($post['body'], $quote['plink'] ?: $quote['uri']) === false) && (strpos($post['body'], $quote['uri']) === false)) {
|
||||||
|
$post['body'] .= "\n[url]" . ($quote['plink'] ?: $quote['uri']) . "[/url]\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$params = [
|
$params = [
|
||||||
'content' => NPF::fromBBCode($post['body'], $post['uri-id']),
|
'content' => NPF::fromBBCode($post['body'], $post['uri-id']),
|
||||||
'state' => 'published',
|
'state' => 'published',
|
||||||
|
|
|
@ -47,7 +47,7 @@ function url_replace_addon_admin(string &$o)
|
||||||
{
|
{
|
||||||
$nitter_server = DI::config()->get('url_replace', 'nitter_server');
|
$nitter_server = DI::config()->get('url_replace', 'nitter_server');
|
||||||
$invidious_server = DI::config()->get('url_replace', 'invidious_server');
|
$invidious_server = DI::config()->get('url_replace', 'invidious_server');
|
||||||
$twelvefeet_sites = implode(PHP_EOL, DI::config()->get('url_replace', 'twelvefeet_sites'));
|
$twelvefeet_sites = implode(PHP_EOL, DI::config()->get('url_replace', 'twelvefeet_sites') ?? [] ?: []);
|
||||||
|
|
||||||
$t = Renderer::getMarkupTemplate('admin.tpl', 'addon/url_replace/');
|
$t = Renderer::getMarkupTemplate('admin.tpl', 'addon/url_replace/');
|
||||||
$o = Renderer::replaceMacros($t, [
|
$o = Renderer::replaceMacros($t, [
|
||||||
|
@ -114,10 +114,7 @@ function url_replace_render(array &$b)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$twelvefeet_sites = DI::config()->get('url_replace', 'twelvefeet_sites');
|
$twelvefeet_sites = DI::config()->get('url_replace', 'twelvefeet_sites') ?? [] ?: [];
|
||||||
if (empty($twelvefeet_sites)) {
|
|
||||||
$twelvefeet_sites = [];
|
|
||||||
}
|
|
||||||
foreach ($twelvefeet_sites as $twelvefeet_site) {
|
foreach ($twelvefeet_sites as $twelvefeet_site) {
|
||||||
if (strpos($b['html'], $twelvefeet_site) !== false) {
|
if (strpos($b['html'], $twelvefeet_site) !== false) {
|
||||||
$b['html'] = str_replace($twelvefeet_site, 'https://12ft.io/' . $twelvefeet_site, $b['html']);
|
$b['html'] = str_replace($twelvefeet_site, 'https://12ft.io/' . $twelvefeet_site, $b['html']);
|
||||||
|
|
Loading…
Reference in a new issue