tjhrulz / WebNowPlaying

A NowPlaying like plugin for rainmeter built for getting music info from websites
GNU General Public License v2.0
203 stars 24 forks source link

YouTube Music Progress Incorrectly Captured #81

Closed haruki-taka8 closed 1 year ago

haruki-taka8 commented 2 years ago

Under unknown circumstances on YouTube Music, PlayerType=Position occasionally provides the required timestamp, but with a leading newline and four spaces.

Example:

[Measure.Position]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=Position

returns the string


    1:23

and, as expected, the number 83.


This can be temporarily fixed on the Rainmeter side by appending these two lines under the measure.

RegexpSubstitute=1
Substitute="\n    ":""

Environment:

haruki-taka8 commented 2 years ago

According to my hello-world-level experience in C# and OOP in general, changing the following line may fix the issue.

Old New
https://github.com/tjhrulz/WebNowPlaying/blob/905303b98ba2c7c4b46e5c1532e20c0ab8a51d1f/WebNowPlaying.cs#L231 currMusicInfo.Position = info.Trim();
keifufu commented 1 year ago

Fixed in this browser extension for now, will be fixed in the official one soon too.