NoUnavailable

17.05.2025, 02:53:15

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name        NoUnavailable
// @namespace   Violentmonkey Scripts
// @license     WTFPL
// @match       https://musify.club/*
// @grant       none
// @version     0.1
// @author      nikita-yfh
// @description 17.05.2025, 02:53:15
// ==/UserScript==

const elements = document.querySelectorAll('i.zmdi.zmdi-block.zmdi-hc-2-5x');
elements.forEach(element => {
  element.className = 'zmdi zmdi-play-circle-outline zmdi-hc-2-5x';
});

const elementsToRemove = document.querySelectorAll('span.badge.badge-pill.badge-warning');
elementsToRemove.forEach(element => {
  element.remove();
});

const links = document.querySelectorAll(`a[href*="/track/"]`);

links.forEach(link => {
  const href = link.getAttribute('href');
  const match = href.match(/^\/track\/([a-z0-9-]+)-([0-9]+)$/);

  const iconElement = link.querySelector('i.zmdi.zmdi-download.zmdi-hc-2-5x');

  if (match && iconElement) {
    const songName = match[1];
    const songNumber = match[2];

    const newLinkHTML = `<a target="_blank" itemprop="audio" download="${songName}.mp3" href="/track/dl/${songNumber}/${songName}.mp3" class="no-ajaxy yaBrowser ___adv-binded ___adv-yandex ___adv-yandex-download ___adv-yandex-script ___adv-download" id="dl_${songNumber}" data-rbtified="true" data-rbtify-index="1"><span><i class="zmdi zmdi-download zmdi-hc-2-5x"></i></span></a>`;

    link.outerHTML = newLinkHTML;
  }
});

const match = document.URL.match(/\/track\/([a-z0-9-]+)-([0-9]+)$/);
const songName = match[1];
const songNumber = match[2];

var buttons = document.querySelectorAll('button[disabled][class="btn btn-lg btn-outline-primary btn--icon-text songplay_btn disabled mb-0 dis"][title="Скачивание недоступно"]');

buttons.forEach(button => {
  const newLinkHTML = `
      <a target="_blank" class="no-ajaxy yaBrowser btn btn-lg btn-outline-primary btn--icon-text songplay_btn mb-0 ___adv-binded ___adv-yandex ___adv-yandex-download ___adv-yandex-script ___adv-download"
                        itemprop="audio"
                        href="/track/dl/${songNumber}/${songName}.mp3"
                        id="dl_${songNumber}"
                        data-rbtified="true" data-rbtify-index="1">
         <i class="zmdi zmdi-download zmdi-hc-3x"></i>
         Скачать MP3
      </a>
  `;
  button.outerHTML=newLinkHTML;
});

buttons = document.querySelectorAll('button[disabled][title="Прослушивание недоступно"]');

buttons.forEach(button => {
  const newButtonHTML = `
      <button class="btn btn-lg btn-outline-primary btn--icon-text songplay_btn play mb-0 ___adv-binded ___adv-click-stat ___adv-click-stat-stream ___adv-click-stat- ___adv-stream"
              data-url="/track/play/${songNumber}/${songName}.mp3"
              data-rbtified="true"
              data-rbtify-index="1">
        <i class="zmdi zmdi-play zmdi-hc-3x"></i>
        Слушать
      </button>
  `;
  button.outerHTML=newButtonHTML;
});