Esempio n. 1
0
    def _get_spotify_config(self, config):
        ext = Extension()
        spotify_config = spotify.Config()

        spotify_config.load_application_key_file(
            os.path.join(os.path.dirname(__file__), 'spotify_appkey.key'))

        if config['spotify']['allow_cache']:
            spotify_config.cache_location = ext.get_cache_dir(config)
        else:
            spotify_config.cache_location = None

        spotify_config.settings_location = ext.get_data_dir(config)

        proxy_uri = httpclient.format_proxy(config['proxy'], auth=False)
        if proxy_uri is not None:
            logger.debug('Connecting to Spotify through proxy: %s', proxy_uri)

        spotify_config.proxy = proxy_uri
        spotify_config.proxy_username = config['proxy'].get('username')
        spotify_config.proxy_password = config['proxy'].get('password')

        return spotify_config
Esempio n. 2
0
    def _get_spotify_config(self, config):
        ext = Extension()
        spotify_config = spotify.Config()

        spotify_config.load_application_key_file(
            os.path.join(os.path.dirname(__file__), 'spotify_appkey.key'))

        if config['spotify']['allow_cache']:
            spotify_config.cache_location = ext.get_cache_dir(config)
        else:
            spotify_config.cache_location = None

        spotify_config.settings_location = ext.get_data_dir(config)

        proxy_uri = httpclient.format_proxy(config['proxy'], auth=False)
        if proxy_uri is not None:
            logger.debug('Connecting to Spotify through proxy: %s', proxy_uri)

        spotify_config.proxy = proxy_uri
        spotify_config.proxy_username = config['proxy'].get('username')
        spotify_config.proxy_password = config['proxy'].get('password')

        return spotify_config
Esempio n. 3
0
    def _get_spotify_config(self, config):
        ext = Extension()
        spotify_config = spotify.Config()

        spotify_config.load_application_key_file(
            pathlib.Path(__file__).parent / "spotify_appkey.key")

        if config["spotify"]["allow_cache"]:
            spotify_config.cache_location = bytes(ext.get_cache_dir(config))
        else:
            spotify_config.cache_location = None

        spotify_config.settings_location = bytes(ext.get_data_dir(config))

        proxy_uri = httpclient.format_proxy(config["proxy"], auth=False)
        if proxy_uri is not None:
            logger.debug(f"Connecting to Spotify through proxy: {proxy_uri}")

        spotify_config.proxy = proxy_uri
        spotify_config.proxy_username = config["proxy"].get("username")
        spotify_config.proxy_password = config["proxy"].get("password")

        return spotify_config