Skip to content

Instantly share code, notes, and snippets.

@Be1zebub
Last active March 8, 2023 22:47
Show Gist options
  • Save Be1zebub/a4d9cf4d1b297e455fec6ef280f2aa78 to your computer and use it in GitHub Desktop.
Save Be1zebub/a4d9cf4d1b297e455fec6ef280f2aa78 to your computer and use it in GitHub Desktop.
Vk delete all audio
// удаляет всю музыку из вашей библиотеки https://vk.com/audio
// ни одно из решений в интернете не работало, пришлось написать свой скрипт
var songs = document.querySelector("#content > div > div._audio_page_content_block_wrap.audio_page_content_block_wrap > div.audio_page_sections._audio_page_sections.clear_fix > div.audio_section._audio_section._audio_section__all.audio_section__all.clear_fix.audio_w_covers > div > div:nth-child(2) > div.CatalogSection__columns > div.CatalogSection__leftColumn.CatalogSection__paginatedBlocks > div.CatalogBlock__content.CatalogBlock__my_audios.CatalogBlock__layout--list > div > div > div.audio_page__rows_wrap > div > div.CatalogBlock__itemsContainer.audio_page__audio_rows_list._audio_page__audio_rows_list._audio_pl.audio_w_covers.CatalogBlock__itemsContainer--reorderable");
var list = songs.querySelectorAll(".audio_row");
console.log(`Total songs: ${list.length}`);
list.forEach(function(elem) {
let obj = AudioUtils.getAudioFromEl(elem);
let data_audio = JSON.parse(elem.getAttribute("data-audio"));
console.log(`delete ${obj[4]} - ${obj[3]}`);
ajax.post("al_audio.php?act=delete_audio", {
act: "delete_audio",
oid: data_audio[1],
aid: data_audio[0],
hash: data_audio[13].split("/")[3],
restore: 1,
al: 1,
track_code: data_audio[20]
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment