services: add facebook support (#403)

* feat: add facebook support

* chore: fix fail check

* chore: minor fix

* chore: add service in README.md

* chore: cleaning post-merge code

* facebook: add shared link pattern

* chore: clean up removing unnecessarily code

* fix: facebook shared link pattern

* matchActionDecider: redirect to facebook video instead of rendering

* facebook: pass sourceUrl in object

* url: fix botched lint

* fix: facebook shared link pattern with clean up

* test: change facebook test response to redirect

---------

Co-authored-by: dumbmoron <log@riseup.net>
This commit is contained in:
Brama Udi
2024-07-24 22:05:21 +07:00
committed by GitHub
parent 31e1fa5c5c
commit c77ee2eb44
8 changed files with 159 additions and 2 deletions

View File

@@ -25,6 +25,7 @@ import twitch from "./services/twitch.js";
import rutube from "./services/rutube.js";
import dailymotion from "./services/dailymotion.js";
import loom from "./services/loom.js";
import facebook from "./services/facebook.js";
let freebind;
@@ -192,6 +193,11 @@ export default async function(host, patternMatch, lang, obj) {
r = await loom({
id: patternMatch.id
});
case "facebook":
r = await facebook({
...patternMatch,
sourceUrl: url.href
});
break;
default:
return createResponse("error", {