tangled mirror of catsky-🐱 Soothing soft social-app fork with all the niche toggles! (Unofficial); for issues and PRs please put them on github:NekoDrone/catsky-social
···5151 }
52525353 const urlp = new URL(url)
5454- const [_, intent, intentType] = urlp.pathname.split('/')
5454+ const [__, intent, intentType] = urlp.pathname.split('/')
55555656 // On native, our links look like bluesky://intent/SomeIntent, so we have to check the hostname for the
5757 // intent check. On web, we have to check the first part of the path since we have an actual hostname
+11-11
src/lib/strings/embed-player.ts
···105105 urlp.hostname === 'm.youtube.com' ||
106106 urlp.hostname === 'music.youtube.com'
107107 ) {
108108- const [_, page, shortOrLiveVideoId] = urlp.pathname.split('/')
108108+ const [__, page, shortOrLiveVideoId] = urlp.pathname.split('/')
109109110110 const isShorts = page === 'shorts'
111111 const isLive = page === 'live'
···137137 window.location.hostname
138138 : 'localhost'
139139140140- const [_, channelOrVideo, clipOrId, id] = urlp.pathname.split('/')
140140+ const [__, channelOrVideo, clipOrId, id] = urlp.pathname.split('/')
141141142142 if (channelOrVideo === 'videos') {
143143 return {
···162162163163 // spotify
164164 if (urlp.hostname === 'open.spotify.com') {
165165- const [_, typeOrLocale, idOrType, id] = urlp.pathname.split('/')
165165+ const [__, typeOrLocale, idOrType, id] = urlp.pathname.split('/')
166166167167 if (idOrType) {
168168 if (typeOrLocale === 'playlist' || idOrType === 'playlist') {
···210210 urlp.hostname === 'soundcloud.com' ||
211211 urlp.hostname === 'www.soundcloud.com'
212212 ) {
213213- const [_, user, trackOrSets, set] = urlp.pathname.split('/')
213213+ const [__, user, trackOrSets, set] = urlp.pathname.split('/')
214214215215 if (user && trackOrSets) {
216216 if (trackOrSets === 'sets' && set) {
···270270 }
271271272272 if (urlp.hostname === 'vimeo.com' || urlp.hostname === 'www.vimeo.com') {
273273- const [_, videoId] = urlp.pathname.split('/')
273273+ const [__, videoId] = urlp.pathname.split('/')
274274 if (videoId) {
275275 return {
276276 type: 'vimeo_video',
···281281 }
282282283283 if (urlp.hostname === 'giphy.com' || urlp.hostname === 'www.giphy.com') {
284284- const [_, gifs, nameAndId] = urlp.pathname.split('/')
284284+ const [__, gifs, nameAndId] = urlp.pathname.split('/')
285285286286 /*
287287 * nameAndId is a string that consists of the name (dash separated) and the id of the gif (the last part of the name)
···309309 // These can include (presumably) a tracking id in the path name, so we have to check for that as well
310310 if (giphyRegex.test(urlp.hostname)) {
311311 // We can link directly to the gif, if its a proper link
312312- const [_, media, trackingOrId, idOrFilename, filename] =
312312+ const [__, media, trackingOrId, idOrFilename, filename] =
313313 urlp.pathname.split('/')
314314315315 if (media === 'media') {
···338338 // Finally, we should see if it is a link to i.giphy.com. These links don't necessarily end in .gif but can also
339339 // be .webp
340340 if (urlp.hostname === 'i.giphy.com' || urlp.hostname === 'www.i.giphy.com') {
341341- const [_, mediaOrFilename, filename] = urlp.pathname.split('/')
341341+ const [__, mediaOrFilename, filename] = urlp.pathname.split('/')
342342343343 if (mediaOrFilename === 'media' && filename) {
344344 const gifId = filename.split('.')[0]
···389389 const path_components = urlp.pathname.slice(1, i + 1).split('/')
390390 if (path_components.length === 4) {
391391 // discard username - it's not relevant
392392- const [photos, _, albums, id] = path_components
392392+ const [photos, __, albums, id] = path_components
393393 if (photos === 'photos' && albums === 'albums') {
394394 // this at least has the shape of a valid photo-album URL!
395395 return {
···417417 // link shortened flickr path
418418 if (urlp.hostname === 'flic.kr') {
419419 const b58alph = '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'
420420- let [_, type, idBase58Enc] = urlp.pathname.split('/')
420420+ let [__, type, idBase58Enc] = urlp.pathname.split('/')
421421 let id = 0n
422422 for (const char of idBase58Enc) {
423423 const nextIdx = b58alph.indexOf(char)
···528528 return {success: false}
529529 }
530530531531- let [_, id, filename] = urlp.pathname.split('/')
531531+ let [__, id, filename] = urlp.pathname.split('/')
532532533533 if (!id || !filename) {
534534 return {success: false}