diff --git a/src/determine_software.py b/src/determine_software.py index ce80a4a..e34d48b 100644 --- a/src/determine_software.py +++ b/src/determine_software.py @@ -7,6 +7,10 @@ supported_software = { '', '
' ], + "funkwhale" : [ + '', + "" + ], "peertube" : [ ' 0: + page_type = path[1:slash2] + else: + page_type = path[1:] + + if page_type == "channels": + slash3 = path.find("/",slash2 + 1) + if slash3 > 0: + channel_name = path[slash2+1:slash3] + else: + channel_name = path[slash2+1:] + + # use home instance + if '@' in channel_name: + # TODO: how do we handle protocol (http vs. https)? + # for now, assume it's the same as url, or https if not specified + if "//" in domain: + protocol = domain[:domain.index("//")+2] + else: + protocol = "https://" + debug ("Assuming " + protocol + " for remote instance", verbosity, platform) + at_index = channel_name.find("@") + domain = protocol + channel_name[at_index+1:] + channel_name = channel_name[:at_index] + + if channel_name != "": + return domain + "/api/v1/channels/" + channel_name + "/rss" + +def extract (url, page=None, network=False, verbosity=3, args={}): + feed = extract_from_url (url, verbosity) + if not feed is None: + return feed diff --git a/tests/funkwhale.txt b/tests/funkwhale.txt new file mode 100644 index 0000000..29f5ed9 --- /dev/null +++ b/tests/funkwhale.txt @@ -0,0 +1,3 @@ +https://funkwhale.it/channels/ilpunto/ https://funkwhale.it/api/v1/channels/ilpunto/rss +https://funkwhale.thurk.org/channels/radio_colibri@open.audio/ https://open.audio/api/v1/channels/radio_colibri/rss +https://open.audio/channels/radio_colibri https://open.audio/api/v1/channels/radio_colibri/rss