christopher-dG / gpymusic

Google Py Music: A simple TUI client for Google Play Music
MIT License
200 stars 13 forks source link

search command blocking other commands, not returning #3

Closed jackkinsey closed 7 years ago

jackkinsey commented 7 years ago

It seems as though I've logged into pmcli correctly—it reports upon launch that it's logged in—and at first the help command is functional, but after I run a search command (which always fails to return anything, no matter what I search for—including things I've checked in Music proper to ensure exist) pmcli will display exclusively this:

Now playing: None
> 

...and subsequent executions of the help command return nothing, though quitting with CTRL-C will show the exit message, and trying to run expand and play commands will show the error

Error: Invalid number. Valid between 1-0 Enter 'h' or 'help' for help.

xterm, python 3.6.0.

christopher-dG commented 7 years ago

Does "Searching for $your_query_here..." ever appear above "Now playing"?

christopher-dG commented 7 years ago

Can you checkout the search-hanging branch, and then:

cd src
python pmcli.py
s Hello
# Wait ~10 seconds
Ctrl-C

And see what's in log.txt?

parkerlreed commented 7 years ago

Search works here but still blocks running help.

christopher-dG commented 7 years ago

Should be fixed in master now. Can you guys confirm?

rubik commented 7 years ago

I pulled f8dff2825f1901146e04c45b17e8cd5a954fa290 (current master), and search does not work because the API endpoint responds with 403 Forbidden:

gmusicapi.exceptions.CallFailure: Search: 403 Client Error: Forbidden for url: https://mclients.googleapis.com/sj/v2.5/query?ct=1%2C2%2C3%2C4%2C6%2C7%2C8%2C9&q=fibra&max-results=14&hl=en_US&dv=0&tier=fr
(requests kwargs: {'method': 'GET', 'url': 'https://mclients.googleapis.com/sj/v2.5/query', 'params': {'ct': '1,2,3,4,6,7,8,9', 'q': 'fibra', 'max-results': 14, 'hl': 'en_US', 'dv': 0, 'tier': 'fr'}, 'headers': {'Authorization': '<omitted>'}})
(response was: '{error:{errors:[{domain:global,reason:forbidden,message:Forbidden}],code:403,message:Forbidden}}')

I think it's the same issue described here: https://github.com/simon-weber/gmusicapi/issues/474

christopher-dG commented 7 years ago

@rubik The issue you mention is not related to the current issue, but it's definitely a problem. I'm testing out a free account and also having issues.

Also, can you still reproduce this? The issue in gmusicapi mentions that it's inconsistent.

jackkinsey commented 7 years ago

I tried checking out search-hanging like you suggested, but no log file was ever produced. Search is still hanging for me, help not displaying has been fixed. The Searching for $query... text does appear when I run a search command.

christopher-dG commented 7 years ago

Is your Google account free or paid?

I'm going to assume free, because that explains what's happening perfectly. See #5, it looks like free accounts will only be able to play radio stations once I implement that :disappointed:

christopher-dG commented 7 years ago

I've updated search-hanging again (it has config format changes so you'll have to install again per the readme), if you do the same as last time, log.txt will probably contain:

0 0 0

In which case #5 is definitely the problem.

jackkinsey commented 7 years ago

Yeah, I saw #5 and just responded. Free account is definitely the issue.