Giter VIP home page Giter VIP logo

Comments (7)

pfleidi avatar pfleidi commented on August 23, 2024

Little help: http://stackoverflow.com/questions/7656950/read-id3-tags-of-remote-mp3-file-in-ruby-rails

from binaergewitter.github.com.

rb2k avatar rb2k commented on August 23, 2024

Doesn't work.
There is no read_from_buffer() method and as far as I see there never has been one O_o

from binaergewitter.github.com.

pfleidi avatar pfleidi commented on August 23, 2024

We could download the first X bytes with a range request and safe them into a temporary file. This should do the trick.

from binaergewitter.github.com.

rb2k avatar rb2k commented on August 23, 2024

Doesn't seem to work that way. We might not actually have the lenght set as an ID3v2 header

from binaergewitter.github.com.

rb2k avatar rb2k commented on August 23, 2024

btw, I tested a few libraries using this code:

require 'uri'
require 'net/http'

size = 25000
uri = URI("http://download.binaergewitter.de/2012-01-25.Binaergewitter.Talk.0.mp3")
http = Net::HTTP.new(uri.host, uri.port)
headers = { 'Range' => "bytes=0-#{size}" }
path = uri.path.empty? ? "/" : uri.path

#test to ensure that the request will be valid - first get the head
code = http.head(path, headers).code.to_i
if (code >= 200 && code < 300) then
    #the data is available...
    result = http.get(uri.path, headers)
    File.open('test.mp3', 'wb') {|file| file.write(result.body)}
    # DO SOMETHING HERE

end

from binaergewitter.github.com.

pfleidi avatar pfleidi commented on August 23, 2024

BTW: This is an iTunes only feature. So the only formats we need to support are mp3 and m4a. For our case only supporting mp3 in cbr and vbr would do the job.

from binaergewitter.github.com.

pfleidi avatar pfleidi commented on August 23, 2024

For now, the itunes:duration field has been removed until we have a reliable way to calculate the duration of m4a and mp3 files.

from binaergewitter.github.com.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.