Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • I've been looking into this a little more. File order appears to be keyed on Date-Added. If you add the Date added field to itunes, and then stream the files, you can see they continue almost sequencially.


      192.168.1.101:49186 -> 140.247.81.130:3689 [AP]
        GET /databases/35/items/289.mp3?session-id=11720 HTTP/1.1..Host: metadata:1..User-Agent: iTunes/4.0 (Macintosh; N; PPC)..connection: close.. ..


    T 192.168.1.101:49187 -> 140.247.81.130:3689 [AP]
        GET /databases/35/items/290.mp3?session-id=11720 HTTP/1.1..Host: 140.247.81 .130..Cache-Control: no-cache..Accept: */*..x-audiocast-udpport:49177..icy-
        metadata:1..User-Agent: iTunes/4.0 (Macintosh; N; PPC)..connection: close.. ..


    T 192.168.1.101:49188 -> 140.247.81.130:3689 [AP]
        GET /databases/35/items/291.mp3?session-id=11720 HTTP/1.1..Host: 140.247.81 .130..Cache-Control: no-cache..Accept: */*..x-audiocast-udpport:49178..icy-
        metadata:1..User-Agent: iTunes/4.0 (Macintosh; N; PPC)..connection: close.. ..


    T 192.168.1.101:49189 -> 140.247.81.130:3689 [AP]
        GET /databases/35/items/292.mp3?session-id=11720 HTTP/1.1..Host: 140.247.81 .130..Cache-Control: no-cache..Accept: */*..x-audiocast-udpport:49179..icy-
        metadata:1..User-Agent: iTunes/4.0 (Macintosh; N; PPC)..connection: close.. ..



    The ID of the music is continuing (blah-blah.mp3) is continuing, nearly sequencially.
    One thing to note is that in some cases, this order might be screwed up slightly. This is because if a song is deleted from the user's libraby, it appears to keep it's number reserved.

    The other thing that can screw the order up is songs that were batch-imported in the same minute. It seems that iTunes only tracks down to the minute, so the order within that minute is arbitrary, as far as I can tell.

    If, after determining the URL via ngrep, and taking the IP, you retrieve it using curl (or wget), you add it to iTunes, it retains the id3 information.

    It would be an interesting test to see if iTunes is adding information to the file before streaming it. (for identification, as Pudge suggested)
    This would be possible by doing a binary diff on the two files. I don't have two macs with iTunes 4 installed (yet!, but I intend to install iTunes on the others soon), so I can't test this theory. Any volunteers?

    (Side note- It would be trivial to write a perl script that parsed the ngrep output, and fed it into wget automatically, to download any songs you double-click. You wouldn't even need to listen to the entire song. Just start it playing, and iTunes will finish for you. I won't post mine, for reasons below.)

    Side note redux-
          Apple may have inadvertantly created a file-sharing utility rivaling Napster/Kazaa. This creates an interesting legal issue. This creates an interesting legal issue. Keep in mind that a student was recently sued for creating a software device that searched Network shares for mp3 files.

    Given the RIAA's stance towards piracy, and that they want to work with apple, I suspect they would sue whomever wrote the 4 line perl script, rather than Apple. They are also likely to ask "index" sites like spymac to shut down, and send a cease-and-desist, or a lawsuit..

    -Crutz
    • It would be an interesting test to see if iTunes is adding information to the file before streaming it. (for identification, as Pudge suggested)
      This would be possible by doing a binary diff on the two files. I don't have two macs with iTunes 4 installed (yet!, but I intend to install iTunes on the others soon), so I can't test this theory. Any volunteers?


      I already did this when I posted the journal entry, saying "I open it in iTunes and it is a regular ol' MP3. It has the exact same bytecount as the orig