Greasy Fork is available in English.

Tuna browser script

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

< Обсуждения Tuna browser script

Отзыв: Хороший — скрипт работает как нужно

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 });
}
}

let cover_url = query('.entity-cover__image', e => e.src.replace('200x200','400x400')); //FIX

Ответить

Войдите, чтобы ответить.