YouTube Muziek
Deze pagina is vertaald door PageTurner AI (beta). Niet officieel goedgekeurd door het project. Een fout gevonden? Probleem melden โ
Watโ
Toont het nummer dat momenteel wordt afgespeeld in de YouTube Music Desktop App.
Instellenโ
Je moet de Companion API inschakelen in de instellingen van de YouTube Music Desktop App.
Open hiervoor de app, ga naar Settings > Integration en schakel het volgende in:
-
Companion server
-
Enable companion authentication
Voer vanuit de CLI de volgende opdracht uit om het authenticatietoken in te stellen:
oh-my-posh auth ytmda
Als dit correct is uitgevoerd, kun je nu het ytm-segment aan je prompt toevoegen.
De YouTube Music Desktop App heeft vrij strikte snelheidsbeperkingen. Daarom is het aanbevolen
om de cache-eigenschap in je configuratie in te stellen. Zonder deze instelling kan het segment
de informatie niet correct weergeven.
Voorbeeldconfiguratieโ
- 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"
Optiesโ
| 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 |
Template (informatie)โ
{{ .Icon }}{{ if ne .Status \"stopped\" }}{{ .Artist }} - {{ .Track }}{{ end }}
Eigenschappenโ
| Name | Type | Description |
|---|---|---|
.Status | string | player status (playing, paused, stopped) |
.Artist | string | current artist |
.Track | string | current track |
.Icon | string | icon (based on .Status) |