⬆️ ⬇️

Muz.ru gives audio for free

image Greetings to all users!



NB Immediately want to amend. The fact is that audio material from muz.ru servers can be obtained as 128 kb / s . Therefore, this technique will be relevant only for audio books, rather than for compositions.



What was all this for?



The answer is very simple - for interest. The fact is that the presented site uses its own flash audio player, which in some cases behaves humanely, and in others it does not. Let me explain why. This player plays some audio recordings in full, and some forcibly cuts down to 30 seconds. I can’t say anything by compositions that are being cut down, but yes by audiobooks - they are all cut down to 30 seconds. That's why I decided to figure out what's what.



How to get the file



At first I decided to study their flash audio player. He pulled out of the site, otdebazhil, but did not see anything worthwhile and therefore decided to give up this venture on the razoposhrazheniyu suspect and begin to explore GET and POST requests from / to the server.

')

In order to get information about the track, you must send a POST request to the address muz.ru/Services/Player2.asmx/GetTrackInfo and specify the track number as the transmitted parameter:







The answer is not long in coming, and as a result we get this:







We will be interested in the FirstTouchGuid parameter. I want to note that this parameter is unique and with each new access to the server it changes. Then, to get the Id link, we need to send a request to:

h ** p: //fs.muz.ru/handlers/link.ashx? f = FirstTouchGuid



As a result, we will return the same unique Id from which we can already form the final link to the audio recording. The link itself will look like this:

h ** p: //fs.muz.ru/handlers/audio.ashx? f = downloadLinkId



As a result, we can save the file audio.ashx , which is nothing like mp3 :







Process automation



I sketched the simplest C # code that allows you to demonstrate all of the above. This window code looks like this:







Window source code: pastebin.com/E09zNKPS



PS All these my conjectures are exclusively educational in nature. I consider it right to store audio recordings on the server trimmed up in a hardcore way to a duration of 30 seconds, and not to invent players that can only hide part of the audio recording from the user. I wrote to the site administration about a year ago, but the omnipotent ignore was so omnipotent.



Thank you for paying attention to reading this post. Have a great day everyone!

Source: https://habr.com/ru/post/140412/



All Articles