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

Spotify: doesn't seem to use proxy #626

Closed
danlii opened this issue Sep 19, 2019 · 5 comments
Closed

Spotify: doesn't seem to use proxy #626

danlii opened this issue Sep 19, 2019 · 5 comments

Comments

@danlii
Copy link

@danlii danlii commented Sep 19, 2019

Description

When using tizonia behind a proxy, it tries to make a direct connection to Spotify and fails.

Steps to Reproduce

  1. tizonia --spotify-tracks "metallica enter sandman"
  2. tizonia finds the track and queues it.
  3. tizonia tries to make a connection to 104.199.65.127:4070, which fails due to our corporate firewall.
  4. tizonia doesn't do anything, not even give an error

Expected behavior: Since I have the environment variable "http_proxy" set, I expected tizonia to honor that. That same proxy setting is what I use in the official Spotify client, and that works.

Actual behaviour: The song never starts.

Reproduces how often: 100%

Versions

%:~>tizonia --version
tizonia 0.18.0. Copyright (C) 2019 Juan A. Rubio
This software is part of the Tizonia project http://tizonia.org

%:~>tizonia --debug
tizonia 0.18.0. Copyright (C) 2019 Juan A. Rubio
This software is part of the Tizonia project http://tizonia.org

Debug Info:
* [Boost 1_67]
* [TagLib 1.11.1]
* [MediaInfoLib - v18.12]

%:~>cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

Installation Method Used

deb repo

@tizonia

This comment has been minimized.

Copy link
Owner

@tizonia tizonia commented Sep 24, 2019

Hi!, thanks for taking the time to raise an issue and apologies for the delayed reply!

Yes, Tizonia currently does not explicitly support configuration of an http proxy for Spotify or any of the other services. I'm not sure at this point if libspotify supports this somehow. If that was the case, then it would be relatively easy to add this configuration option into tizonia.conf.

I don't have a timeframe for when this could be done (or checked at least) so any help from the community on this would be greatly appreciated.

@danlii

This comment has been minimized.

Copy link
Author

@danlii danlii commented Oct 2, 2019

Well, I'm not a programmer, so I don't know if libspotify supports proxy or not. However, I found references to it here: https://pyspotify.mopidy.com/en/v2.0.5/api/config/ - although I must confess that I don't know if that page is relevant in this case or not.

@tizonia

This comment has been minimized.

Copy link
Owner

@tizonia tizonia commented Nov 14, 2019

@danlii

I've just checked this and I believe there is a possibility to pass the proxy configuration to libspotify (which is the underlying mechanism used by both mopidy, Tizonia and other open-source tools that currently stream from Spotify).

I'll look into that sometime, but this should not be too difficult to implement.

@tizonia tizonia added this to the v0.19.0 milestone Dec 10, 2019
@tizonia

This comment has been minimized.

Copy link
Owner

@tizonia tizonia commented Dec 10, 2019

This is now work-in-progress, in the 'develop' branch. Proxy settings can be provided (for use with Spotify only) via

  • Tizonia's command-line,
izonia --help proxy
tizonia 0.18.0. Copyright (C) 2019 Juan A. Rubio
This software is part of the Tizonia project <http://tizonia.org>

GNU Lesser GPL version 3 <http://gnu.org/licenses/lgpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Proxy server options:
  --proxy-server arg    Url to the proxy server that should be used (only works
                        with the Spotify service at the moment, not required if
                        provided via config file). The format is 
                        protocol://<host>:port (where protocol is 
                        http/https/socks4/socks5
  --proxy-user arg      User name to be used during proxy server authentication
                        (only works with the Spotify service at the moment, not
                        required if provided via config file).
  --proxy-password arg  Password to be used during proxy server authentication 
                        (only works with the Spotify service at the moment, not
                        required if provided via config file).
  • Tizonia's configuration file
# HTTP proxy server configuration
# -------------------------------------------------------------------------
# NOTE: Proxy configuration is currently only available with the Spotify
# service. It will be ignored with other music services.
#
# proxy.server = Url to the proxy server that should be used.
#                The format is protocol://<host>:port (where protocol
#                is http/https/socks4/socks5). E.g.: http:some.proxy.net:1234
# proxy.user_name = Username to authenticate with proxy server
# proxy.user_password = Password to authenticate with proxy server
  • currently NOT via an environment variable like http_proxy or https_proxy.

@danlii would you be able to test the proxy feature using a pre-release build that I would upload here?

juanrubio added a commit that referenced this issue Dec 10, 2019
OMX_TIZONIA_AUDIO_PARAM_SPOTIFYSESSIONTYPE (#626)
juanrubio added a commit that referenced this issue Dec 10, 2019
@tizonia tizonia changed the title Doesn't seem to use proxy Spotify: doesn't seem to use proxy Dec 13, 2019
@tizonia

This comment has been minimized.

Copy link
Owner

@tizonia tizonia commented Dec 13, 2019

The code has been merged to master. Closing this issue for now.

@tizonia tizonia closed this Dec 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.