Jump to content


Photo
- - - - -

Pianobarfly


  • Please log in to reply
23 replies to this topic

#1 fie

fie

    Newbie

  • Active Members
  • 5 posts

Posted 22 February 2010 - 08:23 AM

Pandora stream saver for linux based on Pianobar.



Install instructions in video info.

#2 ZigZagJoe

ZigZagJoe

    Hak5 Ninja

  • Active Members
  • PipPipPipPipPipPipPip
  • 896 posts

Posted 22 February 2010 - 01:28 PM

QUOTE (fie @ Mon, 22 Feb 2010 07:23:48 +0000) <{POST_SNAPBACK}>
Pandora stream saver for linux based on Pianobar.



Install instructions in video info.

Surprised it took so long for someone to finally bite the bullet and do it.

Some suggestions, looking at the source:
- You might want to mangle the stream selection logic so it only requests mp3-hifi - this will cause any client to get 128kbs mp3, and 192kbs if they are subscribers.
- Tagging logic would be nice - take a look at id3ed
- You'll probably want to remove various "bad" path chars, though windows is a bit more restrictive than linux when it comes to that so it might not be needed.
- Artist/album/title fields are too small - i'd recommend putting them in the region of 250 or so, just to be safe. Pandora likes long names, especially when it comes to classical music.
- You might want to disable skip (or handle when it does occur) as it'd leave a truncated stream

Oh, and about that one comment; I'm only here for this forum, never watched the show. Guess i shouldn't bother.
Saver2 Website - timeshift w/ pandora, grooveshark, and more!
Saver2 Installer - includes standalone pandora client, along with grooveshark, slacker, and pandora timeshifting plugins.
Standalone Pandora Client - Look ma, no flash!

Support thread Donation link

WEBIRC #saver2 @ irc.coldfront.net

#3 fie

fie

    Newbie

  • Active Members
  • 5 posts

Posted 22 February 2010 - 05:21 PM

QUOTE (ZigZagJoe @ Mon, 22 Feb 2010 13:28:21 +0000) <{POST_SNAPBACK}>
Surprised it took so long for someone to finally bite the bullet and do it.

Some suggestions, looking at the source:
- You might want to mangle the stream selection logic so it only requests mp3-hifi - this will cause any client to get 128kbs mp3, and 192kbs if they are subscribers.
- Tagging logic would be nice - take a look at id3ed
- You'll probably want to remove various "bad" path chars, though windows is a bit more restrictive than linux when it comes to that so it might not be needed.
- Artist/album/title fields are too small - i'd recommend putting them in the region of 250 or so, just to be safe. Pandora likes long names, especially when it comes to classical music.
- You might want to disable skip (or handle when it does occur) as it'd leave a truncated stream

Oh, and about that one comment; I'm only here for this forum, never watched the show. Guess i shouldn't bother.

And I was so positive that nobody would ever find that. I thank you for proving me wrong. It's so common now-a-days that people run code without checking it first.

I do remove bad path characters.

I was pretty sure that pianobar automatically selected 192 if you have it.

At the moment I'm working on having a better understanding of how input is handled with it. I want to add the very basic feature of volume control. It ought to be quite easy (is the same thing I said when I wanted pianobar to save streams).

But yeah, i will eventually handle skipping, id3 is up there on my list as well (already looked into it), and I will adjust the buffer size for file names etc. next time that I work on it.

#4 lopez1364

lopez1364

    Hak5 Pirate

  • Active Members
  • PipPipPipPipPipPip
  • 258 posts
  • Gender:Male
  • Location:Katy, TX

Posted 22 February 2010 - 05:54 PM

OH this will work. I'm all over this.
"Everybody can make something complicated,
what's hard is to make something simple."








Visit My BLOG

#5 ZigZagJoe

ZigZagJoe

    Hak5 Ninja

  • Active Members
  • PipPipPipPipPipPipPip
  • 896 posts

Posted 22 February 2010 - 07:37 PM

QUOTE (fie @ Mon, 22 Feb 2010 16:21:12 +0000) <{POST_SNAPBACK}>
And I was so positive that nobody would ever find that. I thank you for proving me wrong. It's so common now-a-days that people run code without checking it first.

I do remove bad path characters.

I was pretty sure that pianobar automatically selected 192 if you have it.

At the moment I'm working on having a better understanding of how input is handled with it. I want to add the very basic feature of volume control. It ought to be quite easy (is the same thing I said when I wanted pianobar to save streams).

But yeah, i will eventually handle skipping, id3 is up there on my list as well (already looked into it), and I will adjust the buffer size for file names etc. next time that I work on it.


Heh. I was bored, so why not? tongue.gif

I saw the spaces being removed (then again, spaces are arguably the worst not-invalid char) but didn't see other chars. OTOH, *nix will accept just about anything in a path name. EDIT: Oh, i see, the diff wasn't updated. Ahhh, you have snprintf instead of sprintf in there too (that's what prompted the comment about buffers).

You could mess about with the system's mixer for a basic control, but there's probably a better way to do it.

Could just delete partial files (go to where the skip is done). Or, you could have another thread take over the socket where it would normally be closed and finish reading it. Took a quick look and didn't find this, though.

ID3 stuff could be put in where you put the rest of the stuff at the very start with the sprintfs; if player.exists == 0, write tag. You'd want to set the initial value of exists to something else though.

Also, it doesn't look like the bit you added in BarPlayerBufferFill (starts with "//fie -- whoo!") respects exists - it'd be overwriting existing files.

Edited by ZigZagJoe, 22 February 2010 - 07:45 PM.

Saver2 Website - timeshift w/ pandora, grooveshark, and more!
Saver2 Installer - includes standalone pandora client, along with grooveshark, slacker, and pandora timeshifting plugins.
Standalone Pandora Client - Look ma, no flash!

Support thread Donation link

WEBIRC #saver2 @ irc.coldfront.net

#6 fie

fie

    Newbie

  • Active Members
  • 5 posts

Posted 24 February 2010 - 03:52 AM

I added volume controls this morning.
, for volume down and . for volume up

I changed the buffer size on names/directories.

QUOTE (ZigZagJoe @ Mon, 22 Feb 2010 19:37:01 +0000) <{POST_SNAPBACK}>
said stuff

Why do you say that it doesn't respect exists?

--edit
Maybe the condition believes in existential nihilism?

Edited by fie, 24 February 2010 - 07:29 AM.


#7 ZigZagJoe

ZigZagJoe

    Hak5 Ninja

  • Active Members
  • PipPipPipPipPipPipPip
  • 896 posts

Posted 24 February 2010 - 01:14 PM

QUOTE (fie @ Wed, 24 Feb 2010 02:52:12 +0000) <{POST_SNAPBACK}>
I added volume controls this morning.
, for volume down and . for volume up

I changed the buffer size on names/directories.


Why do you say that it doesn't respect exists?

--edit
Maybe the condition believes in existential nihilism?


It looks like it'd be overwriting existing files - in BarPlayerBufferFill.

FILE *fp = fopen(player->tmpname, "ab");
fwrite(data, dataSize, 1, fp);
fclose(fp);

Actually, that'd just be sticking more data on the end of the existing file...

Saver2 Website - timeshift w/ pandora, grooveshark, and more!
Saver2 Installer - includes standalone pandora client, along with grooveshark, slacker, and pandora timeshifting plugins.
Standalone Pandora Client - Look ma, no flash!

Support thread Donation link

WEBIRC #saver2 @ irc.coldfront.net

#8 fie

fie

    Newbie

  • Active Members
  • 5 posts

Posted 24 February 2010 - 05:09 PM

QUOTE (ZigZagJoe @ Wed, 24 Feb 2010 13:14:25 +0000) <{POST_SNAPBACK}>
It looks like it'd be overwriting existing files - in BarPlayerBufferFill.

FILE *fp = fopen(player->tmpname, "ab");
fwrite(data, dataSize, 1, fp);
fclose(fp);

Actually, that'd just be sticking more data on the end of the existing file...



Got ya! We're looking at different code again biggrin.gif.

If you re-download, it should be in there.

The volume controls on the version online are screwed up but I've fixed that. I also made it so that it doesn't call fopen for each write. Worked on that the first part of the day. I'm trying to see if I can get time shifting working before I upload all of the changes but that will be a few hours from now. I don't think I'm going to be able to get it going today though.

#9 ZigZagJoe

ZigZagJoe

    Hak5 Ninja

  • Active Members
  • PipPipPipPipPipPipPip
  • 896 posts

Posted 24 February 2010 - 05:18 PM

QUOTE (fie @ Wed, 24 Feb 2010 16:09:53 +0000) <{POST_SNAPBACK}>
Got ya! We're looking at different code again biggrin.gif.

If you re-download, it should be in there.

The volume controls on the version online are screwed up but I've fixed that. I also made it so that it doesn't call fopen for each write. Worked on that the first part of the day. I'm trying to see if I can get time shifting working before I upload all of the changes but that will be a few hours from now. I don't think I'm going to be able to get it going today though.


ah nice looks good - i was looking at the original source that you posted.
Saver2 Website - timeshift w/ pandora, grooveshark, and more!
Saver2 Installer - includes standalone pandora client, along with grooveshark, slacker, and pandora timeshifting plugins.
Standalone Pandora Client - Look ma, no flash!

Support thread Donation link

WEBIRC #saver2 @ irc.coldfront.net

#10 fie

fie

    Newbie

  • Active Members
  • 5 posts

Posted 25 February 2010 - 06:58 AM

QUOTE (ZigZagJoe @ Wed, 24 Feb 2010 17:18:04 +0000) <{POST_SNAPBACK}>
ah nice looks good - i was looking at the original source that you posted.



Ok, NEW VERSION!

Fixed the recalling fopen()
Fixed the volume controls (, down | . up)
Added track position skip ahead. (/)

Right now the skip ahead jumps 128 mp3 frames. I'll work on reversing the track position but that's going to be a lot of work/time.

#11 Pichet

Pichet

    Hak5 Zombie

  • Active Members
  • PipPipPipPipPip
  • 237 posts

Posted 26 March 2010 - 02:52 AM

QUOTE (fie @ Mon, 22 Feb 2010 13:23:48 +0000) <{POST_SNAPBACK}>
Pandora stream saver for linux based on Pianobar.



Install instructions in video info.


I don't get it. At 1st there was no plugins for Flash and/or Java,
then once i had managed to get the GrooveShark music page
loaded and playing, what? Is there not something lighter based
on StreamRipper combined to a Java front-end as StreamRipStar
or else?


#12 ZigZagJoe

ZigZagJoe

    Hak5 Ninja

  • Active Members
  • PipPipPipPipPipPipPip
  • 896 posts

Posted 26 March 2010 - 12:07 PM

QUOTE (Pichet @ Fri, 26 Mar 2010 02:52:49 +0000) <{POST_SNAPBACK}>
I don't get it. At 1st there was no plugins for Flash and/or Java,
then once i had managed to get the GrooveShark music page
loaded and playing, what? Is there not something lighter based
on StreamRipper combined to a Java front-end as StreamRipStar
or else?

Huh? This isn't for grooveshark, it is for pandora?
Saver2 Website - timeshift w/ pandora, grooveshark, and more!
Saver2 Installer - includes standalone pandora client, along with grooveshark, slacker, and pandora timeshifting plugins.
Standalone Pandora Client - Look ma, no flash!

Support thread Donation link

WEBIRC #saver2 @ irc.coldfront.net

#13 Pichet

Pichet

    Hak5 Zombie

  • Active Members
  • PipPipPipPipPip
  • 237 posts

Posted 26 March 2010 - 08:06 PM

QUOTE (ZigZagJoe @ Fri, 26 Mar 2010 18:07:35 +0000) <{POST_SNAPBACK}>
Huh? This isn't for grooveshark, it is for pandora?


Oh well, i thought i'd test this with GrooveShark 1st since it also requires the plugins to be installed.

I didn't get far with it anyway, i guess i didn't allow enough time to work for me since the last time!...

blink.gif

#14 ZigZagJoe

ZigZagJoe

    Hak5 Ninja

  • Active Members
  • PipPipPipPipPipPipPip
  • 896 posts

Posted 26 March 2010 - 09:34 PM

QUOTE (Pichet @ Fri, 26 Mar 2010 20:06:21 +0000) <{POST_SNAPBACK}>
Oh well, i thought i'd test this with GrooveShark 1st since it also requires the plugins to be installed.

I didn't get far with it anyway, i guess i didn't allow enough time to work for me since the last time!...

blink.gif

this is standalone, just compile and go no browser etc necessary.
Saver2 Website - timeshift w/ pandora, grooveshark, and more!
Saver2 Installer - includes standalone pandora client, along with grooveshark, slacker, and pandora timeshifting plugins.
Standalone Pandora Client - Look ma, no flash!

Support thread Donation link

WEBIRC #saver2 @ irc.coldfront.net

#15 Pichet

Pichet

    Hak5 Zombie

  • Active Members
  • PipPipPipPipPip
  • 237 posts

Posted 27 March 2010 - 02:33 AM

Oups! I was thinking about 'SongBird' all along!...

PianoBar didn't let me do anything with it, actually.

I've had too much of this stuff already i guess!

unsure.gif

Forget it!

#16 Thedamned

Thedamned

    Newbie

  • Active Members
  • 5 posts

Posted 24 April 2010 - 02:39 AM

Login... Error: Protocol incompatible. Please upgrade libpiano.



and I have no idea what to do to fix this.

please help.

#17 Pichet

Pichet

    Hak5 Zombie

  • Active Members
  • PipPipPipPipPip
  • 237 posts

Posted 24 April 2010 - 07:27 AM

I guess you're supposed to go there:

http://github.com/PromyLOPh/pianobar/archives/master

...but then i'm curious to see what happens next because
i've been lurking around patiently for years waiting for a
Linux solution to emerge and something tells me it's not
going to become a reality just yet...

unsure.gif

#18 ZigZagJoe

ZigZagJoe

    Hak5 Ninja

  • Active Members
  • PipPipPipPipPipPipPip
  • 896 posts

Posted 24 April 2010 - 03:44 PM

QUOTE (Thedamned @ Sat, 24 Apr 2010 02:39:56 +0000) <{POST_SNAPBACK}>
Login... Error: Protocol incompatible. Please upgrade libpiano.



and I have no idea what to do to fix this.

please help.


in libpiano/src/piano.c, change PIANO_PROTOCOL_VERSION "26" to PIANO_PROTOCOL_VERSION "27" and recompile.

and, lol pichet
Saver2 Website - timeshift w/ pandora, grooveshark, and more!
Saver2 Installer - includes standalone pandora client, along with grooveshark, slacker, and pandora timeshifting plugins.
Standalone Pandora Client - Look ma, no flash!

Support thread Donation link

WEBIRC #saver2 @ irc.coldfront.net

#19 Thedamned

Thedamned

    Newbie

  • Active Members
  • 5 posts

Posted 24 April 2010 - 03:57 PM

QUOTE (ZigZagJoe @ Sat, 24 Apr 2010 16:44:49 +0000) <{POST_SNAPBACK}>
in libpiano/src/piano.c, change PIANO_PROTOCOL_VERSION "26" to PIANO_PROTOCOL_VERSION "27" and recompile.

and, lol pichet


o and it works again.

woot.

Edited by Thedamned, 24 April 2010 - 04:09 PM.


#20 Thedamned

Thedamned

    Newbie

  • Active Members
  • 5 posts

Posted 26 May 2010 - 01:57 PM

hmmm i went to grab a copy for my friend and your site fie doesn't seem to be there anymore.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users