Greasy Fork is available in English.

chosic.com - export playlist

Allows exporting playlist from chosic.com to clipboard without loggin in.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @grant          none
// @version        0.0.3
// @author         eye-wave
// @icon           https://raw.githubusercontent.com/eye-wave/greasy-fork/main/packages/chosic-export-spotify/assets/icon.svg
// @license        GPL-3.0+
// @name           chosic.com - export playlist 
// @namespace      Spotify tools
// @match          https://www.chosic.com/*
// @description    Allows exporting playlist from chosic.com to clipboard without loggin in.
// ==/UserScript==
// ../../utils/src/index.ts
function $(query) {
  return document.querySelectorAll(query);
}
function $s(query) {
  return document.querySelector(query);
}
function copyToClipboard(data) {
  try {
    const text = typeof data === "string" ? data : JSON.stringify(data);
    navigator.clipboard.writeText(text);
  } catch {
    const textarea = document.createElement("textarea");
    textarea.value = typeof data === "string" ? data : JSON.stringify(data);
    document.body.appendChild(textarea);
    textarea.select();
    document.execCommand("copy");
    document.body.removeChild(textarea);
  }
}

// src/main.ts
var btn = $s(".save-playlist>button");
btn && (btn.onclick = () => {
  const list = Array.from($(".fa-spotify"));
  const items = list.reduce((acc, item) => {
    const id = item.getAttribute("data-song-id");
    if (id)
      acc.push(id);
    return acc;
  }, []);
  copyToClipboard(items.join("\n"));
});