hrkfdn / ncspot

Cross-platform ncurses Spotify client written in Rust, inspired by ncmpc and the likes.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ncspot are unable to recognize https://open.spotify.com/intl-{LANG}/track URLs

leleobhz opened this issue · comments

Describe the bug
Ncspot cannot recognize localized URL with intl-{LANG} entry.

To Reproduce
Steps to reproduce the behavior:

  1. Enter command mode
  2. Type insert https://open.spotify.com/intl-pt/track/3Kj2M9gRU1Lwf5eiNjBtBp?si=37bbaa58f2ac48d8
  3. See error

Expected behavior
Context menu got opened.

Screenshots
Using URL https://open.spotify.com/intl-pt/track/3Kj2M9gRU1Lwf5eiNjBtBp?si=37bbaa58f2ac48d8

image

Using URL https://open.spotify.com/track/3Kj2M9gRU1Lwf5eiNjBtBp?si=37bbaa58f2ac48d8 (Removing localized part)

image

System (please complete the following information):

  • OS: Linux CachyOS
  • Terminal: Alacritty + Byobu
  • Version: 1.1.0-1.1 from cachyos-extra-v4
  • Installed from: paru -S ncspot

Hi, how are those intl-{LANG} URLs created? It's the first time for me seeing those.
Also does this exist for any Spotify URL or only tracks?

Hi, how are those intl-{LANG} URLs created? It's the first time for me seeing those. Also does this exist for any Spotify URL or only tracks?

It's created on web version when I share anything to clipboard and also redirected if I open on browser any open.spotify.com URL and as far I tested, tracks and artists URLs are affected:

About URL itself, I guess they are some sort of JS redirect (cURL does not receive any 30x redirect):

image

(Image pasting to bring intl highlight)

curl -sSL https://open.spotify.com/artist/4Hro4R9qjfN7Lkwevwlt80 | grep intl
<!doctype html><html class="mobile-web-player" lang="en" dir="ltr"><head><meta charSet="utf-8"/><title>Bonde do Metaleiro | Spotify</title><meta property="og:site_name" content="Spotify"/><meta property="fb:app_id" content="174829003346"/><link rel="icon" sizes="32x32" type="image/png" href="https://open.spotifycdn.com/cdn/images/favicon32.b64ecc03.png"/><link rel="icon" sizes="16x16" type="image/png" href="https://open.spotifycdn.com/cdn/images/favicon16.1c487bff.png"/><link rel="icon" href="https://open.spotifycdn.com/cdn/images/favicon.0f31d2ea.ico"/><meta http-equiv="X-UA-Compatible" content="IE=9"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" href="https://encore.scdn.co/fonts/CircularSp-Book-a00e99ef9996a3a157fb6b746856d04f.woff2" as="font" type="font/woff2" crossorigin="anonymous"/><link rel="preload" href="https://encore.scdn.co/fonts/CircularSpTitle-Bold-b2586b06a2e1522e9d879d84c2792a58.woff2" as="font" type="font/woff2" crossorigin="anonymous"/><link rel="preload" href="https://encore.scdn.co/fonts/CircularSp-Bold-602e7aefc706aa36c6ec1324b9bbc461.woff2" as="font" type="font/woff2" crossorigin="anonymous"/><link rel="preload" href="https://encore.scdn.co/fonts/CircularSpTitle-Black-4588c99025b967475c31695b0743dd1a.woff2" as="font" type="font/woff2" crossorigin="anonymous"/><meta name="description" content="Listen to Bonde do Metaleiro on Spotify. Artist · 1.8K monthly listeners."/><meta name="google" content="notranslate"/><meta property="og:title" content="Bonde do Metaleiro"/><meta property="og:description" content="Artist · 1.8K monthly listeners."/><meta property="og:url" content="https://open.spotify.com/artist/4Hro4R9qjfN7Lkwevwlt80"/><meta property="og:type" content="profile"/><meta property="og:site_name" content="Spotify"/><meta property="og:image" content="https://i.scdn.co/image/ab6761610000e5eb6c24265691636c86b1a56264"/><meta name="al:android:app_name" content="Spotify"/><meta name="al:android:package" content="com.spotify.music"/><meta name="al:android:url" content="spotify://artist/4Hro4R9qjfN7Lkwevwlt80"/><meta name="al:ios:app_name" content="Spotify"/><meta name="al:ios:app_store_id" content="324684580"/><meta name="al:ios:url" content="spotify://artist/4Hro4R9qjfN7Lkwevwlt80"/><meta name="twitter:site" content="@spotify"/><meta name="twitter:title" content="Bonde do Metaleiro"/><meta name="twitter:description" content="Artist · 1.8K monthly listeners."/><meta name="twitter:image" content="https://i.scdn.co/image/ab6761610000e5eb6c24265691636c86b1a56264"/><meta name="twitter:card" content="summary"/><link rel="canonical" href="https://open.spotify.com/artist/4Hro4R9qjfN7Lkwevwlt80"/><link rel="alternate" type="application/json+oembed" href="https://open.spotify.com/oembed?url=https%3A%2F%2Fopen.spotify.com%2Fartist%2F4Hro4R9qjfN7Lkwevwlt80"/><link rel="alternate" href="https://open.spotify.com/artist/4Hro4R9qjfN7Lkwevwlt80" hrefLang="x-default"/><link rel="alternate" href="https://open.spotify.com/artist/4Hro4R9qjfN7Lkwevwlt80" hrefLang="en"/><link rel="alternate" href="https://open.spotify.com/intl-id/artist/4Hro4R9qjfN7Lkwevwlt80" hrefLang="id"/><link rel="alternate" href="https://open.spotify.com/intl-de/artist/4Hro4R9qjfN7Lkwevwlt80" hrefLang="de"/><link rel="alternate" href="https://open.spotify.com/intl-pt/artist/4Hro4R9qjfN7Lkwevwlt80" hrefLang="pt"/><link rel="alternate" href="https://open.spotify.com/intl-ja/artist/4Hro4R9qjfN7Lkwevwlt80" hrefLang="ja"/><link rel="alternate" href="https://open.spotify.com/intl-fr/artist/4Hro4R9qjfN7Lkwevwlt80" hrefLang="fr"/><link rel="alternate" href="https://open.spotify.com/intl-ar/artist/4Hro4R9qjfN7Lkwevwlt80" hrefLang="ar"/><link rel="alternate" href="https://open.spotify.com/intl-es/artist/4Hro4R9qjfN7Lkwevwlt80" hrefLang="es"/><link rel="alternate" href="https://open.spotify.com/intl-tr/artist/4Hro4R9qjfN7Lkwevwlt80" hrefLang="tr"/><link rel="alternate" href="https://open.spotify.com/intl-it/artist/4Hro4R9qjfN7Lkwevwlt80" hrefLang="it"/><link rel="alternate" href="android-app://com.spotify.music/spotify/artist/4Hro4R9qjfN7Lkwevwlt80"/><script type="application/ld+json">{"@context":"http://schema.googleapis.com/","@type":"MusicGroup","@id":"https://open.spotify.com/artist/4Hro4R9qjfN7Lkwevwlt80","url":"https://open.spotify.com/artist/4Hro4R9qjfN7Lkwevwlt80","name":"Bonde do Metaleiro","description":"Listen to Bonde do Metaleiro on Spotify. Artist \u00B7 1.8K monthly listeners.","datePublished":null,"potentialAction":{"@type":"ListenAction","target":[{"@type":"EntryPoint","urlTemplate":"https://open.spotify.com/artist/4Hro4R9qjfN7Lkwevwlt80?autoplay=true","actionPlatform":["http://schema.org/DesktopWebPlatform","http://schema.org/IOSPlatform","http://schema.googleapis.com/GoogleAudioCast","http://schema.googleapis.com/GoogleVideoCast"]},"android-app://com.spotify.music/spotify/artist/4Hro4R9qjfN7Lkwevwlt80/play"],"expectsAcceptanceOf":{"@type":"Offer","category":"free","eligibleRegion":[]}}}</script><link rel="manifest" href="https://open.spotifycdn.com/cdn/generated/manifest-mobile-web-player.a1ddf51c.json"/><style data-styled="active"></style><style data-styled="" data-styled-version="5.3.11">.iGmhvb{box-sizing:border-box;-webkit-tap-highlight-color:transparent;font-size:1rem;font-weight:700;font-family:var(--font-family,var(--encore-body-font-stack,CircularSp,CircularSp-Arab,CircularSp-Hebr,CircularSp-Cyrl,CircularSp-Grek,CircularSp-Deva,var(--fallback-fonts,sans-serif)));background-color:transparent;border:0;border-radius:var(--encore-button-corner-radius,9999px);cursor:pointer;display:inline-block;position:relative;text-align:center;-webkit-text-decoration:none;text-decoration:none;text-transform:none;touch-action:manipulation;-webkit-transition-duration:33ms;transition-duration:33ms;-webkit-transition-property:background-color,border-color,color,box-shadow,filter,-webkit-transform;-webkit-transition-property:background-color,border-color,color,box-shadow,filter,transform;transition-property:background-color,border-color,color,box-shadow,filter,transform;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle;-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0);color:var(--text-subdued,#6a6a6a);min-inline-size:0;min-block-size:var(--encore-control-size-base,48px);padding-block-start:var(--encore-spacing-tighter,12px);padding-block-end:var(--encore-spacing-tighter,12px);padding-inline-start:var(--encore-spacing-tighter,12px);padding-inline-end:var(--encore-spacing-tighter,12px);display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;}/*!sc*/

Hello @Bettehem

I compiled aur/ncspot-git and you fix worked here! I'll close this issue. Thank you so much for you PR and time!