Answer the question
In order to leave comments, you need to log in
Linux and downloading music from VKontakte - bring the script to mind?
First, the backstory, which is quite drawn to a miniature topic.
So, your music collection is in VKontakte, and you wanted to steal it to hards, as I wanted. The bulk of the solutions offered on the Internet are all sorts of left-handed utilities under Win, to which you need to feed your account data (yes, give them to someone on a silver platter). These utilities add a "download" button to every song, offering (again) silly manual labor.
The following script was found on the Internet:
<font color="black"><ol> <li>#!/bin/bash</li> <li>gets=`curl -s --data <font color="#A31515">"[email protected]&pass=yourpassword"</font> http:<font color="#008000">//login.vk.com/?act=login | egrep -o \([a-z]\|[0-9]\){20\,}`</font></li> <li>curl -v --cookie-jar /tmp/vkcookie --data <font color="#A31515">"s=$gets&op=slogin&redirect=1&expire=0&to=0"</font> http:<font color="#008000">//vkontakte.ru/login.php</font></li> <li>curl -v --cookie /tmp/vkcookie <a href="http://vkontakte.ru/audio.php">vkontakte.ru/audio.php</a> | grep -o <font color="#A31515">'http.*mp3'</font> | wget -i -</li> </ol></font><font color="gray">* This source code was highlighted with <a href="http://virtser.net/blog/post/source-code-highlighter.aspx"><font color="gray">Source Code Highlighter</font></a>.</font>
<a href="http://vkontakte.ru/audio.php">vkontakte.ru/audio.php</a>
you can enter any link in the contact, for example, on the "audio recording" page of a group (I checked, it works). Answer the question
In order to leave comments, you need to log in
what about mielophone.com/ ?
1) available under Linux for Adobe AIR
2) in the settings you can select as source - api.vk.com, which does not require any logins and passwords
3) allows you to download the entire music library in 2 clicks, while maintaining the original names of the songs
4) very simple in use and has many additional features
In order not to download files a second time, it is enough to pass the -c switch to wget.
I can help with data entry. As far as I understand, you need to ask the user:
- email
- password
- type of page he is interested in
- id
Correct?
Give examples of links corresponding to different user choices. And then I don’t sit in contact, I’m too lazy to look for myself, where are the links.
A graphical interface on the condition of the problem can not be used?
If possible, there is another option Exaile + script for VKontakte . This, of course, is not the way of the guru, but with a small number of tracks it works well. I have not tried it with a large one, but, in theory, it should also be fine. The titles of the tracks are written in the normal form. Plus, you can choose what to download and what not to download.
I would do this: run DragonFly in the opera and press the play button for all the songs, then drag the received links into the opera rocking chair. Yes, manual labor, but simple and clear.
> and if at some point the connection was interrupted, or wget hung, or the
wget -c terminal was accidentally closed
I have a working solution in php + mysql, which has not been brought to the state of a service site. I can share if relevant. There and authorization and the correct naming of files.
Guys, it's all the same crutches. Point by point
- the solution with exaile is at first glance pretty, but it's definitely not a unix-way, I don't have the same exaile (and I really don't want to put it on my minimalistic archie) and a few more complaints, starting with the fact that the task is tearing out music from a specific page specified. That is, you went into the group, clicked on “audio recordings” - there are 20 of them. Selected a link or just a group id from it, launched the script, a gtk window popped up (gxmessage or zenity provides such functionality for *sh-scripts). You enter your login and password there and paste the link into the third field, and it pulls out all the tracks.
- php + mysql is also not unix-way, it's more like hammering nails with a microscope in my case. That is, at the moment, instead, a 3-line bash script almost manages. Is it reasonable to compare it with installing and configuring the Apache+php+muscle bundle?
“The same goes for Dragonfly. If I have a large selection in my records, then I will have to sit like a crab in the galleys.
Even some I am unassembled at 8 am)
- about exaile - the point is not to do the work already done on collecting a large track list. That is, searching for all the songs again is not the same.
- about the http service, if you do not install it on your machine, then the option of using an intermediary when logging in to VKontakte is also very bad.
Fine!
Look here. Audio recordings of some group:
vkontakte.ru/audio.php?gid=9538168
Audio recordings of the current user:
vkontakte.ru/audio.php
If you switch to the next/previous page of records: the
second page of records of the current user (in this case, me)
vkontakte.ru /audio.php#album_id=0&gid=0&id=1172148&offset=100
first page
vkontakte.ru/audio.php#album_id=0&gid=0&id=1172148&offset=0
sixth page of another user's entries
vkontakte.ru/audio.php?id=4564440# album_id=0&gid=0&id=4564440&offset=500
If you set the offset a lot, then the last of the existing pages is loaded anyway, that is, if there are only 2 compositions on the sixth page, and you set the offset to 99999, then the sixth page is loaded, but 99999 remains in the address bar. In theory, this fact can be used , that is, add 100 to the offset and compare with the previous page downloaded by wget, if the size is the same, then stop everything and report via notify-send that everything has been downloaded. Although it would be more correct to count the hash, rather than compare by size.
I think there is no difference between your own records and those of others in terms of address generation.
Only the user ID is different.
Sorry, I can’t ask a question, so I’ll write in the comments, maybe they came across. I would like to implement a script for downloading audio files to a contact (not convenient one at a time), I did authorization, but I didn’t figure out how to send multipart via curl in a human way, tell me, if it’s not difficult. Preferably with an example.
PS if anyone needs authorization:
#!/bin/bash
RND=$RANDOM$RANDOM$RANDOM$RANDOM
touch /tmp/cookievk$RND
curl -c /tmp/cookievm$RND -d "email=$1&pass=$2" 'http ://vkontakte.ru/login.php' 2> /dev/null
SID=$(cat /tmp/cookievk$RND | grep sid | tail -c-57)
rm -rf /tmp/cookievk$RND
if [ " $SID" != "" ]; then
echo "$1 - $2 - $SID"
fi
PPS vk checks only the header for mp3x, so you can store files in them at the end, if anyone is interested - I wrote a small conversion script (curve code, but working)
stampoon.dyndns.org/Vkfile/
I myself don’t understand the intricacies, but the script I provided also has authorization, and it’s somehow different, but it works. I can't really answer.
Sounds like this is the solution.
So far, it has not been possible to try - AIR has not been installed on the fly, it says there are no access rights. Well, apparently, you just need to install it from the root, but I launched it from the Opera.
But this is definitely not the unix-way :)
In general, if anyone else wants to modify the script, please write it down! I'll poke the "solution" for now, but the unix-way is more interesting!
Of course, I'm sorry, but maybe the author will try the script from ru.savefrom.net
How to download music from a contact
1) When you hover your mouse over the track name, the links "Download" and "Options" will appear. By clicking on the "Parameters" link, you can determine the quality (bitrate) and size of the mp3 file. The bitrate is determined by the file size, so its value is an approximation.
2) In order to immediately download all the music from the page, call the SaveFrom.net assistant menu and select the item: "Download all mp3 files".
3) You can also save the playlist to your computer for later opening in a media player. To do this, select the item: "Download mp3 playlist" in the assistant menu.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question