iTunes Music Library XML

classic Classic list List threaded Threaded
19 messages Options
Reply | Threaded
Open this post in threaded view
|

iTunes Music Library XML

Viaduct Productions
Has anybody properly parsed the iTunes Music Library XML file?  I  
keep getting the following error on a reduced (mine is way too long,  
so I cut lots of stuff out):

Error Message:
libxml2 error: Opening and ending tag mismatch: dict line 13 and array

at: onCreate with params: @'<?xml version="1.0" encoding="UTF-8"?>\n<!
DOCTYPE p...
at: /localtest/itunes/index.lasso on line: 14 at position: 15
Error Code:
-9956




Rich in Toronto
...now go get on your bike


--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/

Reply | Threaded
Open this post in threaded view
|

Re: iTunes Music Library XML

jasonhuck
I haven't found anything that will chew through a large iTunes Library
XML file. I've tried Lasso, PHP, Perl, and Python solutions that have
popped up on the web from time to time, and they have all failed in
one way or another.

I used to use a little shareware app called SQLTunes that would import
the data into MySQL on a schedule, but the author abandoned it.

I would love to have a robust solution for this.

- jason





On Fri, Apr 11, 2008 at 8:01 AM, Rich <[hidden email]> wrote:

> Has anybody properly parsed the iTunes Music Library XML file?  I keep
> getting the following error on a reduced (mine is way too long, so I cut
> lots of stuff out):
>
>  Error Message:
>  libxml2 error: Opening and ending tag mismatch: dict line 13 and array
>
>  at: onCreate with params: @'<?xml version="1.0"
> encoding="UTF-8"?>\n<!DOCTYPE p...
>  at: /localtest/itunes/index.lasso on line: 14 at position: 15
>  Error Code:
>  -9956
>
>
>
>
>  Rich in Toronto
>  ...now go get on your bike
>
>
>  --
>  This list is a free service of LassoSoft: http://www.LassoSoft.com/
>  Search the list archives: http://www.ListSearch.com/Lasso/Browse/
>  Manage your subscription: http://www.ListSearch.com/Lasso/
>
>



--
tagSwap.net :: Open Source Lasso Code
<http://tagSwap.net/>

--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/

Reply | Threaded
Open this post in threaded view
|

Re: iTunes Music Library XML

Viaduct Productions
I was thinking some kind of lasso-magic could help by splitting per  
line and sniffing out the last 10 lines or so.

Thanks for the heads up on that though, it shows me there needs to be  
another angle of attack.  If I make any headway I will post.  Any  
features you are looking for?  I would like to find a way of just  
getting tunes into a db, if I can find time.


On Apr 11, 2008, at 9:26 AM, Jason Huck wrote:
> I would love to have a robust solution for this.


Rich in Toronto
...now go get on your bike


--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/

Reply | Threaded
Open this post in threaded view
|

Re: iTunes Music Library XML

jasonhuck
Same here. Let me know if you find anything that can tear through a
large file without puking.

- jason



On Fri, Apr 11, 2008 at 9:56 AM, Rich <[hidden email]> wrote:

> I was thinking some kind of lasso-magic could help by splitting per line and
> sniffing out the last 10 lines or so.
>
>  Thanks for the heads up on that though, it shows me there needs to be
> another angle of attack.  If I make any headway I will post.  Any features
> you are looking for?  I would like to find a way of just getting tunes into
> a db, if I can find time.
>
>
>
>  On Apr 11, 2008, at 9:26 AM, Jason Huck wrote:
>
> > I would love to have a robust solution for this.
> >
>
>
>
>  Rich in Toronto
>  ...now go get on your bike
>
>
>  --
>  This list is a free service of LassoSoft: http://www.LassoSoft.com/
>  Search the list archives: http://www.ListSearch.com/Lasso/Browse/
>  Manage your subscription: http://www.ListSearch.com/Lasso/
>
>



--
tagSwap.net :: Open Source Lasso Code
<http://tagSwap.net/>

--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/

Reply | Threaded
Open this post in threaded view
|

Re: iTunes Music Library XML

Wade Maxfield
In reply to this post by Viaduct Productions
Rich wrote:
> I was thinking some kind of lasso-magic could help by splitting per line
> and sniffing out the last 10 lines or so.
>
> Thanks for the heads up on that though, it shows me there needs to be
> another angle of attack.  If I make any headway I will post.  Any
> features you are looking for?  I would like to find a way of just
> getting tunes into a db, if I can find time.
>

Are you looking for a purely Lasso solution?  Maybe running the original
XML file through an XSLT to a simpler XML file (via OS_Process), then
processing that with Lasso...

What info are you trying to get out of iTunes?

  - Wade

--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/

Reply | Threaded
Open this post in threaded view
|

Re: iTunes Music Library XML

jasonhuck
>  Are you looking for a purely Lasso solution?

Not at all. I'm looking for anything I can run on my Mac on a regular
schedule that will suck the data into a MySQL database.


>  What info are you trying to get out of iTunes?

All of it.


- jason



--
tagSwap.net :: Open Source Lasso Code
<http://tagSwap.net/>

--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/

Reply | Threaded
Open this post in threaded view
|

Re: iTunes Music Library XML

Viaduct Productions
In reply to this post by jasonhuck
Is the challenge in that it's a massive file, or that it's a strange  
XML format that the parser can't get around?


On Apr 11, 2008, at 10:09 AM, Jason Huck wrote:
> Same here. Let me know if you find anything that can tear through a
> large file without puking.


Rich in Toronto
...now go get on your bike


--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/

Reply | Threaded
Open this post in threaded view
|

Re: iTunes Music Library XML

Viaduct Productions
In reply to this post by Wade Maxfield
I'm trying to make it as portable as possible as I have some friends  
with some retail stores where they run iTunes from a remote box.  I  
would rather be able to get them onto some kind of Mac which can host  
their iTunes on, while running it from some EEE PCs or something  
similar, like an iPod Touch.

I would like to try to use Lasso only for this.


On Apr 11, 2008, at 10:14 AM, Wade Maxfield wrote:
> Are you looking for a purely Lasso solution?  Maybe running the  
> original XML file through an XSLT to a simpler XML file (via  
> OS_Process), then processing that with Lasso...
>
> What info are you trying to get out of iTunes?


Rich in Toronto
...now go get on your bike


--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/

Reply | Threaded
Open this post in threaded view
|

Re: iTunes Music Library XML

jasonhuck
In reply to this post by Viaduct Productions
It's mainly the size of the file (speed/memory issues), plus the
increased chance that it contains some oddball character or gremlin
that whatever script du jour I've tried doesn't account for.

I can't claim to have tried very hard to debug any of them. Some
worked just fine on smaller sample files, but none could chug all the
way through a real one.

The plist format is incredibly stupid, but it's also pretty straightforward.

JLH




On Fri, Apr 11, 2008 at 11:28 AM, Rich <[hidden email]> wrote:

> Is the challenge in that it's a massive file, or that it's a strange XML
> format that the parser can't get around?
>
>
>
>  On Apr 11, 2008, at 10:09 AM, Jason Huck wrote:
>
> > Same here. Let me know if you find anything that can tear through a
> > large file without puking.
> >
>
>
>
>  Rich in Toronto
>  ...now go get on your bike
>
>
>  --
>  This list is a free service of LassoSoft: http://www.LassoSoft.com/
>  Search the list archives: http://www.ListSearch.com/Lasso/Browse/
>  Manage your subscription: http://www.ListSearch.com/Lasso/
>
>



--
tagSwap.net :: Open Source Lasso Code
<http://tagSwap.net/>

--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/

Reply | Threaded
Open this post in threaded view
|

Re: iTunes Music Library XML

Viaduct Productions
OK, let me see what I can push out.  It's ironic that this format was  
meant for seamless integration.


On Apr 11, 2008, at 11:33 AM, Jason Huck wrote:
> I can't claim to have tried very hard to debug any of them. Some
> worked just fine on smaller sample files, but none could chug all the
> way through a real one.


Rich in Toronto
...now go get on your bike


--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/

Reply | Threaded
Open this post in threaded view
|

Re: iTunes Music Library XML

Mason Miller
In reply to this post by Viaduct Productions
Here is an xsl stylesheet you can use to parse the songs, you can hit  
my laptop while I am here at home today to see it parse the document  
in your browser at:

<http://sitewelder.dyndns.org:8080/~miller/ItunesMusicLibrary.xml>

Here is the stylesheet I linked in the xml doc:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform 
">
        <xsl:output method="html" encoding="UTF-8" doctype-public="-//W3C//
DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd 
" />
        <xsl:template match="/*">
        <html xmlns="http://www.w3.org/1999/xhtml">
                <head>
                        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
                        <title>My Tunes</title>
                </head>
        <body>
                <table>
                        <xsl:apply-templates select="dict/dict/dict" />
                </table>
                </body>
                </html>
        </xsl:template>
        <xsl:template match="dict">
                <tr>
                        <xsl:for-each select="key">
                                <td>
                                        <xsl:value-of select="." />
                                        :
                                </td>
                                <td>
                                        <xsl:value-of select="following-sibling::*" />
                                </td>
                        </xsl:for-each>
                </tr>
        </xsl:template>
</xsl:stylesheet>



On Apr 11, 2008, at 11:33 AM, Rich wrote:

> I'm trying to make it as portable as possible as I have some friends  
> with some retail stores where they run iTunes from a remote box.  I  
> would rather be able to get them onto some kind of Mac which can  
> host their iTunes on, while running it from some EEE PCs or  
> something similar, like an iPod Touch.
>
> I would like to try to use Lasso only for this.
>
>
> On Apr 11, 2008, at 10:14 AM, Wade Maxfield wrote:
>> Are you looking for a purely Lasso solution?  Maybe running the  
>> original XML file through an XSLT to a simpler XML file (via  
>> OS_Process), then processing that with Lasso...
>>
>> What info are you trying to get out of iTunes?
>
>
> Rich in Toronto
> ...now go get on your bike
>
>
> --
> This list is a free service of LassoSoft: http://www.LassoSoft.com/
> Search the list archives: http://www.ListSearch.com/Lasso/Browse/
> Manage your subscription: http://www.ListSearch.com/Lasso/
>


--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/

Reply | Threaded
Open this post in threaded view
|

Re: iTunes Music Library XML

Viaduct Productions
I was going to have a look this weekend, and try to step outside the  
XML bit.  Bring it in as a string somehow and see if I can parse  
individual lines and build accordingly.

On Apr 11, 2008, at 1:37 PM, Mason Miller wrote:
> Here is an xsl stylesheet you can use to parse the songs, you can  
> hit my laptop while I am here at home today to see it parse the  
> document in your browser at:


Rich in Toronto
...now go get on your bike


--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/

Reply | Threaded
Open this post in threaded view
|

Re: iTunes Music Library XML

Mason Miller
I realized that my library file is 13.4 megs, so even though it seems  
slow to parse that is a lot of data to parse.

I would write an xsl-stylesheet to build sql queries and then execute  
the results.

Mason

On Apr 11, 2008, at 1:45 PM, Rich wrote:

> I was going to have a look this weekend, and try to step outside the  
> XML bit.  Bring it in as a string somehow and see if I can parse  
> individual lines and build accordingly.
>
> On Apr 11, 2008, at 1:37 PM, Mason Miller wrote:
>> Here is an xsl stylesheet you can use to parse the songs, you can  
>> hit my laptop while I am here at home today to see it parse the  
>> document in your browser at:
>
>
> Rich in Toronto
> ...now go get on your bike
>
>
> --
> This list is a free service of LassoSoft: http://www.LassoSoft.com/
> Search the list archives: http://www.ListSearch.com/Lasso/Browse/
> Manage your subscription: http://www.ListSearch.com/Lasso/
>


--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/

Reply | Threaded
Open this post in threaded view
|

Re: iTunes Music Library XML

Viaduct Productions
Ya mine is 40 Megs with more to go.  I was thinking maybe once a day  
this could be done.  Or upon demand.

On Apr 11, 2008, at 2:15 PM, Mason Miller wrote:
> I realized that my library file is 13.4 megs, so even though it  
> seems slow to parse that is a lot of data to parse.
>
> I would write an xsl-stylesheet to build sql queries and then  
> execute the results.


Rich in Toronto
...now go get on your bike


--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/

Reply | Threaded
Open this post in threaded view
|

Wow: iTunes Music Library XML

Mason Miller
Googlebot just indexed my xml file:

66.249.72.111 - - [11/Apr/2008:16:12:29 -0400] "GET /robots.txt HTTP/
1.1" 404 208
66.249.72.111 - - [11/Apr/2008:16:12:30 -0400] "GET /~miller/
ItunesMusicLibrary.xml HTTP/1.1" 200 14307393

Macintosh-5:~ miller$ host 66.249.72.111
111.72.249.66.in-addr.arpa domain name pointer  
crawl-66-249-72-111.googlebot.com.

Mason

--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/

Reply | Threaded
Open this post in threaded view
|

Re: Wow: iTunes Music Library XML

Fletcher Sandbeck-3
On 4/11/08 at 5:48 PM, [hidden email] (Mason Miller) wrote:

>Googlebot just indexed my xml file:
>
>66.249.72.111 - - [11/Apr/2008:16:12:29 -0400] "GET /robots.txt
>HTTP/1.1" 404 208
>66.249.72.111 - - [11/Apr/2008:16:12:30 -0400] "GET
>/~miller/ItunesMusicLibrary.xml HTTP/1.1" 200 14307393
>
>Macintosh-5:~ miller$ host 66.249.72.111
>111.72.249.66.in-addr.arpa domain name pointer crawl-66-249-72-111.googlebot.com.

ListSearch is pretty well indexed.  Since we optimized the site
and put in site maps we've been getting complaints from people
that their old posts are showing up in Google searches for their
name or business name.  I consider them somewhat Orwellian
attempts to erase past traces from the Internet.  Ultimately, we
all have the deal with the consequences of those posts we made
on Lasso Talk when we were first learning programming :)  And,
they're on Nabble too anyway, though maybe they didn't read my
site map tip of the week.

[fletcher]

--
Fletcher Sandbeck                         [hidden email]
LassoSoft, LLC                          http://www.lassosoft.com


--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/

Reply | Threaded
Open this post in threaded view
|

Re: iTunes Music Library XML

Steve Upton
In reply to this post by Wade Maxfield
At 2:14 AM +1200 4/12/08, Wade Maxfield wrote:
>Rich wrote:
>>I was thinking some kind of lasso-magic could help by splitting per line and sniffing out the last 10 lines or so.
>>
>>Thanks for the heads up on that though, it shows me there needs to be another angle of attack.  If I make any headway I will post.  Any features you are looking for?  I would like to find a way of just getting tunes into a db, if I can find time.
>>
>
>Are you looking for a purely Lasso solution?  Maybe running the original XML file through an XSLT to a simpler XML file (via OS_Process), then processing that with Lasso...

what about writing a Lasso custom data source and access the XML through XPATH.

Seems like it would give an interesting level of abstraction. perhaps the performance on large files would make it impractical?

Steve Upton


--


--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/

Reply | Threaded
Open this post in threaded view
|

Re: iTunes Music Library XML

Fletcher Sandbeck-3
On 4/11/08 at 4:04 PM, [hidden email] (Steve Upton) wrote:

>Seems like it would give an interesting level of abstraction.
>perhaps the performance on large files would make it impractical?

The [XMLStream] type offers an alternate XML file reading
technique which should be more efficient on very large files.

<http://reference.lassosoft.com/Reference.LassoApp?[XMLStream]>

There's a little info about it in these tips:

<http://www.lassosoft.com/Documentation/TotW/index.lasso?7544>
<http://www.lassosoft.com/Documentation/TotW/index.lasso?7547>

[fletcher]

--
Fletcher Sandbeck                         [hidden email]
LassoSoft, LLC                          http://www.lassosoft.com


--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/

Reply | Threaded
Open this post in threaded view
|

Re: Wow: iTunes Music Library XML

Jolle Carlestam-2
In reply to this post by Fletcher Sandbeck-3
11 apr 2008 kl. 23.57 skrev Fletcher Sandbeck:
> ListSearch is pretty well indexed.

So I've noticed. It has happened several times recently that I've read  
about something in a Lasso Talk mail, searched for it in Google and  
found that the top hit is Listsearch displaying the very mail I've  
just read... :-)

HDB
Jolle

--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/