OpenInApp: Add support for localization in Spotify URL regex (#2776)
This commit is contained in:
parent
e07a4e19e6
commit
b595a3e33c
|
@ -33,7 +33,7 @@ interface URLReplacementRule {
|
||||||
// Do not forget to add protocols to the ALLOWED_PROTOCOLS constant
|
// Do not forget to add protocols to the ALLOWED_PROTOCOLS constant
|
||||||
const UrlReplacementRules: Record<string, URLReplacementRule> = {
|
const UrlReplacementRules: Record<string, URLReplacementRule> = {
|
||||||
spotify: {
|
spotify: {
|
||||||
match: /^https:\/\/open\.spotify\.com\/(track|album|artist|playlist|user|episode)\/(.+)(?:\?.+?)?$/,
|
match: /^https:\/\/open\.spotify\.com\/(?:intl-[a-z]{2}\/)?(track|album|artist|playlist|user|episode)\/(.+)(?:\?.+?)?$/,
|
||||||
replace: (_, type, id) => `spotify://${type}/${id}`,
|
replace: (_, type, id) => `spotify://${type}/${id}`,
|
||||||
description: "Open Spotify links in the Spotify app",
|
description: "Open Spotify links in the Spotify app",
|
||||||
shortlinkMatch: /^https:\/\/spotify\.link\/.+$/,
|
shortlinkMatch: /^https:\/\/spotify\.link\/.+$/,
|
||||||
|
|
Loading…
Reference in a new issue