Aller au contenu principal

YouTube Music

Traduction Bêta Non Officielle

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.

limitation de débit

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

{
"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

NameTypeDefaultDescription
playing_iconstring\uf04b text/icon to show when playing
paused_iconstring\uf04c text/icon to show when paused
stopped_iconstring\uf04d text/icon to show when stopped
ad_iconstring\ueebb text/icon to show when an advertisement is playing
http_timeoutint5000in milliseconds - the timeout for http request

Modèle (info)

modèle par défaut
{{ .Icon }}{{ if ne .Status \"stopped\" }}{{ .Artist }} - {{ .Track }}{{ end }}

Propriétés

NameTypeDescription
.Statusstringplayer status (playing, paused, stopped)
.Artiststringcurrent artist
.Trackstringcurrent track
.Iconstringicon (based on .Status)