Jump to content

Pianobarfly


fie

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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? :P

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
Link to comment
Share on other sites

I added volume controls this morning.

, for volume down and . for volume up

I changed the buffer size on names/directories.

said stuff

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

--edit

Maybe the condition believes in existential nihilism?

Edited by fie
Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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 :D.

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.

Link to comment
Share on other sites

Got ya! We're looking at different code again :D.

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 1 month later...
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?

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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:

Link to comment
Share on other sites

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:

this is standalone, just compile and go no browser etc necessary.

Link to comment
Share on other sites

  • 4 weeks later...
  • 1 month later...
  • 3 months later...

okay great job! working like a beauty, with one problem. are the .mp3s being encoded in VBR or CBR? there is no possibility of getting these to play on an ipod. i've tried about 5 different softwares across windows and ubuntu to no avail. you know how i can get these files to play mobile? they work fine on the laptop but theres no way of getting them off. if you have a solution please let me know

Griffin

Link to comment
Share on other sites

okay great job! working like a beauty, with one problem. are the .mp3s being encoded in VBR or CBR? there is no possibility of getting these to play on an ipod. i've tried about 5 different softwares across windows and ubuntu to no avail. you know how i can get these files to play mobile? they work fine on the laptop but theres no way of getting them off. if you have a solution please let me know

Griffin

Pandora sends CBR files. Most likely the files are damaged (bad tags/tagging lib?) if they will not play on windows. Winamp and mplayer especially are very tolerant of damaged files.

Link to comment
Share on other sites

  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...