diff --git a/lib/plugins/system/htmlparser/htmlparser.js b/lib/plugins/system/htmlparser/htmlparser.js
index 0c60d7c94..5331371c1 100644
--- a/lib/plugins/system/htmlparser/htmlparser.js
+++ b/lib/plugins/system/htmlparser/htmlparser.js
@@ -43,7 +43,7 @@ export default {
headers: {}
});
} else if (!!options.exposeStatusCode
- && error.message === 'too_many_redirects') {
+ && (error.message === 'too_many_redirects' || error === 'too_many_redirects')) {
cb(null, {
__statusCode: 508, // Hello Instagram, see #503
diff --git a/lib/plugins/system/oembed/providers.json b/lib/plugins/system/oembed/providers.json
index 830702844..47c4f5a0a 100644
--- a/lib/plugins/system/oembed/providers.json
+++ b/lib/plugins/system/oembed/providers.json
@@ -1094,5 +1094,12 @@
],
"endpoint": "https://display.apester.com/oembed/",
"url": "https://renderer.apester.com/v2/{1}"
- }
+ },
+ {
+ "name": "Bitchute",
+ "templates": [
+ "bitchute.com/video/*"
+ ],
+ "endpoint": "https://api.bitchute.com/oembed/"
+ }
]
diff --git a/plugins/custom/meta-fallback.js b/plugins/custom/meta-fallback.js
new file mode 100644
index 000000000..56aee1333
--- /dev/null
+++ b/plugins/custom/meta-fallback.js
@@ -0,0 +1,18 @@
+export default {
+
+ provides: 'meta',
+
+ getData: function(url, __statusCode, options, cb) {
+
+ return __statusCode !== 429 && __statusCode !== 403 &&__statusCode !== 508
+
+ ? cb({
+ responseStatusCode: __statusCode,
+ })
+
+ : cb(null, {
+ meta: {},
+ message: `${options.provider || 'Publisher'} is rate-limiting. Meta disabled.`
+ })
+ }
+};
\ No newline at end of file
diff --git a/plugins/domains/facebook.com/facebook.thumbnail.js b/plugins/domains/facebook.com/facebook.thumbnail.js
index e05234d44..03fd2f83d 100644
--- a/plugins/domains/facebook.com/facebook.thumbnail.js
+++ b/plugins/domains/facebook.com/facebook.thumbnail.js
@@ -12,6 +12,8 @@ export default {
'facebook.video'
],
+ mixins: ['meta-fallback'],
+
getLink: function(url, __allowFBThumbnail, options, meta) {
var thumbnail = meta.twitter?.image
@@ -58,6 +60,8 @@ export default {
&& options.getProviderOptions('facebook.thumbnail', true) && !/comment_id=/.test(oembed.html)) {
options.followHTTPRedirect = true; // avoid security re-directs of URLs if any
+ options.exposeStatusCode = true;
+ options.provider = 'Facebook';
return {
__allowFBThumbnail: true
@@ -67,6 +71,7 @@ export default {
tests: [{
noFeeds: true,
- skipMethods: ['getData', 'getLink']
+ skipMethods: ['getData', 'getLink'],
+ skipMixins: ['meta-fallback']
}]
};
\ No newline at end of file
diff --git a/plugins/domains/facebook.com/facebook.video.js b/plugins/domains/facebook.com/facebook.video.js
index 8127ba3bd..e7c14a68d 100644
--- a/plugins/domains/facebook.com/facebook.video.js
+++ b/plugins/domains/facebook.com/facebook.video.js
@@ -9,7 +9,8 @@ export default {
/^https?:\/\/(?:www|business)\.facebook\.com\/video\.php.*[\?&]v=(\d+)(?:$|&)/i,
/^https?:\/\/(?:www|business)\.facebook\.com\/video\.php.*[\?&]id=(\d+)(?:$|&)/i,
/^https?:\/\/(?:www|business)\.facebook\.com\/[a-zA-Z0-9\.]+\/videos\/(?:[a-zA-Z0-9\-]+\/)?(\d+)/i,
- /^https?:\/\/(?:www|business)\.facebook\.com\/watch\/?\?(?:.+&)?v=(\d+)/i
+ /^https?:\/\/(?:www|business)\.facebook\.com\/watch\/?\?(?:.+&)?v=(\d+)/i,
+ /^https?:\/\/(?:www|business)\.facebook\.com\/reel\/(\d+)/i
],
mixins: ["fb-error"],
@@ -51,7 +52,6 @@ export default {
tests: [
"http://www.facebook.com/video/video.php?v=4253262701205&set=vb.1574932468&type=2",
- "http://www.facebook.com/photo.php?v=4253262701205&set=vb.1574932468&type=2&theater",
"https://business.facebook.com/KMPHFOX26/videos/10154356403004012/",
"https://www.facebook.com/sugarandsoulco/videos/1484037581637646/?pnref=story",
"https://www.facebook.com/watch/?v=235613163792499",