no inputstream?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • max

    no inputstream?

    hey folks,

    coming from java, new to python. i'm trying to port a java app to
    python that writes an inputstream to a buffer, then parses the buffer
    (specifically, i'm getting ID3 tags from mp3s online). i understand
    that this java approach to the task may not apply to python, but i'm
    having trouble finding a working approach in python.

    i currently have locations of the mp3s in question as strings, which
    works for parsing local files, but gives me a "No such file or
    directory" error when it tries to process URLs. it seems terribly
    inefficient to download each mp3 just to get at that small tag data,
    and i assume there's a way to do this with file() or open() or
    something, i just can't get it to work.

    anyone know how i can fix this? thanks in advance for any help!

    best,
    max



  • Marc 'BlackJack' Rintsch

    #2
    Re: no inputstream?

    On Thu, 15 May 2008 06:08:35 -0700, max wrote:
    i currently have locations of the mp3s in question as strings, which
    works for parsing local files, but gives me a "No such file or
    directory" error when it tries to process URLs. it seems terribly
    inefficient to download each mp3 just to get at that small tag data,
    and i assume there's a way to do this with file() or open() or
    something, i just can't get it to work.
    You can use `urllib2.urlope n()` to open URLs as files. But if you deal
    with ID3 V1 tags you'll have to download the file anyway because those are
    in the last 128 bytes of an MP3 file.

    Ciao,
    Marc 'BlackJack' Rintsch

    Comment

    • castironpi

      #3
      Re: no inputstream?

      On May 15, 8:37 am, Marc 'BlackJack' Rintsch <bj_...@gmx.net wrote:
      On Thu, 15 May 2008 06:08:35 -0700, max wrote:
      i currently have locations of the mp3s in question as strings, which
      works for parsing local files, but gives me a "No such file or
      directory" error when it tries to process URLs.  it seems terribly
      inefficient to download each mp3 just to get at that small tag data,
      and i assume there's a way to do this with file() or open() or
      something, i just can't get it to work.
      >
      You can use `urllib2.urlope n()` to open URLs as files.  But if you deal
      with ID3 V1 tags you'll have to download the file anyway because those are
      in the last 128 bytes of an MP3 file.
      >
      Ciao,
              Marc 'BlackJack' Rintsch
      Just don't import time. What would you do with an autolocking timer,
      such as time.sleep( ) on a thread? I am tongue tied in the presence
      of a lady.

      Comment

      • max

        #4
        Re: no inputstream?

        On May 15, 9:51 am, castironpi <castiro...@gma il.comwrote:
        On May 15, 8:37 am, Marc 'BlackJack' Rintsch <bj_...@gmx.net wrote:
        >
        On Thu, 15 May 2008 06:08:35 -0700, max wrote:
        i currently have locations of the mp3s in question as strings, which
        works for parsing local files, but gives me a "No such file or
        directory" error when it tries to process URLs.  it seems terribly
        inefficient to download each mp3 just to get at that small tag data,
        and i assume there's a way to do this with file() or open() or
        something, i just can't get it to work.
        >
        You can use `urllib2.urlope n()` to open URLs as files.  But if you deal
        with ID3 V1 tags you'll have to download the file anyway because those are
        in the last 128 bytes of an MP3 file.
        >
        Ciao,
                Marc 'BlackJack' Rintsch
        >
        Just don't import time.  What would you do with an autolocking timer,
        such as time.sleep( ) on a thread?  I am tongue tied in the presence
        of a lady.
        thanks guys. i guess i just figured there'd be a way to get at those
        id3 bytes at the end without downloading the whole file. if java can
        do this, seems like i should just stick with that implementation, no?

        Comment

        • castironpi

          #5
          Re: no inputstream?

          On May 15, 9:02 am, max <maxwell.newla. ..@gmail.comwro te:
          On May 15, 9:51 am, castironpi <castiro...@gma il.comwrote:
          >
          >
          >
          >
          >
          On May 15, 8:37 am, Marc 'BlackJack' Rintsch <bj_...@gmx.net wrote:
          >
          On Thu, 15 May 2008 06:08:35 -0700, max wrote:
          i currently have locations of the mp3s in question as strings, which
          works for parsing local files, but gives me a "No such file or
          directory" error when it tries to process URLs.  it seems terribly
          inefficient to download each mp3 just to get at that small tag data,
          and i assume there's a way to do this with file() or open() or
          something, i just can't get it to work.
          >
          You can use `urllib2.urlope n()` to open URLs as files.  But if you deal
          with ID3 V1 tags you'll have to download the file anyway because thoseare
          in the last 128 bytes of an MP3 file.
          >
          Ciao,
                  Marc 'BlackJack' Rintsch
          >
          Just don't import time.  What would you do with an autolocking timer,
          such as time.sleep( ) on a thread?  I am tongue tied in the presence
          of a lady.
          >
          thanks guys.  i guess i just figured there'd be a way to get at those
          id3 bytes at the end without downloading the whole file.  if java can
          do this, seems like i should just stick with that implementation, no?- Hide quoted text -
          >
          - Show quoted text -
          I can post life1 to this: lifeOne, lifeone, lifea perhaps.

          Comment

          Working...