'use strict';

const playButtonSelector = '.ytmusic-player-bar.play-pause-button #icon > svg > g > path';
const trackArtSelector = '.ytmusic-player-bar.image';
const trackSelector = 'ytmusic-player-queue-item[selected] .song-title';
const videoSelector = '.html5-main-video';
const adSelector = '.ytmusic-player-bar.advertisement';

const playingPath = 'M6 19h4V5H6v14zm8-14v14h4V5h-4z';

Connector.playerSelector = 'ytmusic-player-bar';

Connector.artistSelector = 'ytmusic-player-queue-item[selected] .byline';

Connector.trackSelector = trackSelector;

Connector.getTrackArt = () => {
	const trackArtUrl = Util.extractImageUrlFromSelectors(trackArtSelector);
	if (trackArtUrl) {
		return trackArtUrl.substring(0, trackArtUrl.lastIndexOf('='));
	}
	return null;
};

Connector.albumSelector = '.ytmusic-player-bar .yt-formatted-string.style-scope.yt-simple-endpoint[href*="browse/MPREb_"]';

Connector.getCurrentTime = () => {
	return getVideoProp('currentTime');
};

Connector.getDuration = () => {
	return getVideoProp('duration');
};

Connector.isPlaying = () => {
	return Util.getAttrFromSelectors(playButtonSelector, 'd') === playingPath;
};

Connector.isScrobblingAllowed = () => !Util.isElementVisible(adSelector);

Connector.applyFilter(MetadataFilter.getYoutubeFilter());

function getVideoProp(prop) {
	const videoElement = document.querySelector(videoSelector);
	return videoElement && videoElement[prop];
}

@@ -230,51 +230,8 @@
 e';%0A
-const videoSelector = '.html5-main-video';%0A
 cons
@@ -857,141 +857,58 @@
 tor.
-getCurrentTime = () =%3E %7B%0A%09return getVideoProp('currentTime');%0A%7D;%0A%0AConnector.getDuration = () =%3E %7B%0A%09return getVideoProp('duration');%0A%7D
+timeInfoSelector = '.ytmusic-player-bar.time-info'
 ;%0A%0AC
@@ -1091,16 +1091,16 @@
 ctor);%0A%0A
+
 Connecto
@@ -1153,142 +1153,4 @@
 ));%0A
-%0Afunction getVideoProp(prop) %7B%0A%09const videoElement = document.querySelector(videoSelector);%0A%09return videoElement && videoElement%5Bprop%5D;%0A%7D%0A

Update youtube-music connector