Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Continuous skipping of tracks #52

Closed
bikexcountry opened this issue May 7, 2017 · 10 comments
Closed

Continuous skipping of tracks #52

bikexcountry opened this issue May 7, 2017 · 10 comments

Comments

@bikexcountry
Copy link

bikexcountry commented May 7, 2017

Recently pydora stopped working, for some reason it keeps skipping tracks, I believe the tracks are not playable (python exception)j. Do you know why this might be happening? I have a premium account with pandora and all.

Here is my config:

[user]
username =
password =

[api]
username = android
api_host = tuner.pandora.com/services/json/
encryption_key = ...
decryption_key = ...
device = android-generic
password = ...
default_audio_quality = highQuality

Here is sample output

:
50: Mariah Carey (Holiday) Radio
51: Christmas Radio
52: Pink Radio
53: Pink Martini Radio
54: Alternative and Relaxation
55: Easy Listening Radio
56: Luis Fonsi Radio
57: Rainbows In The Dark Radio
58: Music For Brainwave Massage Radio
59: Krishna Radio
60: Carol Of The Bells (Instrumental) Radio
61: Lisa Shaw Radio
62: Nicki Minaj Radio
63: Yanni Radio
64: Trance
65: Deep Beat
66: Drum & Bass
67: Trip Hop
68: Liquid Drum & Bass
69: Deep House
70: Progressive/Electro House
71: Armin Van Buuren Radio
72: Milo Radio
73: Jungle Of Mirror (Scumfrog Remix) Radio
74: Silversun Pickups Radio
75: The Best Deceptions Radio
76: Thievery Corporation Radio
77: Alternative Pop/Rock
78: Alternative / Indie Rock
79: Drum'n'Bass
80: Dashboard Confessional Radio
Station: 1
The Prey by Ashes Divide
Find You There by We The Kings
Prescription Mixed Up by Snakes & Music
(This Is How I Look) When I Laugh At Death by Johnny Action Figure
Read My Mind by The Killers
Conservation Of Two by Sweet Trip
Damn Silence by Sunrise Avenue
Swinging Swords by Ben + Vesper
Radio Silence by Attention System
New Frontier by Counting Crows
Eighty-Eights by Farewell
Closer To The Edge (American Idol Performance) by James Durbin
(keeps skipping)

@mcrute
Copy link
Owner

mcrute commented May 26, 2017

Emailed with @bikexcountry and it looks like Pandora is not returning audio links for certain API keys anymore. I can repro this at least for the iphone API key. In the short term using the internal-tuner keys seems to work. There are a handful of fixes to be made here:

  • Detect the missing audio URLs and throw an error
  • Update the configuration program to use the internal-tuner keys
  • Update the pydora CLI to warn about this issue and tell the user to re-configure
  • Implement Pydora player issues cause playlist cycling #8 to avoid blowing past API limits

I'm working on these fixes but don't have an ETA right now.

@mcrute mcrute self-assigned this May 26, 2017
@mcrute mcrute added this to the Release 1.9.0 milestone May 26, 2017
@katlyn
Copy link

katlyn commented Jun 10, 2017

It seems as if the internal-tuner key no longer works as well.

@mcrute
Copy link
Owner

mcrute commented Jun 11, 2017

@izaclorimer can you provide some more reproduction steps? What is not working, are there exceptions or are you seeing song skips? Also can you post your config file without your username and password so I have a starting point for testing? As of right now I'm not seeing any issues with the internal tuner keys on my setup.

@katlyn
Copy link

katlyn commented Jun 11, 2017

Using the API for the Vista Widget on the internal-tuner also continuously skips tracks. Using a free Pandora account.
https://6xq.net/pandora-apidoc/json/partners/#vista-widget

Config:

username = 
password = 

[api]
device = WG01
username = windowsgadget
decryption_key = ...
password = ...
encryption_key = ...
api_host = internal-tuner.pandora.com/services/json/
default_audio_quality = highQuality

@mcrute
Copy link
Owner

mcrute commented Jun 11, 2017

I've done a bit more digging into what's going on here. There appear to be two different issues; one impacts pydora the player and the other pydora the API. Both seem to be the root cause of your problems. In all cases I think there are patches and then all the API keys will work again.

First, it looks like Pandora varies responses based on the API key that is used. In some cases it returns a audio quality map with URLs to the audio files and in others it just returns a single URL.

For example, using the internal tuner the response format for station.getPlaylist is this (elided heavily for clarity):

{
    "items": [
        {
            "audioUrlMap": {
                "highQuality": {
                    "bitrate": "192",
                    "encoding": "mp3",
                    "audioUrl": "...",
                    "protocol": "http"
                },
                "mediumQuality": {
                    "bitrate": "64",
                    "encoding": "aacplus",
                    "audioUrl": "...",
                    "protocol": "http"
                }
            }
        }
    ]
}

This is the format the pydora API expects to work with and this works fine. However, using the Android or Windows Vista Widget API key the response is similar to this:

{
    "items": [
        {
            "audioUrl": "http://t1-2.p-cdn.com/access/?version=5&lid=476835810&token=..."
        }
    ]
}

Solving that problem is easy, I've got a working patch for it. The next problem, which only affects pydora the player, is that for all other API keys that are not the Desktop AIR client Pandora is streaming AAC SBR files which are not supported by mpg123. The fix to this one is not nearly as simple.

I've had it on my backlog for a while to make the mpg123 strategy pluggable which would allow alternate strategies like headless VLC (using the rc plugin). This would give a lot more playback flexibility without compromising the interface. I plan to keep the mpg123 backend for now but also add VLC support, which will be the default if VLC is installed.

I'll ship the first patch today but I expect the second one to take a little bit longer. Hopefully I will be able to land it this week and will keep this issue open to track that status. In the meantime using a Pandora One account with the Desktop AIR application credentials should work.

mcrute pushed a commit that referenced this issue Jun 13, 2017
Previously Pandora only surfaced mp3 files in their responses which
worked fairly universally. Recently they started surfacing AAC files
which don't work in the pydora player as-is. Add the encoding to the
sock model so that players can make a decision based on it.

see: #52
mcrute pushed a commit that referenced this issue Jun 13, 2017
Pandora now returns two different responses to the API depending on
which API key the client is using and the tuner endpoint. Instead of a
quality map only a single audio URL is returned which is of AAC SBR
format. This change accommodates that and returns the proper bitrate and
format based on empirical testing.

see: #52
@mcrute
Copy link
Owner

mcrute commented Jun 13, 2017

I've got a working version that uses either VLC or mpg123 as an output backend. It prefers VLC if it's installed on the system. The search backend uses your $PATH (it also supports VLC.app for Mac OS) so if you've got VLC or mpg123 on your path you should be good to go. This should support at least Linux and Mac OS X. I don't have any way to test Windows.

Player backends will now also attempt to reject any incompatible audio formats. This isn't a foolproof check but it should at least help in the common case to prevent playlist cycling.

The changes also support the modified response formats for some API keys which allows all existing API keys to work again. I believe all changes to be backwards compatible with current behavior.

Check out the vlc-backend branch and test. It seems stable but I'd like to do some more testing myself before merging it to master and pushing a new release. Please leave feedback here if you find any issues.

@mcrute
Copy link
Owner

mcrute commented Jun 13, 2017

The other thing the patch adds is volume control within pydora with a VLC backend using vu and vd.

@mcrute
Copy link
Owner

mcrute commented Jun 15, 2017

This works great on my Mac laptop but doesn't work with VLC on Ubuntu. I'm not certain if it's a VLC codec issue or an external issue but I'll do some more research. I'm not ready to release this till I have at least Linux and Mac OS working.

@mcrute
Copy link
Owner

mcrute commented Jun 15, 2017

I've done some more testing and it seems that the issue is actually that the ios API key no longer works without a very specific user-agent string (which I have not bothered to find). I'll make an update to the configuration script to prefer android instead of ios and will add a warning to the command line player. Then I think this will be ready for release.

@mcrute
Copy link
Owner

mcrute commented Jun 19, 2017

Final changes have been made. The command line client now also blacklists the non-working ios key. Updated pydora-configure to allow it to freshen keys if a config file exists. You will have to do this at least once if you're using the default config which previously preferred the ios key.

I'm going to close this ticket and merge the changes this will be in the 1.9 release later tonight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants