Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
You only read a few bytes of the track header . Based on this data, you determine the bitrate.
On something Unix-like, you can do this if you know the list of addresses:
The command curl --range 0-2048 $url | file -
will display information about the file header, incl. bitrate, for example:
/dev/stdin: Audio file with ID3 version 2.3.0, contains: MPEG ADTS, layer III, v2, 80 kbps, 22.05 kHz, JntStereo
If there is a file with a list of addresses (which can certainly be obtained with a greasemonkey script), then you can download only those files in which the bitrate is 320 kilobits, you can do this:
for url in $(cat list_of_the_music); do
if curl --range 0-2048 $url | file - | grep 320 >/dev/null; then
wget $url
fi
done
Vkontakte extensions do this: they find out the duration of the track (Vkontakte writes how long the track lasts), send a HEAD request to the file (only headers are given), from the response to which they find out the weight of the file in bytes. Well, the further business of arithmetic is to divide the length of the file by the duration.
EMNIP, when adding a song to your page, the code is as follows:
<input type="hidden" id="audio_info420508_90476677_46809501_2795" value="http://cs4704.userapi.com/u66844845/audio/65a9e87b88b8.mp3,219">
in the search, it seems
that the last parameter does not work - the time in seconds,
we take the size in kilobytes, divide by 128 and divide by the time
with the file in the example - about 187 kilobit / s
and one more thing... don't forget
to google one position higher than your question on habré =)
www.designaeon.com/read-mp3-tags-without-downloading-it/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question