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

"403 Forbidden" response crashes orochi #76

Open
t4k1t opened this issue Jan 2, 2017 · 2 comments
Open

"403 Forbidden" response crashes orochi #76

t4k1t opened this issue Jan 2, 2017 · 2 comments
Labels

Comments

@t4k1t
Copy link

t4k1t commented Jan 2, 2017

E.g. I tried to play the "Fields of Heather" mix from Austria and got the following response:

*** HTTP Error: (u'403 Client Error: Forbidden for url: https://8tracks.com/sets/536722025/play.json?mix_id=8345975', {u'status': u'403 Forbidden', u'notices': u'Due to international streaming restrictions, this playlist may have limited playback in your region.', u'errors': [u'Due to international streaming restrictions, this playlist may have limited playback in your region.'], u'api_version': 2, u'logged_in': False})

Which sucks but is to be expected. However orochi crashes on this, I think it should handle this response gracefully instead. I guess it should just print an error message (possibly just pass through the one from 8tracks) and not play the offending playlist.

Have a traceback for completeness' sake:

Traceback (most recent call last):
  File "/usr/lib64/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/thomas/repos/external/orochi/orochi/client.py", line 872, in <module>
    main()
  File "/home/thomas/repos/external/orochi/orochi/client.py", line 862, in main
    client.cmdloop()
  File "/home/thomas/repos/external/orochi/orochi/client.py", line 216, in cmdloop
    super(Client, self).cmdloop()
  File "/usr/lib64/python2.7/cmd.py", line 142, in cmdloop
    stop = self.onecmd(line)
  File "/usr/lib64/python2.7/cmd.py", line 221, in onecmd
    return func(arg)
  File "/home/thomas/repos/external/orochi/orochi/client.py", line 434, in do_play
    i.prompt = get_prompt(mix)
UnboundLocalError: local variable 'i' referenced before assignment
@dbrgn
Copy link
Owner

dbrgn commented Jan 2, 2017

Ok, so the geoblocking is in place now.

See #73 for more information.

@dbrgn dbrgn added the bug label Jan 2, 2017
@tgr
Copy link

tgr commented Feb 23, 2017

Same issue with quotas, if you are in USA:

Traceback (most recent call last):
  File "/usr/local/bin/orochi", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/orochi/client.py", line 862, in main
    client.cmdloop()
  File "/usr/local/lib/python2.7/dist-packages/orochi/client.py", line 216, in cmdloop
    super(Client, self).cmdloop()
  File "/usr/lib/python2.7/cmd.py", line 142, in cmdloop
    stop = self.onecmd(line)
  File "/usr/lib/python2.7/cmd.py", line 221, in onecmd
    return func(arg)
  File "/usr/local/lib/python2.7/dist-packages/orochi/client.py", line 438, in do_play
    i.cmdloop()
  File "/usr/local/lib/python2.7/dist-packages/orochi/client.py", line 584, in cmdloop
    super(PlayCommand, self).cmdloop()
  File "/usr/lib/python2.7/cmd.py", line 142, in cmdloop
    stop = self.onecmd(line)
  File "/usr/lib/python2.7/cmd.py", line 221, in onecmd
    return func(arg)
  File "/usr/local/lib/python2.7/dist-packages/orochi/client.py", line 671, in do_next_song
    self.status = self.api.skip_track(self.mix_id)
  File "/usr/local/lib/python2.7/dist-packages/orochi/api.py", line 285, in skip_track
    return self._playback_control(mix_id, 'skip')
  File "/usr/local/lib/python2.7/dist-packages/orochi/api.py", line 233, in _playback_control
    'mix_id': mix_id,
  File "/usr/local/lib/python2.7/dist-packages/orochi/api.py", line 65, in _get
    raise e
requests.exceptions.HTTPError: ('403 Client Error: Forbidden', {u'status': u'403 Forbidden', u'errors': None, u'listening_quota': {u'weekly_hours_quota_used': 1.0, u'weekly_quota_reached': True, u'weekly_hours_quota': 1.0}, u'notices': u'You have reached your weekly quota. Subscribe for unlimited listening', u'logged_in': False, u'api_version': 2, u'skip_allowed_in_seconds': 0})

Yup, that's a 1 hour per week quota. It doesn't seem to be enforced too heavily though, just reconnecting does the trick.
(See also blog post announcing this. Apparently CA is still unlimited.)

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

No branches or pull requests

3 participants