سؤال

I need to get these information not from a file located on my machine, but on another one.

In general I'm able to get these infos in this way:

TagLib::MPEG::File.open("myfile.mp3") do |file|

    tag = file.tag

    "Artist:     "      +   tag.artist      + " " +
    "Title:      "      +   tag.title       + " " +
    "Album:      "      +   tag.album       + " "

end

... but if I open a link to the file like "http:// .../myfile.mp3" It doesn't work. Why?

Is there a different way to resolve it?

هل كانت مفيدة؟

المحلول

TagLib only works on files on the local filesystem. To retrieve tags from remote files, you'd first have to download that file to your local disk.

نصائح أخرى

So a path to the file system should be given to the TagLib::MPEG::File.open param, not a url.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top