Skip to content

Instantly share code, notes, and snippets.

@python273
Last active June 26, 2023 05:46
Show Gist options
  • Star 24 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save python273/63c1efdd9bf5d8caf985b3e77333e7ab to your computer and use it in GitHub Desktop.
Save python273/63c1efdd9bf5d8caf985b3e77333e7ab to your computer and use it in GitHub Desktop.
Экспорт аудиозаписей вконтакте в txt
  1. Открыть страницу аудио и промотать до конца
  2. Открыть консоль javascript:
  • Chrome: Control + Shift + J
  • Firefox: Control + Shift + K
  1. Скопировать код в консоль и нажать Enter
(function(){
  function downloadString(text, fileType, fileName) {
    var blob = new Blob([text], { type: fileType });
    var a = document.createElement('a');
    a.download = fileName;
    a.href = URL.createObjectURL(blob);
    a.dataset.downloadurl = [fileType, a.download, a.href].join(':');
    a.style.display = "none";
    document.body.appendChild(a);
    a.click();
    document.body.removeChild(a);
  }
  downloadString(Array.from(document.querySelectorAll('.audio_row')).map(el => {
      const title = el.querySelector('.audio_row__title_inner');
      const artist = el.querySelector('.audio_row__performers');
      return `${artist.innerText} - ${title.innerText}`
  }).join('\n'), 'text', 'audio.txt');
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment