From e3aae6b2a939d6baec5a6b6ea1dd70b57021274c Mon Sep 17 00:00:00 2001 From: projectmoon Date: Thu, 30 Nov 2023 12:17:20 +0100 Subject: [PATCH] Add FediFetcher license --- LICENSE.fedifetcher | 9 +++++++++ src/fediblockhole/__init__.py | 3 +++ 2 files changed, 12 insertions(+) create mode 100644 LICENSE.fedifetcher diff --git a/LICENSE.fedifetcher b/LICENSE.fedifetcher new file mode 100644 index 0000000..8002155 --- /dev/null +++ b/LICENSE.fedifetcher @@ -0,0 +1,9 @@ +The MIT License (MIT) + +Copyright (c) Michael Thomas (nanos@thms.uk) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/src/fediblockhole/__init__.py b/src/fediblockhole/__init__.py index 4d5f9d4..cfbbc91 100755 --- a/src/fediblockhole/__init__.py +++ b/src/fediblockhole/__init__.py @@ -375,6 +375,7 @@ def requests_headers(token: str=None): return headers +# Adapted from FediFetcher def get_nodeinfo(server, token: str=None, host_meta_fallback = False): headers = requests_headers(token) url = f'https://{server}/.well-known/nodeinfo' @@ -456,6 +457,7 @@ def get_nodeinfo(server, token: str=None, host_meta_fallback = False): log.error(f'Error getting host node info for {server}. Status Code: {resp.status_code}') return None +# Adapted from FediFetchre def set_server_apis(server): # support for new server software should be added here software_apis = { @@ -473,6 +475,7 @@ def set_server_apis(server): if 'mastodon_api' in features: server['mastodonApiSupport'] = True +# Adapted from FediFetcher def fetch_server_info(server, token: str=None): nodeinfo = get_nodeinfo(server, token=token) if nodeinfo is None: