YouTube Music
Esta página fue traducida por PageTurner AI (beta). No está respaldada oficialmente por el proyecto. ¿Encontraste un error? Reportar problema →
Qué hace
Muestra la canción que se está reproduciendo actualmente en la Aplicación de Escritorio de YouTube Music.
Configuración
Necesitas habilitar la API Companion en los ajustes de la Aplicación de Escritorio de YouTube Music.
Para hacerlo, abre la aplicación, ve a Settings > Integration y activa lo siguiente:
-
Servidor Companion
-
Habilitar autenticación companion
Desde la CLI, ejecuta el siguiente comando para establecer el token de autenticación:
oh-my-posh auth ytmda
Si se hizo correctamente, ahora deberías poder añadir el segmento ytm a tu prompt.
La Aplicación de Escritorio de YouTube Music tiene un límite de solicitudes bastante estricto. Por lo tanto, se recomienda
configurar la propiedad cache en tu configuración. Si no lo haces, el segmento no podrá
mostrarse correctamente.
Configuración de ejemplo
- json
- yaml
- toml
{
"type": "ytm",
"style": "powerline",
"powerline_symbol": "",
"foreground": "#ffffff",
"background": "#FF0000",
"options": {
"playing_icon": " ",
"paused_icon": " ",
"stopped_icon": " ",
"ad_icon": " ",
"http_timeout": 1000
},
"cache": {
"duration": "5s",
"strategy": "session"
}
}
type: ytm
style: powerline
powerline_symbol:
foreground: "#ffffff"
background: "#FF0000"
options:
playing_icon: " "
paused_icon: " "
stopped_icon: " "
ad_icon: " "
http_timeout: 1000
cache:
duration: 5s
strategy: session
type = "ytm"
style = "powerline"
powerline_symbol = ""
foreground = "#ffffff"
background = "#FF0000"
[options]
playing_icon = " "
paused_icon = " "
stopped_icon = " "
ad_icon = " "
http_timeout = 1000
[cache]
duration = "5s"
strategy = "session"
Opciones
| Name | Type | Default | Description |
|---|---|---|---|
playing_icon | string | \uf04b | text/icon to show when playing |
paused_icon | string | \uf04c | text/icon to show when paused |
stopped_icon | string | \uf04d | text/icon to show when stopped |
ad_icon | string | \ueebb | text/icon to show when an advertisement is playing |
http_timeout | int | 5000 | in milliseconds - the timeout for http request |
Plantilla (info)
{{ .Icon }}{{ if ne .Status \"stopped\" }}{{ .Artist }} - {{ .Track }}{{ end }}
Propiedades
| Name | Type | Description |
|---|---|---|
.Status | string | player status (playing, paused, stopped) |
.Artist | string | current artist |
.Track | string | current track |
.Icon | string | icon (based on .Status) |