YouTube Music
Cette page a été traduite par PageTurner AI (bêta). Non approuvée officiellement par le projet. Vous avez trouvé une erreur ? Signaler un problème →
Description
Affiche la chanson en cours de lecture dans l'application de bureau YouTube Music.
Configuration
Vous devez activer l'API Companion dans les paramètres de l'application de bureau YouTube Music.
Pour ce faire, ouvrez l'application, accédez à Settings > Integration et activez les éléments suivants :
-
Serveur Companion
-
Authentification Companion activée
Depuis la ligne de commande, exécutez cette commande pour définir le jeton d'authentification :
oh-my-posh auth ytmda
Si la configuration est correcte, vous pouvez maintenant ajouter le segment ytm à votre invite de commandes.
L'application de bureau YouTube Music applique des limites de débit strictes. Il est donc recommandé
de définir la propriété cache dans votre configuration. Sans cela, le segment ne pourra pas
s'afficher correctement.
Exemple de configuration
- 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"
Options
| 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 |
Modèle (info)
{{ .Icon }}{{ if ne .Status \"stopped\" }}{{ .Artist }} - {{ .Track }}{{ end }}
Propriétés
| Name | Type | Description |
|---|---|---|
.Status | string | player status (playing, paused, stopped) |
.Artist | string | current artist |
.Track | string | current track |
.Icon | string | icon (based on .Status) |