Tuna browser script

Get song information from web players, based on NowSniper by Kıraç Armağan Önal

< Feedback on Tuna browser script

Review: Good - script works

§
Posted: 2020-12-20
OLZ ADD YANDEX MUSIC - CODE

else if (hostname == 'music.yandex.ru') {
let status = query('.player-controls__btn_play', e => e.classList.contains('player-controls__btn_pause') ? "playing" : "stopped", 'unknown');
let cover_url = query('.entity-cover__image', e => e.style.backgroundImage.slice(5, -2).replace('50x50','100x100'));
let title = query('.track__title', e => e.title);
let artists = [ query('.track__artists', e => e.textContent) ];
let progress = query('.progress__left', e => timestamp_to_ms(e.textContent));
let duration = query('.progress__right', e => timestamp_to_ms(e.textContent));
let album_url = query('.track-cover a', e => e.title);
// by MjKey
if (title !== null) {
post({ cover_url, title, artists, status, progress, duration, album_url });
}
}
§
Posted: 2020-12-20
let cover_url = query('.entity-cover__image', e => e.src.replace('200x200','400x400')); //FIX

Post reply

Sign in to post a reply.