about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorManeraKai <manerakai@protonmail.com>2022-12-10 12:06:28 +0300
committerManeraKai <manerakai@protonmail.com>2022-12-10 12:06:28 +0300
commit0d0ea9d2a4199e905432bc435fbf4373702a3d53 (patch)
tree7c46eea1fb68b59e74bf357b7efbdf7e973f93fd
parentAdded partial BreezWiki Copy Raw support https://github.com/libredirect/libre... (diff)
downloadlibredirect-0d0ea9d2a4199e905432bc435fbf4373702a3d53.zip
Fixed Isntagram reels not redirecting https://github.com/libredirect/libredirect/issues/559
-rw-r--r--src/assets/javascripts/services.js3
-rw-r--r--src/config/config.json2
2 files changed, 3 insertions, 2 deletions
diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js
index 8bba127c..01523d52 100644
--- a/src/assets/javascripts/services.js
+++ b/src/assets/javascripts/services.js
@@ -130,7 +130,8 @@ function redirect(url, type, initiator, forceRedirection) {
 		case "bibliogram":
 			const reservedPaths = ["u", "p", "privacy"]
 			if (url.pathname === "/" || reservedPaths.includes(url.pathname.split("/")[1])) return `${randomInstance}${url.pathname}${url.search}`
-			if (url.pathname.startsWith("/reel") || url.pathname.startsWith("/tv")) return `${randomInstance}/p${url.pathname.replace(/\/reel|\/tv/i, "")}${url.search}`
+			if (url.pathname.startsWith("/reel")) return `${randomInstance}${url.pathname}`
+			if (url.pathname.startsWith("/tv")) return `${randomInstance}/p${url.pathname.replace(/\/tv/i, "")}${url.search}`
 			else return `${randomInstance}/u${url.pathname}${url.search}` // Likely a user profile, redirect to '/u/...'
 		case "lbryDesktop":
 			return url.href.replace(/^https?:\/{2}odysee\.com\//, "lbry://").replace(/:(?=[a-zA-Z0-9])/g, "#")
diff --git a/src/config/config.json b/src/config/config.json
index a7d2014c..cb0ed503 100644
--- a/src/config/config.json
+++ b/src/config/config.json
@@ -140,7 +140,7 @@
 				}
 			},
 			"targets": [
-				"^https?:\\/{2}(www\\.)?instagram\\.com\\/?(p\\/|$)"
+				"^https?:\\/{2}(www\\.)?instagram\\.com\\/?(p\\/|reel\\/|$)"
 			],
 			"name": "Instagram",
 			"options": {