SciLor's Open Source Forums

Also visit my Website!
It is currently Tue Mar 19, 2024 10:50 am

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Code Contribution
PostPosted: Mon Feb 21, 2011 11:22 am 
Thanks for the awesome app SciLor, and thanks also for releasing your source code.

I had a play around with it, and added a function for downloading a playlist straight from the playlist id, without logging in first. I also managed to download just enough of the mp3 file to read the header from it, which contains the bitrate, however that is a bit harder to implement (and I did it in C#, not VB) but I will post the code soon.

Anyway, here is the code to download straight from a playlist ID.



And the buttons :



And how to get the playlist url :
1. Open the playlist in grooveshark.
2. And there it is :


Top
  
 
 
Online
The Adswinger

Joined: Wed Jan 13, 2010 11:56 pm
Posts: Too many!
Donated: Ad Posts


 Post subject: Re: Code Contribution
PostPosted: Mon Feb 21, 2011 4:45 pm 
Offline
The Developer

Joined: Wed Jan 13, 2010 11:56 pm
Posts: 1466
Donated:
Thank you for posting the code here, I never thought about it that it is possible to load the playlist without being logged in, but if I find time, it will be implemented soon.

I am really interested in the bitrate code, I just read about it, but hadn't the time to really implement that. C# isn't a problem vb.net and c# are quite the same!

_________________
My Windows Mobile and Windows Open Source Website:


Like my work? Donate!


My Programs:
grooveshark™.com Downloader, GrooveMobile, Fuel Blaster, Chameleon TicTacToe, QuickTap, WiMoBlue, Driving Licence Trainer, CodeSnippetViewer, Gesture Launcher, Fahrplanauskunft, GSensor Control


Top
 Profile  
 
 Post subject: Re: Code Contribution
PostPosted: Tue Feb 22, 2011 7:54 am 
Yeah, the way I did it for testing the bitrate function, was to actually create a .dll of the mp3header reader class, which I could then access from visual basic, within your app :). This was easier than converting the C# code to VB.

I found the mp3 header class from here : , but I created an overload for it to accept a filestream object, because otherwise I was having problems with getting "The file is in use by another process" exceptions, even after closing the file. .Net seems to do that sometimes :p. Oh, and I also changed it a bit so it doesn't close the filestream once it's done. I'll upload the modified class soon.

After that, I just put a try...catch block in your download loop, and within that, first called ReadMp3Information with the filestream object, then if intBitrate was not 0, we have downloaded enough of the file to read the header, and get the bitrate :). I made a sample application in C#, which takes a playlist ID, and prints out a text file of all the songs in the playlist. Of course, I based it off your grooveshark API :).

(Link to my program coming soon)

Unfortunately it will never find the bitrate for some songs, maybe because the header info is stuffed up, who knows. In this case I have added a timeout which sets the bitrate to 0.

It is unrealistic to poll every song in the download list for it's bitrate, but maybe if the user could poll selected songs?


Top
  
 
 Post subject: Re: Code Contribution
PostPosted: Tue Jan 03, 2012 11:27 pm 
Offline
The Developer

Joined: Wed Jan 13, 2010 11:56 pm
Posts: 1466
Donated:
You still got the source laying around of the bitrate tester?

_________________
My Windows Mobile and Windows Open Source Website:


Like my work? Donate!


My Programs:
grooveshark™.com Downloader, GrooveMobile, Fuel Blaster, Chameleon TicTacToe, QuickTap, WiMoBlue, Driving Licence Trainer, CodeSnippetViewer, Gesture Launcher, Fahrplanauskunft, GSensor Control


Top
 Profile  
 
 Post subject: Re: Code Contribution
PostPosted: Wed Jan 04, 2012 3:17 am 
Ah..Shit, I dunno. I'll do some digging.


Top
  
 
 Post subject: Re: Code Contribution
PostPosted: Wed Jan 04, 2012 12:20 pm 
Okay, I found it! Be warned this was using an old rebuilt version of your Grooveshark API, so it'll probably need replacing, but the rest of it should work reasonably well. Also, there's no comments on the code, and all I did was rar up the whole folder. But maybe you'll find it useful!



Top
  
 
 Post subject: Re: Code Contribution
PostPosted: Wed Jan 04, 2012 6:48 pm 
Offline
The Developer

Joined: Wed Jan 13, 2010 11:56 pm
Posts: 1466
Donated:
Thank you for digging ;)

I will just exchange the dlls than it should work fine. I try to keep my dll backwards compatible!

_________________
My Windows Mobile and Windows Open Source Website:


Like my work? Donate!


My Programs:
grooveshark™.com Downloader, GrooveMobile, Fuel Blaster, Chameleon TicTacToe, QuickTap, WiMoBlue, Driving Licence Trainer, CodeSnippetViewer, Gesture Launcher, Fahrplanauskunft, GSensor Control


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
template->_php_include(): File ./counter/foruminclude.php does not exist or is empty Powered by phpBB® Forum Software © phpBB Group