def __handle_incoming_uri(self, obj, uri): if not PROCESS_QL_URLS: print_w("Processing of quodlibet:// URLs is disabled. (%s)" % uri) return uri = urlparse(uri) if (uri.scheme == 'quodlibet' and uri.netloc == 'callbacks' and uri.path == '/soundcloud'): try: code = parse_qs(uri.query)["code"][0] except IndexError: print_w("Malformed response in callback URI: %s" % uri) return print_d("Processing Soundcloud callback (%s)" % (uri,)) self.api_client.get_token(code) else: print_w("Unknown URL format (%s)" % (uri,))
def __handle_incoming_uri(self, obj, uri): if not PROCESS_QL_URLS: print_w("Processing of quodlibet:// URLs is disabled. (%s)" % uri) return uri = urlparse(uri) if (uri.scheme == 'quodlibet' and uri.netloc == 'callbacks' and uri.path == '/soundcloud'): try: code = parse_qs(uri.query)["code"][0] except IndexError: print_w("Malformed response in callback URI: %s" % uri) return print_d("Processing Soundcloud callback (%s)" % (uri, )) self.api_client.get_token(code) else: print_w("Unknown URL format (%s)" % (uri, ))