Domanda

I have more thank 100,000 of mp3 links in sql table. I need to get album/artist information from the every song link. Is there any way, I can get it without downloading the song. The reson, I am asking is, If I download every song, it will take huge space on my hard drive, which I dont want. Also, it will take lot of time to download all the songs.

I can download the song using

WebClient Client = new WebClient ();
Client.DownloadFile("http://myserver.com/indie/band1.mp3", "band1.mp3");

and

TagLib 

to get the song information.

What best options do I have ?

Regards

Paraminder

È stato utile?

Soluzione

download the file -> extract the information -> delete the file. ===> this way you workaround the space concern.

There isn't anyway to extract info(beside extension and name) of the file without reading its header.

Altri suggerimenti

Taglib would help you to get at all the info that actually is in the songs' tags. But for this you would indeed have to get the songs themselves. Also some may not even have proper tags at all.

Therefore you should try to get just the metadata from one of the songdata libraries on the web, like freeDB, MusizicBraint, GD3, All Media Guid or Discogs. Some are free others may charge money to use them also some may limit access to reasonable numbers of requests..

Another thing to consider is whether all titels have a predictable format. My collection has most filenames coded in this way: "Artist - Track - Title". For mixes it is "Track - Artist - Title". From where would you download them? Maybe a legit source also has an API to song data before downloading them..?

You can use a for loop function to do it. So first read the sql table for each download link and maybe add it to a list view in your app.

And then using a for loop, you can read one by one link and download the file, get the information and save it as a file in any folder. Once that is done, delete the music file and it will continue to loop.

No need to download the files, you can do it all with SQLCLR. Just create an assembly to read the tags from BLOB and add it to the database as a function.

Furthermore, I'd suggest that you save the extracted tags in an XML type column in the database, so you can query it easily.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top