Last active
December 28, 2017 18:27
-
-
Save aslushnikov/cd08448213a4c11be6cc to your computer and use it in GitHub Desktop.
a simple snippet to pull track url from VK
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# rename hashes, setup id3 tags | |
set -o | |
track=$(echo "$1" | cut -d'@' -f1) | |
url=$(echo "$1" | cut -d'@' -f2) | |
name=$(echo "$1" | cut -d'@' -f3) | |
artist=$(echo "$name" | cut -d'-' -f1) | |
song=$(echo "$name" | cut -d'-' -f2) | |
wget "$url" | |
wget_file=$(basename "$url") | |
id3v2 --artist "$artist" --song "$song" --track "$track" --album="VK Lusha" "$wget_file" | |
mv "$wget_file" "$name".mp3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# launch from command-line | |
cat list.txt | xargs -n 1 -P 20 ./download.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var trackElements = document.querySelectorAll(".audio"); | |
console.log("Loaded " + trackElements.length + " track"); | |
var tracks = []; | |
for (var i = 0; i < trackElements.length; ++i) { | |
var trackElement = trackElements[i]; | |
var input = trackElement.querySelector("input"); | |
var title = trackElement.querySelector(".title_wrap"); | |
if (!input || !title) { | |
console.warn("DOM is irregular?!"); | |
continue; | |
} | |
var url = input.value.split("?").shift(); | |
var name = title.textContent.trim(); | |
var names = name.split("–"); | |
for(var j = 0; j < names.length; ++j) | |
names[j] = names[j].trim(); | |
name = names.join("-"); | |
tracks.push({name: name, url: url}); | |
} | |
var text = ""; | |
for (var i = 0; i < tracks.length; ++i) | |
text += "'" + ((i + 1) + "@" + tracks[i].url + "@" + tracks[i].name.replace(/'/g, "").replace(/@/g, "[AT]")) + "'\n"; | |
// Then in devtools, evaluate "copy(text)" in js console |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment