th-ch / youtube-music

YouTube Music Desktop App bundled with custom plugins (and built-in ad blocker / downloader)
https://th-ch.github.io/youtube-music/
MIT License
7k stars 426 forks source link

[Feature Request]: 'Skip liked songs' AKA 'Discover new songs' in radio mode #2133

Open jorbig opened 3 weeks ago

jorbig commented 3 weeks ago

Preflight Checklist

Problem Description

Using 'Start radio', we can discover new music that fits the current song, but often songs are played that I've already listened to before.

Proposed Solution

Much alike the already present 'Skip disliked songs' feature, we'd need a 'Skip liked songs' feature, that makes it possible to discover new music in radio mode without hearing many of the same old songs over and over again.

Alternatives Considered

I couldn't find or think of any alternative solution.

Additional Information

No response

SnowboundCabin commented 2 weeks ago

This could probably be expanded to "Skip songs in library," since liking a song automatically puts it in your library, and anything in your library isn't new.

jorbig commented 5 days ago

Until this feature is added, I'm using music.youtube.com with this userscript ChatGPT 4(o)helped me create:

// ==UserScript==
// @name        YouTube Music - Auto-skip liked/disliked songs within 3 seconds
// @namespace   Violentmonkey Scripts
// @match       https://music.youtube.com/*
// @grant       none
// @version     1.0
// @author      jorbig
// @description 6/29/2024, 8:48:57 PM
// ==/UserScript==

const likeButtonContainer = document.getElementById('like-button-renderer');
const skipButton = document.getElementsByClassName('next-button')[0];
const timeInfoSpan = document.querySelector('.time-info.style-scope.ytmusic-player-bar'); // Target the time span

// Function to check like-status and song time
const checkSongStatus = () => {
    const likeStatus = likeButtonContainer.getAttribute('like-status');

    // Extract current time from the time info span
    const currentTimeMatch = timeInfoSpan.textContent.match(/(\d+):(\d+)/); // Match minutes and seconds
    if (currentTimeMatch) {
        const seconds = parseInt(currentTimeMatch[1], 10) * 60 + parseInt(currentTimeMatch[2], 10);
        if (seconds <= 2 && (likeStatus === 'DISLIKE' || likeStatus === 'LIKE')) {
            skipButton.click();
        }
    }
}

setInterval(checkSongStatus, 2000);
Koaxz commented 4 days ago

+1