Skip to content

Сортировка музыки по жанру альбома #84

Answered by Chimildic
MaxRichterW asked this question in Идея
Discussion options

You must be logged in to vote

Вряд ли сделаю подобное в ближайшее время. Поэтому предлагаю вариант чуть сложнее одной кнопки.

  1. Зайдите на страницу своего плейлиста и откройте консоль (клавиша F12)
  2. Вставьте следующий код в консоль и замените слово pop на желаемый жанр, например, hardcore
var targetGenre = "pop"
var path = location.pathname.split('/')
var response = await get(`https://music.yandex.ru/handlers/playlist.jsx?owner=${path[2]}&kinds=${path[4]}&light=false`)
var tracks = response.playlist.tracks.sort((x, y) => {
    try {
        return x.albums[0].genre.localeCompare(y.albums[0].genre)
    } catch (error) {
        return "z-error"
    }
}).filter(t => {
    try {
        return targetGenre.length == 0 || t…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@MaxRichterW
Comment options

@Chimildic
Comment options

Answer selected by Chimildic
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants