95 thoughts on “SharpMusique 1.0

  1. Johnathan Bailes

    Very neat but I cannot get it to login. I have an Apple account because if I sign up it recognizes that my email already has an account id attached to it.

    But it gives me a dialog box with login failed () and nothing else. I know comments are supposed to be in brackets because if I type in the wrong pass I get the full username or password not correct spiel.

    Its a shame would really like to get this working.

  2. sylvain

    Why Mono? Mono is based on a standard driven by one an only one company (a bit like Java). Better do it in python or ruby or….

  3. bobby555

    SharpMusique 1.0 used to work for me under Ubuntu Hoary but sometime yesterday I tried searching for an artist and the songs returned were without titles. I didn’t reflect then but now I’m thinking it has to do with the update/introduction of music videos in ITMS. The song samples played fine but the titles just didn’t show.

    When does SharpVideo 1.0 come out? ;-)

    Thanks for a great app!!

    Greets from Sweden.

  4. Tony

    I downloaded SharpMusique and reworked the dpkg stuff for Debian Sarge – worked great!

    At least, until iTunes 6 came out the other day… now the title column shows up blank.

  5. Holgi

    Unfortunately this very fine program has stopped working recently. Apple have changed their format and SharpMusique cannot yet cope with it ( so can’t iTunes 4.x on WinDOS btw ):

    1.
    Symptom: Search does not display song titles any more.
    Reason: Song titles now come with key itemName rather than songName as it used to be.
    Resolution: Make the applicable methods look for “itemName” instead of / in addition to “songName”

    2.
    Symptoms: List pending songs now crashes the runtime. Purchased songs get saved as ” – - .m4a”
    Reason: The meta data key in these responses is spelled metadata – mind the case! In other cases we still see metaData.
    Resolution: Make the applicable methods ( mainly DownloadThread and DoTreeViewUpdate ) check for both spellings.

    I’m not quite sure whether this is going to be a permanent change or just an error – Apple won’t lock out their Windows customers, will they ;-)? Hope I saved someone some time searching.
    Greetings
    Holgi

  6. FabioBit

    SharpMusique is a great tool on Fedora 4 too!!

    Unfortunately since October 12th it doesn’t display the title of the songs :-(

    Any Ideas?
    Is it possible that Apple has changed the internal format?
    Is there someone with the same problem?

  7. Dustin

    Today my girlfriend went shopping and left me with one task “I want to be able to buy songs off of itunes”. I was very happy when I found your software. I have it installed on a breezy and a gentoo machine. On both of them, the song titles are either blank or appear as [A] or [B] or [C], etc. Maybe this issue is caused from the new version of itunes? Other than that I think this program is great! I’m sorry I didn’t know where to go for support on this or to file a bug.

  8. Steffen

    There are no song names in the title field.

    Ubuntu 5.10, with the most recent deb file.

    Furthermore, I am not able to download music. Sharpmusique simply shuts down immediately without error. I have tried to run it both as root and as a normal user, and it shuts down regardless.

    Here’s what I’m left with when running it from console:
    /bin/bash: /tmp/98bd98d5-1a5d-4b7a-8edc-737b94d084f4.html: Ikke tilgang (“ikke tilgang” = no access)

    These are the files Sharpmusique does not gain entry to:
    -rw-r--r-- 1 steffen steffen 1528 2005-10-15 15:56 58837eb8-69d3-4a31-b265-643be3ed7d36.html
    -rw-r--r-- 1 root root 1528 2005-10-15 16:08 98bd98d5-1a5d-4b7a-8edc-737b94d084f4.html
    created every time I try to purcahse a song.

    Everything else works fine though. I even created my own apple account through Sharpmusique, as I didn’t have one. Flawless!

  9. Frank

    Hi, Jon,

    thank you for your really great work. You free many of us from the terror of the music industry.

    The minions of stupidity and greed have again mounted an attack and built a new encryption key into iTunes V6.0. JusteTune doesn’t work anymore. (BTW, where is it?) Do you plan to get it working again?

    Regards,

    Frank

  10. Greg

    Anyone else having problems with sharpmusique on Ubuntu Breezy?

    I’m able to log in fine, and search, but search results all have blank song titles.

    Attempts to view an album give:
    Unhandled Exception: System.InvalidCastException: Cannot cast from source type to destination type.
    in SharpMusique:ViewAlbumThread (System.Object State)
    in (wrapper delegate-invoke) System.MulticastDelegate:invoke_void_object (object)

    Any thoughts as to what I should try?

  11. hitch

    don’t want to be the bearer of bad news, but apple’s already locked this sucker out from purchasing.

  12. Mike

    I couldn’t compile the .tar version on Kanotix so I used the .deb for Ubuntu……worked fine..:-)

  13. Luke Elliott

    When I use the version for windows, it says I need a later version of iTunes to download any songs. Any chance you’ll be able to get a version out that will get around this problem?

  14. briphi

    great program, ran the windows version. I wish you could purchase video content DRM free, is that in the workings next?

  15. Dilliner

    In response to hitch:

    Apple hasn’t blocked purchasing yet, as of 1 30pm Oct 22 I am still able to purchase music. The song titles are now viewable for some reason, but I still can’t view album.

  16. Brian

    Just installed SharpMusique 1.0 on Ubuntu Breezy, and noticed a few errors, some of which have been mentioned above.

    Login: The login will almost always fail on the first attempt, usually with a ConnectError. So far I have always connected fine on the second login attempt.

    Redownload: Selecting this will always crash the program.

    Album: The View Album command does nothing, and the Purchase Album option is never enabled.

    File Downloading: After purchasing a file it gets saved as ” – – .m4a” in the download folder. If more than one file is downloaded, only the first file downloaded will be in the folder with that file name, I don’t know if the other files get saved anywhere.

    Hope this helps some, everything else I tried seemed to work fine. Thanks for creating this cool program. :)

  17. hitch

    Dilliner – that’s odd – the day I left the comment I was able to see titles with no problem, but when I attempted to purchase a song I was told that I’d need a newer version of iTunes to do so. The day *before* that, I had experienced the title problem.
    (and the day *after*, my work mac upgraded itunes.)
    so what’s happening?

  18. Rusty Russell

    Works fine on Australian iTunes to purchase song, but album doesn’t seem to work?
    Neither ^V nor Right-Click on a song and View Album do nothing. What’s supposed to happen?

  19. gary capell

    Stupid question: is there support for a http_proxy? I’ve got the standard http_proxy environment variable, but SharpMusique seems to be ignoring it.

  20. Lighthouse

    can anyone tell me HOW to start sharpmusique? i’m a linux newbie, but i have ubuntu breezy running fine. i d/l’d the .deb file and i *think* i installed it correctly (no msg to say one way or the other), but i have no idea how to start it. thanks.

  21. Wayne

    Same here the album view doesn’t work.

    I’m getting the same error ass Greg:

    Unhandled Exception: System.InvalidCastException: Cannot cast from source type to destination type.
    in SharpMusique:ViewAlbumThread (System.Object State)
    in (wrapper delegate-invoke) System.MulticastDelegate:invoke_void_object (object)

  22. Tony

    Based upon Holgi’s note, I made the following patch to SharpMusique 1.0 and it now works w/ iTunes 6.0 and allowed me to purchase music. Good luck!


    --- sharpmusique-1.0/src/SharpMusique.cs.orig 2005-09-16 20:44:11.000000000 -0400
    +++ sharpmusique-1.0/src/SharpMusique.cs 2005-10-27 13:06:18.000000000 -0400
    @@ -526,10 +526,22 @@
    string strSongName;
    string strExplicit = String.Empty;

    - Hashtable meta = dict[ "metaData" ] != null ?
    - (Hashtable)dict[ "metaData" ] : dict;
    + Hashtable meta;

    - strSongName = (string)meta[ "songName" ];
    + if( dict[ "metaData" ] != null )
    + {
    + meta = (Hashtable)dict[ "metaData" ];
    + }
    + else if( dict[ "metadata" ] != null )
    + {
    + meta = (Hashtable)dict[ "metadata" ];
    + }
    + else
    + {
    + meta = dict;
    + }
    +
    + strSongName = (string)meta[ "itemName" ];
    strTime = TimeSpan.FromSeconds(
    (int)meta[ "duration" ] / 1000 ).ToString();
    if( strTime.StartsWith( "00:" ) )
    @@ -613,11 +625,23 @@

    if( song[ "downloadKey" ] == null )
    {
    - Hashtable meta = song[ "metaData" ] != null ?
    - (Hashtable)song[ "metaData" ] : song;
    + Hashtable meta;

    PurchaseDialog dlg = new PurchaseDialog( MainWindow );

    + if( song[ "metaData" ] != null )
    + {
    + meta = (Hashtable)song[ "metaData" ];
    + }
    + else if( song[ "metadata" ] != null )
    + {
    + meta = (Hashtable)song[ "metadata" ];
    + }
    + else
    + {
    + meta = song;
    + }
    +
    if( song[ "isAlbum" ] != null && (bool)song[ "isAlbum" ] == true )
    {
    dlg.Title = "*";
    @@ -625,7 +649,7 @@
    }
    else
    {
    - dlg.Title = (string)meta[ "songName" ];
    + dlg.Title = (string)meta[ "itemName" ];
    dlg.Artist = (string)meta[ "artistName" ];
    }
    dlg.Album = (string)meta[ "playlistName" ];
    @@ -696,15 +720,12 @@
    RunOnMainThread.Run( this, "DoStatusbarUpdate",
    new object[] { cidProgress, "Downloading", 2 } );

    - Hashtable meta = song[ "metaData" ] != null ?
    - (Hashtable)song[ "metaData" ] : song;
    + Hashtable meta;

    byte [] sb = Store.DownloadSong( song,
    new FairStore.Progress( DoProgressUpdate ) );

    - string strFileName = String.Format( "{0} - {1} - {2}.m4a",
    - meta[ "playlistArtistName" ], meta[ "playlistName" ],
    - meta[ "songName" ] );
    + string strFileName;

    string [,] strReps = new string[,]
    {
    @@ -713,6 +734,23 @@
    { "", "" }, { "|", "" }
    };

    + if( song[ "metaData" ] != null )
    + {
    + meta = (Hashtable)song[ "metaData" ];
    + }
    + else if( song[ "metadata" ] != null )
    + {
    + meta = (Hashtable)song[ "metadata" ];
    + }
    + else
    + {
    + meta = song;
    + }
    +
    + strFileName = String.Format( "{0} - {1} - {2}.m4a",
    + meta[ "playlistArtistName" ], meta[ "playlistName" ],
    + meta[ "itemName" ] );
    +
    for( int i = 0; i

  23. MaxPower

    To get the albums to view, in sharpmusique.cs, under the function OnViewAlbum, you need to add .ToString() to song[ "playlistId" ] and recompile. It should work.

  24. Frank

    Like Diliner says, everything but “view album” works, but the song I downloaded hasn’t got a proper filename, it was saved as ” – – .m4a”. (But it place nicely in mplayer and amarok with xine output plugin)

  25. Holgi

    These problems are related to the changes at Apple’s mentioned in my first post here of 10/14. Song title nowadays come as itemName and songName, so we can see them ( we could not around 10/14 ). I tend to assume that Apple are going to drop the songName-entry as soon as they think enough people have migrated to Version 6, but this is a guess only.
    The problems in viewing the albums comes from the playlistId-entry coming as an integer now rather than as a string as it used to be. So the code in ViewAlbumThread around line 1160 should now be
    string strPlaylistId = State.ToString()
    instead of
    string strPlaylistId = (string)State
    Change this, run make and everything is going to be alright.

  26. Dillinger

    Could someone maybe post the SharpMusique.cs file somwhere with the new patch because I can’t seem to get it working myself.

  27. Rusty Russell

    Ok, patch from Tony fixed ” – – .m4a” problem, and strPlaylistId change fixed View Album. Thanks!

    There’s one track which is always truncated at 45k when writing out. Seems to download the whole thing fine, then on writing to disk it’s short. Others work fine, so it’s something about this track:
    -rw-r–r– 1 rusty rusty 45859 Nov 7 18:57 Missy Higgins – The Sound of White – Any Day Now.m4a

    Any hints?

    Thanks!
    Rusty.

  28. Kurt McKee

    I’ve got the patched SharpMusique.cs. As of November 9th, albums work, songs can be redownloaded, and saving of files work (Tony’s and Holgi’s patches above). I’ve had trouble compiling libvlc, however (error below). Anybody know what to do with this?

    http://www.kurtmckee.org/files/SharpMusique.cs

    sap.c: At top level:
    sap.c:1406: warning: conflicting types for ‘FreeSDP’
    sap.c:1406: error: static declaration of ‘FreeSDP’ follows non-static declaration
    sap.c:444: error: previous implicit declaration of ‘FreeSDP’ was here

  29. wbp

    has anyone had problems playing music bought and downloaded with sharpmusique or pymusique on an ipod?

    When ever I’ve tried to load songs I’ve bought with sharpmusique onto my ipod (4g, Shuffle, and Nano) the music loads fine (this is with banshee most recently) however when I go to play the songs, the ipod just skips right through them.

    Any Ideas?

  30. justyb

    The patched SharpMusique.cs file from above works flawless. Everything is back in order.

    Don’t know about the errors, libvlc compiled just fine under FC4

  31. sharpm_is_ROX

    I hit the same libvlc compilation error as Kurt.

    Can’t seem to figure out what the problem is.

    Does anyone have an idea?

    ../../include/network.h: In function ‘vlc_b64_encode’:
    ../../include/network.h:245: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness
    sap.c: In function ‘OpenDemux’:
    sap.c:408: warning: pointer targets in assignment differ in signedness
    sap.c:444: warning: implicit declaration of function ‘FreeSDP’
    sap.c: In function ‘ParseSAP’:
    sap.c:726: warning: pointer targets in passing argument 1 of ‘strcasecmp’ differ in signedness
    sap.c:737: warning: pointer targets in passing argument 2 of ‘ParseSDP’ differ in signedness
    sap.c: At top level:
    sap.c:1406: warning: conflicting types for ‘FreeSDP’
    sap.c:1406: error: static declaration of ‘FreeSDP’ follows non-static declaration
    sap.c:444: error: previous implicit declaration of ‘FreeSDP’ was here

  32. Lane

    Thank you very much, iTMS was one of the last things keeping me from going Ubuntu all the way.

    A few questions:

    1. Can I move my XP bought songs onto Ubuntu and play them?
    2. Can I put the songs bought with SharpMusique on my 5G iPod?
    3. Do you have any plans to offer a store front for the video downloads?
    4. Why do you guys F*ing rock so much?

  33. Dillwead

    I downloaded the patched SharpMusique.cs file from Kurt McGee’s post but I still can’t download music (it complains about needing a newer version of iTunes):

    sharpmusique-1.0]# make clean
    replace file in src dir
    sharpmusique-1.0]# make
    sharpmusique-1.0]# make install

    Am I missing something?

  34. w-r-u

    Any news on the release date of 1.0 for windows?
    (keep buggin’ the poor guy) ;)

  35. Jonathan

    Thanks to Jon, Nicholai, and those who posted patches above, I can now use SharpMusique 1.0 on Windows XP. Woo-hoo! You guys rock!

  36. Stuart

    I have the same problem as dillwead – it says it needs a newer version of iTunes to permit a purchase!

    Stu

  37. Adi

    I’ve patched up the SharpMusique.cs file as posted in the above comments, and my album view is working, but i’m getting the same error as dillweed – anyone have any idea where I might be going wrong?

    Thanks.

  38. Fredster

    I tried to install sharpmusique 1 for Windows through the links provided above by Nicholai but setup failed with an error message saying: Cannot Start Application : Cannot download the application. The application is missing files. Conatact the vendor…

    Can someone please help? I’d love to use the app on Windows and 0.4 didn’t work right.

  39. Fredster

    Got it working now. I had to add the lib-file to the right folder. (Win Version 1.0)
    But: Tags are completely missing, so is the album cover.
    Any help?

  40. Tony

    (Correct if I’m wrong, but this is my feeble understanding.)

    The reason you don’t see tags nor an album cover in music that SharpMusique downloads is that it doesn’t add them. You see, the Windows/Mac iTunes clients actually add Apple’s DRM (including the tags and cover) to each song it downloads – the iTunes servers only hold the raw music data.

    If you want that information, you can always go to a Windows/Mac client and request a redownload of all the music you purchased. (At least, this worked the last time I tried.) This uses up one of your FairPlay seats, but now you’ve got the best of both worlds, a DRM’ed copy and a non-DRM’ed copy.

  41. JHBoricua

    How do I install the 1.0 Windows version by Nicholai?? I keep getting an error stating that it cannot download the application. There’s not enough detail on Fredster second post to figure out what he did to fix this. Which lib file? Move it where?

  42. Alex DeWolf

    Hello:
    I am running Suse 10 and on an Intel EMS CPU (X86_64). I get the following:

    gcc -shared -o ../libvlc.so $OBJECTS `./vlc-config –libs builtin`)
    /usr/lib64/gcc/x86_64-suse-linux/4.0.2/../../../../x86_64-suse-linux/bin/ld: /home/adewolf/Downloads/sharpmusique-1.0/libvlc/faad2/libfaad/.libs/libfaad.a(decoder.o): relocation R_X86_64_32S against `err_msg’ can not be used when making a shared object; recompile with -fPIC
    /home/adewolf/Downloads/sharpmusique-1.0/libvlc/faad2/libfaad/.libs/libfaad.a: could not read symbols: Bad value
    collect2: ld returned 1 exit status
    make[1]: *** [libvlc.so] Error 1
    make[1]: Leaving directory `/home/adewolf/Downloads/sharpmusique-1.0/libvlc’
    make: *** [all-recursive] Error 1

    Any ideas?

    Alex

  43. niteHawk

    Ack – the patched CS file is no longer available on the website, and I can’t seem to get the patch file itself to patch (it keeps complaining about being malformed).
    Does anyone have a working patch or the entire cs file somewhere that they can post/mail it? I’ll host it for everyone else.
    nitehawk@noodlehoops.net

  44. Shawn

    Hi niteHawk

    I am NOT a programmer, but after many hours fiddling it looks like indentation seems to be important in this language and hence the patch file (somebody who programs can you confirm?). So I manually added all the lines and after repeated build steps it completed building. I copied the original SharpMusique.cs to a new directory, say patch, and renamed SharpMusique.cs to SharpMusique-original.cs I the ran the following command on the file against my manually modified SharpMusique
    diff -Naur SharpMusique-original.cs SharpMusique.cs >sharpmusique-patchfile

    I do not know what that means but I found it after some time googling. (once again I am sure there are far brighter people out there who can tell you if I did the right thing)

    So if my understanding of the process is correct, you need to cut and paste the below into a file say called sharpmusique-patchfile and save it in some arbitrary directory with the original SharpMusique.cs

    Then run
    patch SharpMusique.cs >sharpmusique-patchfile

    Then do your normal configure, make clean, make and finally a make install (make install as root)

    So once again I am not a programmer I was just intrigue why some people would quote success but not say how they achieved it. I hope this has gone partway to answering your question, note I can only confirm it compiles and the program appears to run. I have not tried to log in or buy songs etc.

    Regards
    Shawn

    So cut and paste below keeping all spaces and dowhatchamacallits as below.

    — SharpMusique-original.cs 2005-09-16 18:44:11.000000000 -0600
    +++ SharpMusique.cs 2005-12-31 21:13:36.000000000 -0700
    @@ -526,10 +526,23 @@
    string strSongName;
    string strExplicit = String.Empty;

    - Hashtable meta = dict[ "metaData" ] != null ?
    - (Hashtable)dict[ "metaData" ] : dict;
    + Hashtable meta;
    +
    + if( dict[ "metaData" ] != null )
    + {
    + meta = (Hashtable)dict[ "metaData" ];
    + }
    + else if( dict[ "metadata" ] != null )
    + {
    + meta = (Hashtable)dict[ "metadata" ];
    + }
    + else
    + {
    + meta = dict;
    + }
    +
    + strSongName = (string)meta[ "itemName" ];

    - strSongName = (string)meta[ "songName" ];
    strTime = TimeSpan.FromSeconds(
    (int)meta[ "duration" ] / 1000 ).ToString();
    if( strTime.StartsWith( “00:” ) )
    @@ -613,11 +626,23 @@

    if( song[ "downloadKey" ] == null )
    {
    - Hashtable meta = song[ "metaData" ] != null ?
    - (Hashtable)song[ "metaData" ] : song;
    + Hashtable meta;

    PurchaseDialog dlg = new PurchaseDialog( MainWindow );

    + if( song[ "metaData" ] != null )
    + {
    + meta = (Hashtable)song[ "metaData" ];
    + }
    + else if( song[ "metadata" ] != null )
    + {
    + meta = (Hashtable)song[ "metadata" ];
    + }
    + else
    + {
    + meta = song;
    + }
    +
    if( song[ "isAlbum" ] != null && (bool)song[ "isAlbum" ] == true )
    {
    dlg.Title = “*”;
    @@ -625,7 +650,7 @@
    }
    else
    {
    - dlg.Title = (string)meta[ "songName" ];
    + dlg.Title = (string)meta[ "itemName" ];
    dlg.Artist = (string)meta[ "artistName" ];
    }
    dlg.Album = (string)meta[ "playlistName" ];
    @@ -696,15 +721,12 @@
    RunOnMainThread.Run( this, “DoStatusbarUpdate”,
    new object[] { cidProgress, “Downloading”, 2 } );

    - Hashtable meta = song[ "metaData" ] != null ?
    - (Hashtable)song[ "metaData" ] : song;
    + Hashtable meta;

    byte [] sb = Store.DownloadSong( song,
    new FairStore.Progress( DoProgressUpdate ) );

    - string strFileName = String.Format( “{0} – {1} – {2}.m4a”,
    - meta[ "playlistArtistName" ], meta[ "playlistName" ],
    - meta[ "songName" ] );
    + string strFileName;

    string [,] strReps = new string[,]
    {
    @@ -712,6 +734,22 @@
    { “*”, “” }, { “?”, “” }, { “”", “‘” },
    { “”, “” }, { “|”, “” }
    };
    + if( song[ "metaData" ] != null )
    + {
    + meta = (Hashtable)song[ "metaData" ];
    + }
    + else if( song[ "metadata" ] != null )
    + {
    + meta = (Hashtable)song[ "metadata" ];
    + }
    + else
    + {
    + meta = song;
    + }
    +
    + strFileName = String.Format( “{0} – {1} – {2}.m4a”,
    + meta[ "playlistArtistName" ], meta[ "playlistName" ],
    + meta[ "itemName" ] );

    for( int i = 0; i

  45. Shawn

    Hi NiteHawk

    I added the suggestion by Holgi above as well so here is the new diff file. I hope that a cut and paste transfers all the spaces as I can’t see how to attach a file.

    Regards
    Shawn

    — SharpMusique-original.cs 2005-09-16 18:44:11.000000000 -0600
    +++ SharpMusique.cs 2005-12-31 21:44:42.000000000 -0700
    @@ -526,10 +526,23 @@
    string strSongName;
    string strExplicit = String.Empty;

    - Hashtable meta = dict[ "metaData" ] != null ?
    - (Hashtable)dict[ "metaData" ] : dict;
    + Hashtable meta;
    +
    + if( dict[ "metaData" ] != null )
    + {
    + meta = (Hashtable)dict[ "metaData" ];
    + }
    + else if( dict[ "metadata" ] != null )
    + {
    + meta = (Hashtable)dict[ "metadata" ];
    + }
    + else
    + {
    + meta = dict;
    + }
    +
    + strSongName = (string)meta[ "itemName" ];

    - strSongName = (string)meta[ "songName" ];
    strTime = TimeSpan.FromSeconds(
    (int)meta[ "duration" ] / 1000 ).ToString();
    if( strTime.StartsWith( “00:” ) )
    @@ -613,11 +626,23 @@

    if( song[ "downloadKey" ] == null )
    {
    - Hashtable meta = song[ "metaData" ] != null ?
    - (Hashtable)song[ "metaData" ] : song;
    + Hashtable meta;

    PurchaseDialog dlg = new PurchaseDialog( MainWindow );

    + if( song[ "metaData" ] != null )
    + {
    + meta = (Hashtable)song[ "metaData" ];
    + }
    + else if( song[ "metadata" ] != null )
    + {
    + meta = (Hashtable)song[ "metadata" ];
    + }
    + else
    + {
    + meta = song;
    + }
    +
    if( song[ "isAlbum" ] != null && (bool)song[ "isAlbum" ] == true )
    {
    dlg.Title = “*”;
    @@ -625,7 +650,7 @@
    }
    else
    {
    - dlg.Title = (string)meta[ "songName" ];
    + dlg.Title = (string)meta[ "itemName" ];
    dlg.Artist = (string)meta[ "artistName" ];
    }
    dlg.Album = (string)meta[ "playlistName" ];
    @@ -696,15 +721,12 @@
    RunOnMainThread.Run( this, “DoStatusbarUpdate”,
    new object[] { cidProgress, “Downloading”, 2 } );

    - Hashtable meta = song[ "metaData" ] != null ?
    - (Hashtable)song[ "metaData" ] : song;
    + Hashtable meta;

    byte [] sb = Store.DownloadSong( song,
    new FairStore.Progress( DoProgressUpdate ) );

    - string strFileName = String.Format( “{0} – {1} – {2}.m4a”,
    - meta[ "playlistArtistName" ], meta[ "playlistName" ],
    - meta[ "songName" ] );
    + string strFileName;

    string [,] strReps = new string[,]
    {
    @@ -712,6 +734,22 @@
    { “*”, “” }, { “?”, “” }, { “”", “‘” },
    { “”, “” }, { “|”, “” }
    };
    + if( song[ "metaData" ] != null )
    + {
    + meta = (Hashtable)song[ "metaData" ];
    + }
    + else if( song[ "metadata" ] != null )
    + {
    + meta = (Hashtable)song[ "metadata" ];
    + }
    + else
    + {
    + meta = song;
    + }
    +
    + strFileName = String.Format( “{0} – {1} – {2}.m4a”,
    + meta[ "playlistArtistName" ], meta[ "playlistName" ],
    + meta[ "itemName" ] );

    for( int i = 0; i

  46. Shawn

    Well Nitehawk I just checked and all the spaces where removed by this program. So you will have to tell me know what to do to display the correct format.

    Regards
    Shawn

  47. Shawn

    Hi Nitehawk

    I have emailed you the files.

    I did as a test create an account for myself and purchase a song and download it. I also viewed album. The biggest problem is logging in, seems to take multiple attempts. My wag (wild ass guess) is its mono that’s catching a wake up call as things slow on my PC then I can log in and all works well.

    Have fun.

    Regards
    Shawn
    (note I do not support music piracy, mearly the freedom to enjoy something you paid good money for that is apparently now yours for your exclusive enjoyment.)

  48. Shawn

    Has anyone figured out why it takes between 5 to 10 attempts to log in before it logs in? It also tends to freeze if the log in is unsuccesfull or the freezing is the cause for the unsuccessful log in.

  49. niteHawk

    Shawn,
    Just a note – I took your manually patched sharpmusique.cs file, and did a make clean, make, and make install.

    I still receive the “you need a newer version of iTunes to purchase music” error.

    I am going to play around with it some more.
    nH

  50. Bill

    Here is a diff with what I used to get it to compile based upon the above patches.

    It fixes the problems with the FreeSDP issue and the translation issue related to the t- prefix.

    It has not been extensively tested, but I could at least listen to song previews on it.


    diff -ur sharpmusique-1.0/libvlc/vlc-trunk/modules/services_discovery/sap.c sharpmusique-1.0-patched/libvlc/vlc-trunk/modules/services_discovery/sap.c
    --- sharpmusique-1.0/libvlc/vlc-trunk/modules/services_discovery/sap.c 2005-09-16 19:45:31.000000000 -0500
    +++ sharpmusique-1.0-patched/libvlc/vlc-trunk/modules/services_discovery/sap.c 2006-01-09 01:03:48.000000000 -0600
    @@ -102,6 +102,10 @@
    static int OpenDemux ( vlc_object_t * );
    static void CloseDemux ( vlc_object_t * );

    +/* Prototype */
    + static void FreeSDP();
    +
    +
    vlc_module_begin();
    set_shortname( _("SAP"));
    set_description( _("SAP announces") );
    diff -ur sharpmusique-1.0/libvlc/vlc-trunk/po/Makefile.in.in sharpmusique-1.0-patched/libvlc/vlc-trunk/po/Makefile.in.in
    --- sharpmusique-1.0/libvlc/vlc-trunk/po/Makefile.in.in 2005-09-16 19:45:44.000000000 -0500
    +++ sharpmusique-1.0-patched/libvlc/vlc-trunk/po/Makefile.in.in 2006-01-09 01:31:17.000000000 -0600
    @@ -59,13 +59,13 @@

    .po.mo:
    @echo "$(MSGFMT) -c -o $@ $ t-$@
    diff -ur sharpmusique-1.0/src/SharpMusique.cs sharpmusique-1.0-patched/src/SharpMusique.cs
    --- sharpmusique-1.0/src/SharpMusique.cs 2005-09-16 19:44:11.000000000 -0500
    +++ sharpmusique-1.0-patched/src/SharpMusique.cs 2006-01-09 01:03:48.000000000 -0600
    @@ -526,10 +526,23 @@
    string strSongName;
    string strExplicit = String.Empty;

    - Hashtable meta = dict[ "metaData" ] != null ?
    - (Hashtable)dict[ "metaData" ] : dict;
    + Hashtable meta;
    +
    + if( dict[ "metaData" ] != null )
    + {
    + meta = (Hashtable)dict[ "metaData" ];
    + }
    + else if( dict[ "metadata" ] != null )
    + {
    + meta = (Hashtable)dict[ "metadata" ];
    + }
    + else
    + {
    + meta = dict;
    + }
    +
    + strSongName = (string)meta[ "itemName" ];

    - strSongName = (string)meta[ "songName" ];
    strTime = TimeSpan.FromSeconds(
    (int)meta[ "duration" ] / 1000 ).ToString();
    if( strTime.StartsWith( "00:" ) )
    @@ -613,11 +626,23 @@

    if( song[ "downloadKey" ] == null )
    {
    - Hashtable meta = song[ "metaData" ] != null ?
    - (Hashtable)song[ "metaData" ] : song;
    + Hashtable meta;

    PurchaseDialog dlg = new PurchaseDialog( MainWindow );

    + if( song[ "metaData" ] != null )
    + {
    + meta = (Hashtable)song[ "metaData" ];
    + }
    + else if( song[ "metadata" ] != null )
    + {
    + meta = (Hashtable)song[ "metadata" ];
    + }
    + else
    + {
    + meta = song;
    + }
    +
    if( song[ "isAlbum" ] != null && (bool)song[ "isAlbum" ] == true )
    {
    dlg.Title = "*";
    @@ -625,7 +650,7 @@
    }
    else
    {
    - dlg.Title = (string)meta[ "songName" ];
    + dlg.Title = (string)meta[ "itemName" ];
    dlg.Artist = (string)meta[ "artistName" ];
    }
    dlg.Album = (string)meta[ "playlistName" ];
    @@ -696,15 +721,12 @@
    RunOnMainThread.Run( this, "DoStatusbarUpdate",
    new object[] { cidProgress, "Downloading", 2 } );

    - Hashtable meta = song[ "metaData" ] != null ?
    - (Hashtable)song[ "metaData" ] : song;
    + Hashtable meta;

    byte [] sb = Store.DownloadSong( song,
    new FairStore.Progress( DoProgressUpdate ) );

    - string strFileName = String.Format( "{0} - {1} - {2}.m4a",
    - meta[ "playlistArtistName" ], meta[ "playlistName" ],
    - meta[ "songName" ] );
    + string strFileName;

    string [,] strReps = new string[,]
    {
    @@ -712,6 +734,22 @@
    { "*", "" }, { "?", "" }, { """, "'" },
    { "", "" }, { "|", "" }
    };
    + if( song[ "metaData" ] != null )
    + {
    + meta = (Hashtable)song[ "metaData" ];
    + }
    + else if( song[ "metadata" ] != null )
    + {
    + meta = (Hashtable)song[ "metadata" ];
    + }
    + else
    + {
    + meta = song;
    + }
    +
    + strFileName = String.Format( "{0} - {1} - {2}.m4a",
    + meta[ "playlistArtistName" ], meta[ "playlistName" ],
    + meta[ "itemName" ] );

    for( int i = 0; i

  51. niteHawk

    Hey Bill,
    Can you email me your SharpMusique.cs file? The posting of Diff files seems to break on this comment system. I am trying to compile this for SuSE and so far, nothing has been working – I really need to spend some concentrated effort on it all… I just hanv’t anaged to get the time yet… I am hoping your file can jump start me :-)
    What platform are you on as well?

    nitehawk@noodlehoops.com

  52. Shawn

    Hi Nitehawk

    I just realised I had done one other thing. Under my .Sharpmusique directory I had pasted the SharpMusiqueWin_TemporaryKey.pfx file from one of the above windows compiled versions above as this was one of the missing things when I did a comparison between the linux version and windows, but by all else I just installed the compile as you have.

    I could then create my account, log in and purchase a song and listen to previews. I just tested it again and it worked. I do not have a clue what SharpMusiqueWin_TemporaryKey.pfx is, but it seemed to be the only difference between the windows version which people said worked and the linux. I unfortunately did not try to log onto the system prior to copying this over as I had not realised the software had to be patched so I first did this then read up about the patching.

    One thing I did do as well was copy every library that had gtk, mono and sharp as a name into my system out of frustration earlier. Some reading on the net says if you have used the newest version of itunes with your account then you can not use a old version again, so perhaps create a new account with sharpmusique.
    Shawn

  53. BigAl

    Just a comment on the source patches – Python uses (tabs) indentation to mark scope levels, and HTML rendering strips out whitespace, including tabs.

  54. Mark James

    Whould someone please post an installer for Sharpmusique 1.0 for windows? I can’t figure out how this patch works.

    Thanks,
    Mark

  55. Nicholai Yu

    The temporary key file is the digital signature generated by my development tool. If you use Microsoft’s compiler to compile the file, you don’t need the temporary key. The reason why my package has it is because it was required for signing web based installers. If you don’t want to create ClickOnce installers, you won’t need it.

  56. Sjaaksken

    Hi I have a problem running the software. I compiled it with the /usr prefix but when I run sharpmusique I get an error saying:

    /bin/bash: /tmp/0d6b00bb-5394-4d8e-9b6f-409ad997eb1c.html: Access denied.

    And it doesn’t load.

    I checked the file (there are several created apparently) in the /tmp folder it says:

    Cannot get resource file 'SharpMusique.glade' Parameter name: resource_name in Glade.XML:.ctor (System.Reflection.Assembly,string,string,string) in SharpMusique:.ctor (string[]) in SharpMusique:Main (string[])

    I didn’t get an error message during compile so I have no idea what’s causing this…

    Any ideas? :)

  57. Dillwead

    So I just verified that if you have ever logged in (or perhaps only downloaded music) with an iTunes account on iTunes 6.0 or newer you will not be able to use that account in sharpmusique. When you try to purchase a song, you will get the “Buy failed (This item requires a later version of iTunes to purchase.)” message. If you want to buy with sharpmusique then you must create a new account.

  58. mqk

    Great work everyone! Thanks for posting all these fixes.

    I thought I’d share some trouble I ran into with the ViewAlbumThread fix posted by Holgi back on Oct. 31 2005. After implementing the change and recompiling, I started up sharpmusique to test out ViewAlbum. I typed ‘U2′ into the Search bar and hit return. Then I selected the song ‘I Will Follow’ from the album ‘The Complete U2 – Boy’, and hit ‘Ctrl-V’. To my dismay I got an error window with the message ‘Number overflow.’

    I went back to the source to make sure I didn’t mess up the edit, but that was fine. I tried a ‘make clean; make; make install’ but that didn’t fix it either. I then tried the fix that MaxPower suggested on Oct. 28th, but same problem.

    In the end it turned out that the problem seems to be specific to U2′s ‘The Complete U2 – *’ albums. ‘View Songs’ works fine with other artists that I tried, and even for the one U2 track that is not part of a ‘The Complete U2 – *’ album. Just my luck that I tried it first with U2…

    Can anyone else reproduce this? Any ideas as to what’s going wrong here?

    Cheers, mqk

  59. Solar

    Hey there, guys!

    Got a problem with Sharpmusique 0.4 on Windows:

    It tells me that I already bought one of the songs I need, although that’s not correct.
    So I can’t purchase/download this special song because of this error message.
    I tried the option “redownload” but that doesn’t work, too.
    I get this error message in my browser, when I try to use this function:

    “Exception has been thrown by the target of an invocation. at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean verifyAccess) at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean verifyAccess) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters) at RunOnMainThread.Go() at GLib.IdleProxy.Handler() at Gtk.Application.gtk_main() at Gtk.Application.Run() at SharpMusique..ctor(String[] args) at SharpMusique.Main(String[] args)”

    Any ideas how I can purchase this song or how I can solve the problem with the redownload-function?
    Thanks so much,

    Solar

  60. holgi

    To mqk (The Complete U2 problem):
    Our friends at Apple seem to have developed a new kind of structure for this (and possibly other) collections which SharpMusique can’t cope with. Normal albums have a flat of -Elements with “kind” = “song” in their -Element, which is evaluated by SharpMusique. “The Complete U2″ have an array of dicts with kind=folder, each of which in turn contains another items element, and only here the songs themselves are described.
    This problem cannot be solved with a simple patch, all solutions I can think of involve more or less a redesign to either honor the “folder” structure or to simply merge all sub-”items” arrays together into one flat array. But I’m afraid that I won’t do it, sorry.

  61. holgi

    Correction, hope the sentence is readable now:
    Normal albums have a flat <array> of <dict>-elements with “kind” = “song” in their items-Element …

  62. sgarissta

    Is this still working for anyone? On Ubuntu all I get when attempting to purchase a song, is a message that a later version of ITunes is required.

  63. Dandapani

    I had to recompile SharpMusique after upgrading to Fedora Core 5 and now it won’t preview songs. An error pops up with the single word “libvlc” showing. Digging into it now, but no idea at this point. I assume there is some error in the libvlc library, but nothing shows….

  64. Patrick

    I had been using SharpMusique 0.4 on Windows and could purchase and download songs without any problem, but I wanted to use the Redownload feature which was crashing.

    So I installed the provided 1.0 version. Using the same account I tried the Redownload feature but it showed nothing (maybe this has to do with the fact that I bought the songs with the 0.4 version?). Also when I tried to purchase a song, I got the “need newer version of iTunes” error message.

    I’d really just wish to have a way to redownload the songs that I have successfully purchased so far with 0.4, but I’d also like to use 1.0 which looks a lot nicer (and supports Japanese fonts).

    Thanks for all the great work, I hope that SharpMusique will stay up-to-date, as we really need an alternative to iTunes (not just for the DRM, but also because of iTunes’ heavy interface that I can’t stand).

  65. sandog

    Yes it still works for FC5. I had problems with vlc. Got similar error as
    Alex DeWolf (December 29th, 2005 at 9:53 am) above.

    My notes are below.

    Notes for compiling sharpmusique on FC5 x86_64(gcc 4.1)

    1. Install mono libs.
    mono-basic
    mono-core
    mono-data
    mono-devel
    mono-web
    mono-winforms
    gtk-sharp
    gtk-sharp2

    2. Make sure u start with a clean sharpmusique folder. Doing “make clean” wont help with the vlc error.
    Fix file sharpmusique.cs (patch)

    3. Flags
    CFLAGS=’-fPIC -fpic’
    LD_LIBRARY_PATH=’/usr/lib/pkgconfig’ //did not need it but used to on fc4 32bit mode

    4. To compile
    export CFLAGS=’-fPIC -fpic’
    ./configure
    make
    make install

  66. dogsch

    Is it possible to create an Ubuntu Live CD with Sharpmusiuqe on it?

    And if yes where do I find an instruction?

    Thanx

  67. Dandapani

    I duplicated sandog’s work above, starting with freshly untar’ed area, applying the SharpMusique.cs patch, etc., and still can’t preview songs. I could, however, purchase a song, so all isn’t lost. Thanks.

  68. Don

    Hello. Can anyone tell me if SharpMusique will let you download video from iTunes? I’m trying to find a way to download video from iTunes onto my Fedora 4 laptop. Thanks.

  69. Hal

    The sharpmusique for windows will not install. On my computer it complains about a missing “SharpMusiqueWin.exe.manifest” file not being present. Could someone post the code (its xml) otherwise fix the .net deployment. Thanks.

    BTW John when is your version comming out.

  70. Hal

    Is it natural for the SharpmusiqueWin .net deployment to fail? I have been trying to find a way around this but it isnt working. It says the manifest file is missing. Any clues?

  71. Hal

    Can anyone explain why the windows version will not deploy correctly? The manifest file is missing and i have tried a bunch a ways to get the system to bypass this but it wont.

    Any plans on getting out an official version?

  72. Andrew

    Upon execution, I see the following errors in the command line:
    (/usr/local/lib/sharpmusique/sharpmusique.exe:3117): GLib-GObject-CRITICAL **: gtype.c:2254: initialization assertion failed, use g_type_init() prior to this function

    Any ideas? Other than that, the program works fine.

  73. Dandapani

    I’ve made some progress on figuring out the SharpMusique problem on Fedora Core 5.

    I found how to turn debugging on in mono:

    MONO_LOG_LEVEL=”info” /usr/local/bin/sharpmusique

    (then I tried to preview an song…)

    Mono-INFO: DllImport attempting to load: ‘libvlc’.
    Mono-INFO: DllImport loading location: ‘libvlc’.
    Mono-INFO: DllImport error loading library: ‘/usr/local/lib/sharpmusique/libvlc.so: cannot restore segment prot after reloc: Permission denied’.

    and I get the “libvlc” popup error.

    I found looking in http://bugzilla.redhat.com that they changed the SElinux permissions and some programs have problems like this. Have to change the permissions on the shared library.

    chcon -t textrel_shlib_t /usr/local/lib/sharp*/libvlc.so

    This enables loading, but I get a different failure and mono dies.

    mono: pcm_plug.c:384: snd_pcm_plug_change_channels: Assertion `snd_pcm_format_linear(slv->format)’ failed.
    Abort

    From what I can gather, SharpMusique uses VLC as its underlying player. And VLC doesn’t play well with the new Linux ALSA sound package. There are workarounds for the VLC player, but SM only uses the library. I haven’t found the knobs to turn yet to make it work. I wonder if a later library would fix it up? Anyone have any experience?

  74. Jared

    I’m having the same libvlc problems in Fedora Core 5 that were reported earlier. The recompile on a clean directory with -fPIC and -fpic flags doesn’t seem to have helped. Anybody been able to make it work, or have other ideas?

  75. Jared

    I managed to fix the problems with libvlc and song previews occuring in Fedora Core 5. The problem (for me anyway) had two parts. The first had to do with the SELinux security context on the libvlc shared object. To fix this run:
    sudo chcon -t texrel_shlib_t /usr/local/lib/sharpmusique/libvlc.so

    The second problem I had after fixing the security context was that Sharpmusique would crash with the following error when I tried to preview:
    pcm_plug.c:384: snd_pcm_plug_change_channels: Assertion `snd_pcm_format_linear(slv->format)’ failed.

    This has something to do with incompatabilities between vlc and alsa. The fix is to switch vlc to use the oss audio output framework instead of alsa. This is done by modifying the VLC.cs source file for Sharpmusique. It’s a one line change on (in my version) line 132. Change it from:
    Error err = VLC_Init( iVLC, 2, new string[] { “vlc”, “–quiet” } );
    to:
    Error err = VLC_Init( iVLC, 4, new string[] { “vlc”, “–quiet”, “–aout”, “oss”} );
    and recompile sharpmusique.

    The downside to this fix is that oss is the old audio framework for linux and doesn’t support software mixing. That means sharpmusique will only be able to play the preview clips if you don’t have any other applications which are using the soundcard. So you have to shut down your music player before using sharpmusique. No the greatest solution, but I can preview songs again.

  76. Joshua

    About the “Manifest” Error – set Internet Explorer as standard browser and it’ll work :-(

    (reset to Firefox et al. later:-) )

  77. Scott

    SM 1.0 was working last week, but as of this morning I get a “Purchase Failed, need new version of Mac OS” error.
    Any ideas?

  78. Dan

    Unofficial 1.0 version now gives the message that you must have a newer version of iTunes to purchase. :(

  79. Dandapani

    Thanks to Joshua for fixing it. But his changed line in VLC.cs has typos. Should be:

    Error err = VLC_Init( iVLC, 4, new string[] { “vlc”, “–quiet”, “–aout”, “oss”} );

    Double dashes, not single.

  80. Dandapani

    Ooops. Looks like the blog code is joining the double dashes into a single long dash….

    Single dash = “-”
    Double dashes = “–”

    So I guess his code is golden after all. Thanks, again!

Comments are closed.