text:
BadCredentials

Tried logging in with username, email and changing my password. Even deleting the credentials file didn’t help.
zotify --username * --password *

Traceback (most recent call last):
  File "/home/*/.local/bin/zotify", line 8, in <module>
    sys.exit(main())
  File "/home/*/.local/lib/python3.10/site-packages/zotify/__main__.py", line 64, in main
    args.func(args)
  File "/home/*/.local/lib/python3.10/site-packages/zotify/app.py", line 21, in client
    Zotify(args)
  File "/home/*/.local/lib/python3.10/site-packages/zotify/zotify.py", line 21, in __init__
    Zotify.login(args)
  File "/home/*/.local/lib/python3.10/site-packages/zotify/zotify.py", line 46, in login
    cls.SESSION = Session.Builder(conf).user_pass(user_name, password).create()
  File "/home/*/.local/lib/python3.10/site-packages/librespot/core.py", line 1634, in create
    session.authenticate(self.login_credentials)
  File "/home/*/.local/lib/python3.10/site-packages/librespot/core.py", line 939, in authenticate
    self.__authenticate_partial(credential, False)
  File "/home/*/.local/lib/python3.10/site-packages/librespot/core.py", line 1350, in __authenticate_partial
    raise Session.SpotifyAuthenticationException(ap_login_failed)
librespot.core.Session.SpotifyAuthenticationException: BadCredentials

Same problem. Funny thing is that I can login to my main account with username or password without issue, but my burner account (premium) is a non-starter.
 23:57:32> zotify -f Username: **************** Password: **************** Traceback (most recent call last):   File "<frozen runpy>", line 198, in _run_module_as_main   File "<frozen runpy>", line 88, in _run_code   File "c:\users\admin\.local\bin\zotify.exe\__main__.py", line 7, in <module>   File "C:\Users\admin\pipx\venvs\zotify\Lib\site-packages\zotify\__main__.py", line 64, in main     args.func(args)   File "C:\Users\admin\pipx\venvs\zotify\Lib\site-packages\zotify\app.py", line 21, in client     Zotify(args)   File "C:\Users\admin\pipx\venvs\zotify\Lib\site-packages\zotify\zotify.py", line 21, in __init__     Zotify.login(args)   File "C:\Users\admin\pipx\venvs\zotify\Lib\site-packages\zotify\zotify.py", line 46, in login     cls.SESSION = Session.Builder(conf).user_pass(user_name, password).create()                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^   File "C:\Users\admin\pipx\venvs\zotify\Lib\site-packages\librespot\core.py", line 1634, in create     session.authenticate(self.login_credentials)   File "C:\Users\admin\pipx\venvs\zotify\Lib\site-packages\librespot\core.py", line 939, in authenticate     self.__authenticate_partial(credential, False)   File "C:\Users\admin\pipx\venvs\zotify\Lib\site-packages\librespot\core.py", line 1350, in __authenticate_partial     raise Session.SpotifyAuthenticationException(ap_login_failed) librespot.core.Session.SpotifyAuthenticationException: BadCredentials

Me too

Hey @daydaya hope you are doing well!
Can I ask how you changed IP regions to force login elsewhere?

The software I used is Clash , but basically, you can use any VPN for this purpose

same issue here but my account is based in Germany and I am accessing also with a German IP address. I assume spotify change something

same issue here but my account is based in Germany and I am accessing also with a German IP address. I assume spotify change something

same here my acc is in Greece and i am in greece with a greek ip and everithing but still dosent work i conected with a vpn that i have here in greece but still nothing

I was forced to reset my spotify account password. Somehow this behaviour is in general weird ...

I was able to get Zotify working again by:

Use this script to generate a credentials.json: https://github.com/librespot-org/librespot/issues/1308#issuecomment-2294947853
Modify the credentials.json as follows before placing it where Zotify looks for it:

Replace "auth_type": 1 with "type":"AUTHENTICATION_STORED_SPOTIFY_CREDENTIALS"
Rename "auth_data" to "credentials"

Unfortunately you need a premium account for step 1 (not sure if this can be worked around).

I was able to get Zotify working again by:

Use this script to generate a credentials.json: Authentication failures librespot-org/librespot#1308 (comment)

Modify the credentials.json as follows before placing it where Zotify looks for it:

Replace "auth_type": 1 with "type":"AUTHENTICATION_STORED_SPOTIFY_CREDENTIALS"
Rename "auth_data" to "credentials"

Unfortunately you need a premium account for step 1 (not sure if this can be worked around).

I was just fiddling around with that same script - this worked like a charm! Thanks @ImranR98

I was able to get Zotify working again by:

Use this script to generate a credentials.json: Authentication failures librespot-org/librespot#1308 (comment)

Modify the credentials.json as follows before placing it where Zotify looks for it:

Replace "auth_type": 1 with "type":"AUTHENTICATION_STORED_SPOTIFY_CREDENTIALS"
Rename "auth_data" to "credentials"

Unfortunately you need a premium account for step 1 (not sure if this can be worked around).

Sorry for asking, but how can i use the first script? I am a nooby, but i get the installation of zotify. But is the first script just possible without linux? Don't find a way how to do it. Thank you! :)

Sorry for asking, but how can i use the first script? I am a nooby, but i get the installation of zotify. But is the first script just possible without linux? Don't find a way how to do it. Thank you! :)

Assuming you're on Windows:
Install Rust from https://www.rust-lang.org/tools/install
Open Windows Powershell and type:
git clone https://github.com/librespot-org/librespot.git
cd librespot-auth
cargo build
You should now have a librespot-auth.exe file in the librespot-auth/target/debug/ folder. Run it inside the powershell.
It'll prompt you to "Open Spotify and select output device: Speaker", meaning click on the speaker icon next to the volume slider and connect to the "Speaker" device. It won't work without Spotify Premium.

Sorry for asking, but how can i use the first script? I am a nooby, but i get the installation of zotify. But is the first script just possible without linux? Don't find a way how to do it. Thank you! :)

Assuming you're on Windows: Install Rust from https://www.rust-lang.org/tools/install
Open Windows Powershell and type: git clone https://github.com/librespot-org/librespot.git cd librespot-auth cargo build
You should now have a librespot-auth.exe file in the librespot-auth/target/debug/ folder. Run it inside the powershell.
It'll prompt you to "Open Spotify and select output device: Speaker", meaning click on the speaker icon next to the volume slider and connect to the "Speaker" device. It won't work without Spotify Premium.

Could you help me with the same for Mac? I used brew install librespot and not sure what the next steps are...

I was able to get Zotify working again by:

Use this script to generate a credentials.json: Authentication failures librespot-org/librespot#1308 (comment)

Modify the credentials.json as follows before placing it where Zotify looks for it:

Replace "auth_type": 1 with "type":"AUTHENTICATION_STORED_SPOTIFY_CREDENTIALS"
Rename "auth_data" to "credentials"

Unfortunately you need a premium account for step 1 (not sure if this can be worked around).

I tried this method and ran into the issue of it requiring Premium. However, not sure if it was a fluke, but I just replaced the DeviceType::SPEAKER in the script (src/main.rs: line 46) with DeviceType::COMPUTER and it worked. Maybe this will also work for other non-premium users.

Hopefully this can be worked on so we can login w/o having to install 6GB worth of dependencies (required for Rust)

Hopefully this can be worked on so we can login w/o having to install 6GB worth of dependencies (required for Rust)

1.72GB is not that bad
FROM rust:1.80-slim-bullseye

WORKDIR /app
COPY . .
RUN cargo build --release
EXPOSE 40801/tcp
EXPOSE 5353/udp
ENTRYPOINT ["/app/target/release/librespot-auth"]

I was able to get Zotify working again by:

Use this script to generate a credentials.json: Authentication failures librespot-org/librespot#1308 (comment)

Modify the credentials.json as follows before placing it where Zotify looks for it:

Replace "auth_type": 1 with "type":"AUTHENTICATION_STORED_SPOTIFY_CREDENTIALS"
Rename "auth_data" to "credentials"

Unfortunately you need a premium account for step 1 (not sure if this can be worked around).

I tried this method and ran into the issue of it requiring Premium. However, not sure if it was a fluke, but I just replaced the DeviceType::SPEAKER in the script (src/main.rs: line 46) with DeviceType::COMPUTER and it worked. Maybe this will also work for other non-premium users.

When setting the value to .device_type(DeviceType::Computer), it didn’t work for non-premium users. I don’t have much experience with Rust or Spotify, but I was able to find a workaround with the help of ChatGPT.
Here is my modified script:
use clap::Parser;
use futures::StreamExt;
use librespot_core::authentication::Credentials;
use librespot_core::SessionConfig;
use librespot_discovery::{DeviceType, Discovery};
use sha1::{Digest, Sha1};
use serde_json;
use std::fs::File;
use std::io::Write;
use std::process::exit;
use log::warn;

#[derive(Parser, Debug)]
#[command(author, version, about, long_about = None)]
struct Args {
    #[arg(short, long, default_value = "Generate Credentials")]
    name: String,
    #[arg(short, long, default_value = "credentials.json")]
    path: String,
}

pub fn save_credentials_and_exit(location: &str, cred: &Credentials) {
    let result = File::create(location).and_then(|mut file| {
        let data = serde_json::to_string(cred)?;
        write!(file, "{data}")
    });

    if let Err(e) = result {
        warn!("Cannot save credentials to cache: {}", e);
        exit(1);
    } else {
        println!("Credentials saved: {}", location);
        exit(0);
    }
}

#[tokio::main(flavor = "current_thread")]
async fn main() {
    let args = Args::parse();
    let name = args.name;
    let credentials_location = args.path;
    let device_id = hex::encode(Sha1::digest(name.clone().as_bytes()));

    let mut server = Discovery::builder(device_id.clone(), SessionConfig::default().client_id)
        .name(name.clone())  // Custom device name from args
        .device_type(DeviceType::Computer)  // Closest to a web player
        .launch()
        .unwrap();

    println!("Open Spotify and select the output device: Generate Credentials");

    while let Some(credentials) = server.next().await {
        save_credentials_and_exit(&credentials_location, &credentials);
    }
}

To use this:
Compile the script.
Run it.
Note: Don’t use a VPN while trying this. Open both the web player and the Spotify application. In the Spotify application, choose the device labeled "Generate Credentials." This will generate a credentials.json file.
Before using the generated credentials.json with Zotify, modify it as follows:
Replace "auth_type": 1 with "type": "AUTHENTICATION_STORED_SPOTIFY_CREDENTIALS".
Rename "auth_data" to "credentials".
After making these changes, you should be good to go.
#crd ImranR98

is anyone using this workaround with docker?
seems like prior I have to set up spotifyd.

Sorry for asking, but how can i use the first script? I am a nooby, but i get the installation of zotify. But is the first script just possible without linux? Don't find a way how to do it. Thank you! :)

Assuming you're on Windows:
Install Rust from https://www.rust-lang.org/tools/install
Open Windows Powershell and type:
git clone https://github.com/librespot-org/librespot.git
cd librespot-auth
cargo build
You should now have a librespot-auth.exe file in the librespot-auth/target/debug/ folder. Run it inside the powershell.
It'll prompt you to "Open Spotify and select output device: Speaker", meaning click on the speaker icon next to the volume slider and connect to the "Speaker" device. It won't work without Spotify Premium.

If you don't mind me asking, is the credentials.json the same across devices? So if I follow this guide on my pc can I use the file on my mac?

I need help as I am not able to proceed further. How to link now that credentials file with zotify? I valided the json file an formatting is also ok, tried later on with a fresh file by just replacing auth type etc. as suggested.

I need help as I am not able to proceed further. How to link now that credentials file with zotify? I valided the json file an formatting is also ok, tried later on with a fresh file by just replacing auth type etc. as suggested.

I am having this issue as well, using windows 10

I need help as I am not able to proceed further. How to link now that credentials file with zotify? I valided the json file an formatting is also ok, tried later on with a fresh file by just replacing auth type etc. as suggested.

I am having this issue as well, using windows 10

I managed to solve this.
"CREDENTIALS_LOCATION": "C:\Users\user\AppData\Roaming\Zotify\credentials.json",
thats how you need to set the path to your file.
unfortunately I am not a windows user and this is just a workaround. Still struggling to set this up under my docker environment.

I need help as I am not able to proceed further. How to link now that credentials file with zotify? I valided the json file an formatting is also ok, tried later on with a fresh file by just replacing auth type etc. as suggested.

Make sure to use \ instead of \ for the location. Took me almost two hours to realise that.
P.S. Visual Studio code automatically does that if you just copy and paste. And I kept typing the directory manually only to keep making that silly mistake.

Sorry for asking, but how can i use the first script? I am a nooby, but i get the installation of zotify. But is the first script just possible without linux? Don't find a way how to do it. Thank you! :)

Assuming you're on Windows: Install Rust from https://www.rust-lang.org/tools/install
Open Windows Powershell and type: git clone https://github.com/librespot-org/librespot.git cd librespot-auth cargo build
You should now have a librespot-auth.exe file in the librespot-auth/target/debug/ folder. Run it inside the powershell.
It'll prompt you to "Open Spotify and select output device: Speaker", meaning click on the speaker icon next to the volume slider and connect to the "Speaker" device. It won't work without Spotify Premium.

I followed your instructions but after pasting "cd librespot-auth" it says it cannot find it:
cd : Cannot find path 'C:\Users\xxxx\librespot-auth' because
it does not exist.
At line:1 char:1

cd librespot-auth

  + CategoryInfo          : ObjectNotFound: (C:\Users\xxxx\
 librespot-auth:String) [Set-Location], ItemNotFoundExcepti
on
  + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShel
 l.Commands.SetLocationCommand

Sorry for asking, but how can i use the first script? I am a nooby, but i get the installation of zotify. But is the first script just possible without linux? Don't find a way how to do it. Thank you! :)

Assuming you're on Windows: Install Rust from https://www.rust-lang.org/tools/install
Open Windows Powershell and type: git clone https://github.com/librespot-org/librespot.git cd librespot-auth cargo build
You should now have a librespot-auth.exe file in the librespot-auth/target/debug/ folder. Run it inside the powershell.
It'll prompt you to "Open Spotify and select output device: Speaker", meaning click on the speaker icon next to the volume slider and connect to the "Speaker" device. It won't work without Spotify Premium.

Also a nooby here, I followed your instructions but after pasting "cd librespot-auth" it says it cannot find it:
cd : Cannot find path 'C:\Users\xxxx\librespot-auth' because it does not exist. At line:1 char:1

cd librespot-auth

  + CategoryInfo          : ObjectNotFound: (C:\Users\xxxx\
 librespot-auth:String) [Set-Location], ItemNotFoundExcepti
on
  + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShel
 l.Commands.SetLocationCommand

Their steps skipped downloading librespot-auth. I used this command: git clone https://github.com/dspearson/librespot-auth.git

Do we have a fix for this issue, or are we stuck on the workaround. My premium is expiring soon, this info will help me decide how long to wait.

Sorry for asking, but how can i use the first script? I am a nooby, but i get the installation of zotify. But is the first script just possible without linux? Don't find a way how to do it. Thank you! :)

Assuming you're on Windows: Install Rust from https://www.rust-lang.org/tools/install
Open Windows Powershell and type: git clone https://github.com/librespot-org/librespot.git cd librespot-auth cargo build
You should now have a librespot-auth.exe file in the librespot-auth/target/debug/ folder. Run it inside the powershell.
It'll prompt you to "Open Spotify and select output device: Speaker", meaning click on the speaker icon next to the volume slider and connect to the "Speaker" device. It won't work without Spotify Premium.

Also a nooby here, I followed your instructions but after pasting "cd librespot-auth" it says it cannot find it:
cd : Cannot find path 'C:\Users\xxxx\librespot-auth' because it does not exist. At line:1 char:1

cd librespot-auth

  + CategoryInfo          : ObjectNotFound: (C:\Users\xxxx\
 librespot-auth:String) [Set-Location], ItemNotFoundExcepti
on
  + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShel
 l.Commands.SetLocationCommand

Their steps skipped downloading librespot-auth. I used this command: git clone https://github.com/dspearson/librespot-auth.git
To all, I wasn't able to generate credentials until I actually played something in Spotify. Seems obvious in retrospect, but I hadn't thought to simply press play.

It worked! Thanks for explaining!

I wish, anyone could share the setup for Linux. I can’t find the config.json to point to my generated credentials.json.

I wish, anyone could share the setup for Linux. I can’t find the config.json to point to my generated credentials.json.

config.json is in /home/YOUR_USER/.config/zotify/config.json
anyway, I have generated the credentials.json and modified it as indicated in the comment above and zotify keeps asking for credentials...

Okay I think i tried everything properly but still getting this error
.
Traceback (most recent call last):
  File "[Python path]\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "[Python path]\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "[Python path]\Scripts\zotify.exe\__main__.py", line 7, in <module>
  File "[Python path]\site-packages\zotify\__main__.py", line 64, in main
    args.func(args)
  File "[Python path]\site-packages\zotify\app.py", line 21, in client
    Zotify(args)
  File "[Python path]\site-packages\zotify\zotify.py", line 21, in __init__
    Zotify.login(args)
  File "[Python path]\site-packages\zotify\zotify.py", line 32, in login
    cls.SESSION = Session.Builder(conf).stored_file(cred_location).create()
  File "[Python path]\site-packages\librespot\core.py", line 1589, in stored_file
    typ=Authentication.AuthenticationType.Value(
  File "[Python path]\site-packages\google\protobuf\internal\enum_type_wrapper.py", line 82, in Value
    raise ValueError('Enum {} has no value defined for name {!r}'.format(
ValueError: Enum AuthenticationType has no value defined for name 1

{"username": "ENTERUSERNAMEOBTAINEDFROM LIBRESPOTAUTH HERE", "credentials": "INSERTCREDENTIALSSTRINGOBTAINEDFROM LIBRESPOTAUTH HERE", "type": "AUTHENTICATION_STORED_SPOTIFY_CREDENTIALS"}
This is how i formatted my credentials.json to get it working. If anyone else is willing to give it a try and see if it works, that would be awesome.

{"username": "ENTERUSERNAMEOBTAINEDFROM LIBRESPOTAUTH HERE", "credentials": "INSERTCREDENTIALSSTRINGOBTAINEDFROM LIBRESPOTAUTH HERE", "type": "AUTHENTICATION_STORED_SPOTIFY_CREDENTIALS"}
This is how i formatted my credentials.json to get it working. If anyone else is willing to give it a try and see if it works, that would be awesome.

Yep that's what I did below is mine with info removed
{
  "username": "82teogm",
  "credentials": "QVJubWxFMmhwbWRfNmVGNTZLN1lUZHdzZFI3eVVOQ1I0Tm11V18yM3VNaENmREFHOVpCeXFTX1ZsLXM4azZNTXdVS2VxYkg4a1EzLTNvV0F3U3h3U19qVTVrUEYyQTk5UjQxX00ydmlFYkNmWXBQWkljVUN6QkdwRlJBRk42S0UyZHNKRnh1WHQxWUtwdEVqeGpfUWlFZEpaLTFkb0E4YnRJSlp4WnJsRg==",
  "type": "AUTHENTICATION_STORED_SPOTIFY_CREDENTIALS"
}

I need help as I am not able to proceed further. How to link now that credentials file with zotify? I valided the json file an formatting is also ok, tried later on with a fresh file by just replacing auth type etc. as suggested.

I am having this issue as well, using windows 10

I managed to solve this.
"CREDENTIALS_LOCATION": "C:\Users\user\AppData\Roaming\Zotify\credentials.json",
thats how you need to set the path to your file.
unfortunately I am not a windows user and this is just a workaround. Still struggling to set this up under my docker environment.

what is the format of your cred file?

How can I set the path to credentials.json if I am running Zotify inside Docker?

this works also in docker
how to authenticate using the new oauth way:
install git, rust and cargo, download the following branch of librespot https://github.com/kingosticks/librespot/tree/credentials_with_access_token
run branch using:
cargo run --no-default-features -- --cache . --token ""
you'll need to open a link and let it redirect to the local librespot webservice.
if everything went well you end up with a credentials.json in the directory, which looks like this:
{
"username": "QWERQWERQWERQWER",
"auth_type": 1,
"auth_data": "ASDFASDFASDF"
}
change it to look like the follwing:
{
"username": "QWERQWERQWERQWER",
"type": "AUTHENTICATION_STORED_SPOTIFY_CREDENTIALS",
"credentials": "ASDFASDFASDF"
}
and you're done - don't forget to refrence the credentials.json in you zotify/config.json

did all this and is still asking for credentials,

use --credentials-location when you have your new credentials.json  works like a charm. Thank you for the script and the manual
command =f"zotify --username "{username_spotify}" --password "{pwd_spotify}"

--credentials-location  "{credentials_path}"

--download-format "mp3" --root-path "{root_path_music}" --download-quality "very_high" --song-archive "archive" --download-lyrics "false" "{playlist_uri}""

If you use docker, definitely try --credentials-location. I was just setting -e CREDENTIALS_LOCATION in the docker run invocation, but that didn't seem to have an effect.

im having a very hard time following any of this the comments are kind of a mess

I was able to get Zotify working again by:

Use this script to generate a credentials.json: https://github.com/librespot-org/librespot/issues/1308#issuecomment-2294947853

Modify the credentials.json as follows before placing it where Zotify looks for it:

Replace "auth_type": 1 with "type":"AUTHENTICATION_STORED_SPOTIFY_CREDENTIALS"

Rename "auth_data" to "credentials"

Unfortunately you need a premium account for step 1 (not sure if this can be worked around).

This worked for me. Ran the auth thing directly with cargo, running Zotify in docker.

can somebody please go into more detail on how to get the librespot-auth script to be seen by spotify?
I've restarted my pc, reinstalled spotify, played with the options and cycled thorugh restarting it and spotify.
yet nothing happened

I managed to get it working on windows by installing the rust prerequisites and using https://github.com/ManiArasteh/librespot-auth/tree/master which covers windows too.
before building I changed line 46 of \src\main.rs by replacing ::Speaker with ::Computer
I also used https://github.com/SpotX-Official/SpotX on my spotify client but this might have been unnecessary.
The virtual device was found immediately and I could connect with no issue.
then the credentials.json appeared at \target\release and by editing it as mentioned here zotify worked again: https://github.com/zotify-dev/zotify/issues/174#issuecomment-2326169040

I was able to get Zotify working again by:

Use this script to generate a credentials.json: Authentication failures librespot-org/librespot#1308 (comment)

Modify the credentials.json as follows before placing it where Zotify looks for it:

Replace "auth_type": 1 with "type":"AUTHENTICATION_STORED_SPOTIFY_CREDENTIALS"
Rename "auth_data" to "credentials"

Unfortunately you need a premium account for step 1 (not sure if this can be worked around).

I tried this method and ran into the issue of it requiring Premium. However, not sure if it was a fluke, but I just replaced the DeviceType::SPEAKER in the script (src/main.rs: line 46) with DeviceType::COMPUTER and it worked. Maybe this will also work for other non-premium users.

All the above works, also for non-premium users as well !!
I struggled several days scavenging the source codes, not understanding why I did not see the darn "computer" I had to select in Spotify player to trigger librespot-auth to spit out the credentials.json files...
... and I finally found the reason : I use  SphinxSoftware's Windows10 firewall ... I know it sometimes blocks stuff in the backgound w/o necessarily warning you ... I had the idea to turn it off just to see
==> setting firewall mode to "enable all" and bingo ! it worked !!!

I was able to get Zotify working again by:

Use this script to generate a credentials.json: Authentication failures librespot-org/librespot#1308 (comment)

Modify the credentials.json as follows before placing it where Zotify looks for it:

Replace "auth_type": 1 with "type":"AUTHENTICATION_STORED_SPOTIFY_CREDENTIALS"
Rename "auth_data" to "credentials"

Unfortunately you need a premium account for step 1 (not sure if this can be worked around).

I tried this method and ran into the issue of it requiring Premium. However, not sure if it was a fluke, but I just replaced the DeviceType::SPEAKER in the script (src/main.rs: line 46) with DeviceType::COMPUTER and it worked. Maybe this will also work for other non-premium users.

When setting the value to .device_type(DeviceType::Computer), it didn’t work for non-premium users. I don’t have much experience with Rust or Spotify, but I was able to find a workaround with the help of ChatGPT.
Here is my modified script:
use clap::Parser;
use futures::StreamExt;
use librespot_core::authentication::Credentials;
use librespot_core::SessionConfig;
use librespot_discovery::{DeviceType, Discovery};
use sha1::{Digest, Sha1};
use serde_json;
use std::fs::File;
use std::io::Write;
use std::process::exit;
use log::warn;

#[derive(Parser, Debug)]
#[command(author, version, about, long_about = None)]
struct Args {
    #[arg(short, long, default_value = "Generate Credentials")]
    name: String,
    #[arg(short, long, default_value = "credentials.json")]
    path: String,
}

pub fn save_credentials_and_exit(location: &str, cred: &Credentials) {
    let result = File::create(location).and_then(|mut file| {
        let data = serde_json::to_string(cred)?;
        write!(file, "{data}")
    });

    if let Err(e) = result {
        warn!("Cannot save credentials to cache: {}", e);
        exit(1);
    } else {
        println!("Credentials saved: {}", location);
        exit(0);
    }
}

#[tokio::main(flavor = "current_thread")]
async fn main() {
    let args = Args::parse();
    let name = args.name;
    let credentials_location = args.path;
    let device_id = hex::encode(Sha1::digest(name.clone().as_bytes()));

    let mut server = Discovery::builder(device_id.clone(), SessionConfig::default().client_id)
        .name(name.clone())  // Custom device name from args
        .device_type(DeviceType::Computer)  // Closest to a web player
        .launch()
        .unwrap();

    println!("Open Spotify and select the output device: Generate Credentials");

    while let Some(credentials) = server.next().await {
        save_credentials_and_exit(&credentials_location, &credentials);
    }
}

To use this:
Compile the script. Run it. Note: Don’t use a VPN while trying this. Open both the web player and the Spotify application. In the Spotify application, choose the device labeled "Generate Credentials." This will generate a credentials.json file.
Before using the generated credentials.json with Zotify, modify it as follows:
Replace "auth_type": 1 with "type": "AUTHENTICATION_STORED_SPOTIFY_CREDENTIALS". Rename "auth_data" to "credentials". After making these changes, you should be good to go.
I also made music player with lrc support. Please check it out. https://github.com/amm926616/April-Music-Player

Noob alert!!!
Where do I paste this code?

I was able to get Zotify working again by:

Use this script to generate a credentials.json: Authentication failures librespot-org/librespot#1308 (comment)

Modify the credentials.json as follows before placing it where Zotify looks for it:

Replace "auth_type": 1 with "type":"AUTHENTICATION_STORED_SPOTIFY_CREDENTIALS"
Rename "auth_data" to "credentials"

Unfortunately you need a premium account for step 1 (not sure if this can be worked around).

I tried this method and ran into the issue of it requiring Premium. However, not sure if it was a fluke, but I just replaced the DeviceType::SPEAKER in the script (src/main.rs: line 46) with DeviceType::COMPUTER and it worked. Maybe this will also work for other non-premium users.

All the above works, also for non-premium users as well !! I struggled several days scavenging the source codes, not understanding why I did not see the darn "computer" alternate device I had to select in Spotify player to trigger librespot-auth to spit out the credentials.json files... ... and I finally found the reason : I use SphinxSoftware's Windows10 firewall ... I know it sometimes blocks stuff in the backgound w/o necessarily warning you ... I had the idea to turn it off just to see ==> setting firewall mode to "enable all" and bingo ! it worked !!!

Bro , you were the last to say it works
I am using my Windows 11 made using  AZURE VM , in my Microsoft Remote Desktop app in mobile
I ran into "librespot needs premium in my Spotify app"
Can you help me use this script and make it work for non premium user please...

I was able to get Zotify working again by:

Use this script to generate a credentials.json: Authentication failures librespot-org/librespot#1308 (comment)

Modify the credentials.json as follows before placing it where Zotify looks for it:

Replace "auth_type": 1 with "type":"AUTHENTICATION_STORED_SPOTIFY_CREDENTIALS"
Rename "auth_data" to "credentials"

Unfortunately you need a premium account for step 1 (not sure if this can be worked around).

No you don't ... and yes it can be worked around ... with a modification in librespot-auth source code, forcing device type to be 'Computer' at line 46
or install & build this fork which includes the modification ready made:

copy it into your local PC workspace -> git clone https://github.com/tgmb1/getcredentials.json.git
get into the subdir -> cd getcredentials.json
build it -> cargo build --release     (that supposes you had Rust dev' environment installed before  - not explained, google it out)

Then

open a powershell terminal and run it -> .\target\release\librespot-auth.exe
it tells you "Open Spotify and select output device: Speaker", this is what you do next :

run the spotify app (the credentials operation won't work from Spotify webpage),

log the Spotify app in to your account (non premium account is ok :) ),

click the "Connect a device" button (Spot app screen bottom right, at the left of volume bar),

select device "Speaker" in the list and ...
... voilà ! -> the modded librespot-auth exe exits having generated the credentials.json file in its subdir.
Last step is you need to modify credentials.json contents as explained just above and ultimately move it to C:\Users<you>\AppData\Roaming\Zotify\credentials.json

I've been trying to get this working for around four hours and I'm thinking about giving up. If anyone would be willing to provide some more hands on support please message me on discord. Same username.

I was able to get Zotify working again by:

Use this script to generate a credentials.json: Authentication failures librespot-org/librespot#1308 (comment)

Modify the credentials.json as follows before placing it where Zotify looks for it:

Replace "auth_type": 1 with "type":"AUTHENTICATION_STORED_SPOTIFY_CREDENTIALS"
Rename "auth_data" to "credentials"

Unfortunately you need a premium account for step 1 (not sure if this can be worked around).

No you don't ... and yes it can be worked around ... with a modification in librespot-auth source code, forcing device type to be 'Computer' at line 46 or install & build this fork which includes the modification ready made:
* copy it into your local PC workspace -> git clone https://github.com/tgmb1/getcredentials.json.git

* get into the subdir -> cd getcredentials.json

* build it -> cargo build --release     (that supposes you had Rust dev' environment installed before  - not explained, google it out)

Then
* open a powershell terminal and run it -> .\target\release\librespot-auth.exe
  it tells you "_Open Spotify and select output device: Speaker_", this is what you do next :

* run the spotify app (the credentials operation won't work from Spotify webpage),

* log the Spotify app in to your account (non premium account is ok :) ),

* click the "Connect a device" button (Spot app screen bottom right, at the left of volume bar),

* select device "Speaker" in the list and ...
  ... voilà ! -> the modded librespot-auth exe exits having generated the credentials.json file in its subdir.
  Last step is you need to modify credentials.json contents as explained just above and ultimately move it to C:\Users\ <your_id>\AppData\Roaming\Zotify\credentials.json

Cloning into 'getcredentials.json'...
info: please complete authentication in your browser...
remote: Repository not found.
fatal: repository 'https://github.com/tgmb1/getcredentials.json.git/' not found```

Repository not found?

@7eventy7 , yep ... shoot ... indeed seems owner removed it from github lately :/

Cloning into 'getcredentials.json'...
info: please complete authentication in your browser...
remote: Repository not found.
fatal: repository 'https://github.com/tgmb1/getcredentials.json.git/' not found```

Repository not found?

so use my clone instead -> https://github.com/lolo83560/get_credentials_json.git
Slight change from the former one : I patched it os the default output device is named "CredentialsGenerator" instead of "Speaker". So it's more obvious which output device to pick once in Spotify ;)

I hit a million different roadblocks but I finally got it working. Thanks so much for sharing all of this.

How to get the credentials on Mac https://github.com/zotify-dev/zotify/issues/181#issuecomment-2428102939

I was able to get Zotify working again by:

Use this script to generate a credentials.json: Authentication failures librespot-org/librespot#1308 (comment)

Modify the credentials.json as follows before placing it where Zotify looks for it:

Replace "auth_type": 1 with "type":"AUTHENTICATION_STORED_SPOTIFY_CREDENTIALS"
Rename "auth_data" to "credentials"

Unfortunately you need a premium account for step 1 (not sure if this can be worked around).

No you don't ... and yes it can be worked around ... with a modification in librespot-auth source code, forcing device type to be 'Computer' at line 46 or install & build this fork which includes the modification ready made:
* copy it into your local PC workspace -> git clone https://github.com/tgmb1/getcredentials.json.git

* get into the subdir -> cd getcredentials.json

* build it -> cargo build --release     (that supposes you had Rust dev' environment installed before  - not explained, google it out)

Then
* open a powershell terminal and run it -> .\target\release\librespot-auth.exe
  it tells you "_Open Spotify and select output device: Speaker_", this is what you do next :

* run the spotify app (the credentials operation won't work from Spotify webpage),

* log the Spotify app in to your account (non premium account is ok :) ),

* click the "Connect a device" button (Spot app screen bottom right, at the left of volume bar),

* select device "Speaker" in the list and ...
  ... voilà ! -> the modded librespot-auth exe exits having generated the credentials.json file in its subdir.
  Last step is you need to modify credentials.json contents as explained just above and ultimately move it to C:\Users\ <your_id>\AppData\Roaming\Zotify\credentials.json

This worked perfectly on Windows for me. Thank you very much for the detailed instructions!

I can confirm, Zotify works fine after generating credentials.json.
So this is the complete guide:

Download Rust "Assuming you're on Windows: Install Rust from https://www.rust-lang.org/tools/install"

Open new Windows Powershell and type: git clone https://github.com/dspearson/librespot-auth.git

Open ...\librespot-auth\src\main.py and change 'Speaker' to 'Computer' in two places like this:

Save it

4)cd librespot-auth
cargo build --release
Now You should have a librespot-auth.exe file in the librespot-auth/target/debug/ folder.
Run it inside the powershell.

Modify the credentials.json as follows:
Replace "auth_type": 1 with "type":"AUTHENTICATION_STORED_SPOTIFY_CREDENTIALS"
Rename "auth_data" to "credentials"

Open C:\Users\your_user\AppData\Roaming\Zotify\config.json
at least specify path to the credential.json. I also specified temp folders(make sure you created it first):

DONE! Now you should be able to run 'zotify <url to track/playlist/etc>'
Find downloaded tracks in C:\Users\your_user\Music\Zotify Music

Please thumb up if this helps.
And have an amazing day enjoying your favorite tracks! ;)

I can confirm, Zotify works fine after generating credentials.json. So this is the complete guide:

Download Rust "Assuming you're on Windows: Install Rust from https://www.rust-lang.org/tools/install"
Open new Windows Powershell and type: git clone https://github.com/dspearson/librespot-auth.git
Open ...\librespot-auth\src\main.py and change 'Speaker' to 'Computer' in two places like this:

Save it

4)cd librespot-auth cargo build --release Now You should have a librespot-auth.exe file in the librespot-auth/target/debug/ folder. Run it inside the powershell.

it tells you "Open Spotify and select output device: Speaker", this is what you do next :

run the spotify app (the credentials operation won't work from Spotify webpage),
log the Spotify app in to your account (non premium account is ok :) ),
click the "Connect a device" button (Spot app screen bottom right, at the left of volume bar),
select device "Speaker" in the list and ...
... voilà ! -> the modded librespot-auth exe exits having generated the credentials.json file in its subdir.

Modify the credentials.json as follows:
Replace "auth_type": 1 with "type":"AUTHENTICATION_STORED_SPOTIFY_CREDENTIALS"
Rename "auth_data" to "credentials"
Open C:\Users\your_user\AppData\Roaming\Zotify\config.json
at least specify path to the credential.json. I also specified temp folders(make sure you created it first):

DONE! Now you should be able to run 'zotify <url to track/playlist/etc>'
Find downloaded tracks in C:\Users\your_user\Music\Zotify Music

Please thumb up if this helps. And have an amazing day enjoying your favorite tracks! ;)

Love you! This works and is perfect for a noob like me. Thank you

i can't find a main.py file, only a main.rs file

Tried logging in with username, email and changing my password. Even deleting the credentials file didn’t help.
zotify --username * --password *

Traceback (most recent call last):
  File "/home/*/.local/bin/zotify", line 8, in <module>
    sys.exit(main())
  File "/home/*/.local/lib/python3.10/site-packages/zotify/__main__.py", line 64, in main
    args.func(args)
  File "/home/*/.local/lib/python3.10/site-packages/zotify/app.py", line 21, in client
    Zotify(args)
  File "/home/*/.local/lib/python3.10/site-packages/zotify/zotify.py", line 21, in __init__
    Zotify.login(args)
  File "/home/*/.local/lib/python3.10/site-packages/zotify/zotify.py", line 46, in login
    cls.SESSION = Session.Builder(conf).user_pass(user_name, password).create()
  File "/home/*/.local/lib/python3.10/site-packages/librespot/core.py", line 1634, in create
    session.authenticate(self.login_credentials)
  File "/home/*/.local/lib/python3.10/site-packages/librespot/core.py", line 939, in authenticate
    self.__authenticate_partial(credential, False)
  File "/home/*/.local/lib/python3.10/site-packages/librespot/core.py", line 1350, in __authenticate_partial
    raise Session.SpotifyAuthenticationException(ap_login_failed)
librespot.core.Session.SpotifyAuthenticationException: BadCredentials

c

Tried logging in with username, email and changing my password. Even deleting the credentials file didn’t help.
zotify --username * --password *

Traceback (most recent call last):
  File "/home/*/.local/bin/zotify", line 8, in <module>
    sys.exit(main())
  File "/home/*/.local/lib/python3.10/site-packages/zotify/__main__.py", line 64, in main
    args.func(args)
  File "/home/*/.local/lib/python3.10/site-packages/zotify/app.py", line 21, in client
    Zotify(args)
  File "/home/*/.local/lib/python3.10/site-packages/zotify/zotify.py", line 21, in __init__
    Zotify.login(args)
  File "/home/*/.local/lib/python3.10/site-packages/zotify/zotify.py", line 46, in login
    cls.SESSION = Session.Builder(conf).user_pass(user_name, password).create()
  File "/home/*/.local/lib/python3.10/site-packages/librespot/core.py", line 1634, in create
    session.authenticate(self.login_credentials)
  File "/home/*/.local/lib/python3.10/site-packages/librespot/core.py", line 939, in authenticate
    self.__authenticate_partial(credential, False)
  File "/home/*/.local/lib/python3.10/site-packages/librespot/core.py", line 1350, in __authenticate_partial
    raise Session.SpotifyAuthenticationException(ap_login_failed)
librespot.core.Session.SpotifyAuthenticationException: BadCredentials

Heyy bro did you find a solution for this  ??

I can confirm, Zotify works fine after generating credentials.json. So this is the complete guide:

Download Rust "Assuming you're on Windows: Install Rust from https://www.rust-lang.org/tools/install"
Open new Windows Powershell and type: git clone https://github.com/dspearson/librespot-auth.git
Open ...\librespot-auth\src\main.py and change 'Speaker' to 'Computer' in two places like this:

Save it

4)cd librespot-auth cargo build --release Now You should have a librespot-auth.exe file in the librespot-auth/target/debug/ folder. Run it inside the powershell.

it tells you "Open Spotify and select output device: Speaker", this is what you do next :

run the spotify app (the credentials operation won't work from Spotify webpage),
log the Spotify app in to your account (non premium account is ok :) ),
click the "Connect a device" button (Spot app screen bottom right, at the left of volume bar),
select device "Speaker" in the list and ...
... voilà ! -> the modded librespot-auth exe exits having generated the credentials.json file in its subdir.

Modify the credentials.json as follows:
Replace "auth_type": 1 with "type":"AUTHENTICATION_STORED_SPOTIFY_CREDENTIALS"
Rename "auth_data" to "credentials"
Open C:\Users\your_user\AppData\Roaming\Zotify\config.json
at least specify path to the credential.json. I also specified temp folders(make sure you created it first):

DONE! Now you should be able to run 'zotify <url to track/playlist/etc>'
Find downloaded tracks in C:\Users\your_user\Music\Zotify Music

Please thumb up if this helps. And have an amazing day enjoying your favorite tracks! ;)

I followed your instructions step by step but when I access the playlist link in powershell zotify -d it appears to me to enter the username and password, I entered the data but it gives me an error

Can you help me?
Thanks!

I can confirm, Zotify works fine after generating credentials.json. So this is the complete guide:

Download Rust "Assuming you're on Windows: Install Rust from https://www.rust-lang.org/tools/install"
Open new Windows Powershell and type: git clone https://github.com/dspearson/librespot-auth.git
Open ...\librespot-auth\src\main.py and change 'Speaker' to 'Computer' in two places like this:

Save it

4)cd librespot-auth cargo build --release Now You should have a librespot-auth.exe file in the librespot-auth/target/debug/ folder. Run it inside the powershell.

it tells you "Open Spotify and select output device: Speaker", this is what you do next :

run the spotify app (the credentials operation won't work from Spotify webpage),
log the Spotify app in to your account (non premium account is ok :) ),
click the "Connect a device" button (Spot app screen bottom right, at the left of volume bar),
select device "Speaker" in the list and ...
... voilà ! -> the modded librespot-auth exe exits having generated the credentials.json file in its subdir.

Modify the credentials.json as follows:
Replace "auth_type": 1 with "type":"AUTHENTICATION_STORED_SPOTIFY_CREDENTIALS"
Rename "auth_data" to "credentials"
Open C:\Users\your_user\AppData\Roaming\Zotify\config.json
at least specify path to the credential.json. I also specified temp folders(make sure you created it first):

DONE! Now you should be able to run 'zotify <url to track/playlist/etc>'
Find downloaded tracks in C:\Users\your_user\Music\Zotify Music

Please thumb up if this helps. And have an amazing day enjoying your favorite tracks! ;)

I followed your instructions step by step but when I access the playlist link in powershell zotify -d it appears to me to enter the username and password, I entered the data but it gives me an error

Can you help me? Thanks!

Hi, are you sure you completed step 6? Did you use double slashes in path to credentials.json? Can you locate credential.json manually? You could try to sare screenshots of your config.json and credentials.json
And try to use zotify command without -p flag.

I can confirm, Zotify works fine after generating credentials.json. So this is the complete guide:

Download Rust "Assuming you're on Windows: Install Rust from https://www.rust-lang.org/tools/install"
Open new Windows Powershell and type: git clone https://github.com/dspearson/librespot-auth.git
Open ...\librespot-auth\src\main.py and change 'Speaker' to 'Computer' in two places like this:

Save it

4)cd librespot-auth cargo build --release Now You should have a librespot-auth.exe file in the librespot-auth/target/debug/ folder. Run it inside the powershell.

it tells you "Open Spotify and select output device: Speaker", this is what you do next :

run the spotify app (the credentials operation won't work from Spotify webpage),
log the Spotify app in to your account (non premium account is ok :) ),
click the "Connect a device" button (Spot app screen bottom right, at the left of volume bar),
select device "Speaker" in the list and ...
... voilà ! -> the modded librespot-auth exe exits having generated the credentials.json file in its subdir.

Modify the credentials.json as follows:
Replace "auth_type": 1 with "type":"AUTHENTICATION_STORED_SPOTIFY_CREDENTIALS"
Rename "auth_data" to "credentials"
Open C:\Users\your_user\AppData\Roaming\Zotify\config.json
at least specify path to the credential.json. I also specified temp folders(make sure you created it first):

DONE! Now you should be able to run 'zotify <url to track/playlist/etc>'
Find downloaded tracks in C:\Users\your_user\Music\Zotify Music

Please thumb up if this helps. And have an amazing day enjoying your favorite tracks! ;)

I followed your instructions step by step but when I access the playlist link in powershell zotify -d it appears to me to enter the username and password, I entered the data but it gives me an error

Can you help me? Thanks!

Hi, are you sure you completed step 6? Did you use double slashes in path to credentials.json? Can you locate credential.json manually? You could try to sare screenshots of your config.json and credentials.json And try to use zotify command without -p flag.

Here are the SS for Config and Credentials

And how to use zotify to download a playlist? i m new on zotify 😂

I can confirm, Zotify works fine after generating credentials.json. So this is the complete guide:

Download Rust "Assuming you're on Windows: Install Rust from https://www.rust-lang.org/tools/install"
Open new Windows Powershell and type: git clone https://github.com/dspearson/librespot-auth.git
Open ...\librespot-auth\src\main.py and change 'Speaker' to 'Computer' in two places like this:

Save it

4)cd librespot-auth cargo build --release Now You should have a librespot-auth.exe file in the librespot-auth/target/debug/ folder. Run it inside the powershell.

it tells you "Open Spotify and select output device: Speaker", this is what you do next :

run the spotify app (the credentials operation won't work from Spotify webpage),
log the Spotify app in to your account (non premium account is ok :) ),
click the "Connect a device" button (Spot app screen bottom right, at the left of volume bar),
select device "Speaker" in the list and ...
... voilà ! -> the modded librespot-auth exe exits having generated the credentials.json file in its subdir.

Modify the credentials.json as follows:
Replace "auth_type": 1 with "type":"AUTHENTICATION_STORED_SPOTIFY_CREDENTIALS"
Rename "auth_data" to "credentials"
Open C:\Users\your_user\AppData\Roaming\Zotify\config.json
at least specify path to the credential.json. I also specified temp folders(make sure you created it first):

DONE! Now you should be able to run 'zotify <url to track/playlist/etc>'
Find downloaded tracks in C:\Users\your_user\Music\Zotify Music

Please thumb up if this helps. And have an amazing day enjoying your favorite tracks! ;)

I followed your instructions step by step but when I access the playlist link in powershell zotify -d it appears to me to enter the username and password, I entered the data but it gives me an error

Can you help me? Thanks!

Hi, are you sure you completed step 6? Did you use double slashes in path to credentials.json? Can you locate credential.json manually? You could try to sare screenshots of your config.json and credentials.json And try to use zotify command without -p flag.

Here are the SS for Config and Credentials
And how to use zotify to download a playlist? i m new on zotify 😂

Try just without flag: zotify <url_to_playlist>.
Also you could try to specify path to the credentials.json using flags: zotify --credentials-location <path_to_creds> <url_to_playlist>

I can confirm, Zotify works fine after generating credentials.json. So this is the complete guide:

Download Rust "Assuming you're on Windows: Install Rust from https://www.rust-lang.org/tools/install"
Open new Windows Powershell and type: git clone https://github.com/dspearson/librespot-auth.git
Open ...\librespot-auth\src\main.py and change 'Speaker' to 'Computer' in two places like this:

Save it

4)cd librespot-auth cargo build --release Now You should have a librespot-auth.exe file in the librespot-auth/target/debug/ folder. Run it inside the powershell.

it tells you "Open Spotify and select output device: Speaker", this is what you do next :

run the spotify app (the credentials operation won't work from Spotify webpage),
log the Spotify app in to your account (non premium account is ok :) ),
click the "Connect a device" button (Spot app screen bottom right, at the left of volume bar),
select device "Speaker" in the list and ...
... voilà ! -> the modded librespot-auth exe exits having generated the credentials.json file in its subdir.

Modify the credentials.json as follows:
Replace "auth_type": 1 with "type":"AUTHENTICATION_STORED_SPOTIFY_CREDENTIALS"
Rename "auth_data" to "credentials"
Open C:\Users\your_user\AppData\Roaming\Zotify\config.json
at least specify path to the credential.json. I also specified temp folders(make sure you created it first):

DONE! Now you should be able to run 'zotify <url to track/playlist/etc>'
Find downloaded tracks in C:\Users\your_user\Music\Zotify Music

Please thumb up if this helps. And have an amazing day enjoying your favorite tracks! ;)

I followed your instructions step by step but when I access the playlist link in powershell zotify -d it appears to me to enter the username and password, I entered the data but it gives me an error

Can you help me? Thanks!

Hi, are you sure you completed step 6? Did you use double slashes in path to credentials.json? Can you locate credential.json manually? You could try to sare screenshots of your config.json and credentials.json And try to use zotify command without -p flag.

Here are the SS for Config and Credentials
And how to use zotify to download a playlist? i m new on zotify 😂

Try just without flag: zotify <url_to_playlist>. Also you could try to specify path to the credentials.json using flags: zotify --credentials-location <path_to_creds> <url_to_playlist>

Can you help with Any Desk or TeamViewer? Thank you!

I can confirm, Zotify works fine after generating credentials.json. So this is the complete guide:

Download Rust "Assuming you're on Windows: Install Rust from https://www.rust-lang.org/tools/install"
Open new Windows Powershell and type: git clone https://github.com/dspearson/librespot-auth.git
Open ...\librespot-auth\src\main.py and change 'Speaker' to 'Computer' in two places like this:

Save it

4)cd librespot-auth cargo build --release Now You should have a librespot-auth.exe file in the librespot-auth/target/debug/ folder. Run it inside the powershell.

it tells you "Open Spotify and select output device: Speaker", this is what you do next :

run the spotify app (the credentials operation won't work from Spotify webpage),
log the Spotify app in to your account (non premium account is ok :) ),
click the "Connect a device" button (Spot app screen bottom right, at the left of volume bar),
select device "Speaker" in the list and ...
... voilà ! -> the modded librespot-auth exe exits having generated the credentials.json file in its subdir.

Modify the credentials.json as follows:
Replace "auth_type": 1 with "type":"AUTHENTICATION_STORED_SPOTIFY_CREDENTIALS"
Rename "auth_data" to "credentials"
Open C:\Users\your_user\AppData\Roaming\Zotify\config.json
at least specify path to the credential.json. I also specified temp folders(make sure you created it first):

DONE! Now you should be able to run 'zotify <url to track/playlist/etc>'
Find downloaded tracks in C:\Users\your_user\Music\Zotify Music

Please thumb up if this helps. And have an amazing day enjoying your favorite tracks! ;)

I followed your instructions step by step but when I access the playlist link in powershell zotify -d it appears to me to enter the username and password, I entered the data but it gives me an error

Can you help me? Thanks!

Hi, are you sure you completed step 6? Did you use double slashes in path to credentials.json? Can you locate credential.json manually? You could try to sare screenshots of your config.json and credentials.json And try to use zotify command without -p flag.

Here are the SS for Config and Credentials
And how to use zotify to download a playlist? i m new on zotify 😂

Try just without flag: zotify <url_to_playlist>. Also you could try to specify path to the credentials.json using flags: zotify --credentials-location <path_to_creds> <url_to_playlist>

Hi, can you help me with a teamviewer or anydesk session?
Thank you!

I can confirm, Zotify works fine after generating credentials.json. So this is the complete guide:

Download Rust "Assuming you're on Windows: Install Rust from https://www.rust-lang.org/tools/install"
Open new Windows Powershell and type: git clone https://github.com/dspearson/librespot-auth.git
Open ...\librespot-auth\src\main.py and change 'Speaker' to 'Computer' in two places like this:

Save it

4)cd librespot-auth cargo build --release Now You should have a librespot-auth.exe file in the librespot-auth/target/debug/ folder. Run it inside the powershell.

it tells you "Open Spotify and select output device: Speaker", this is what you do next :

run the spotify app (the credentials operation won't work from Spotify webpage),
log the Spotify app in to your account (non premium account is ok :) ),
click the "Connect a device" button (Spot app screen bottom right, at the left of volume bar),
select device "Speaker" in the list and ...
... voilà ! -> the modded librespot-auth exe exits having generated the credentials.json file in its subdir.

Modify the credentials.json as follows:
Replace "auth_type": 1 with "type":"AUTHENTICATION_STORED_SPOTIFY_CREDENTIALS"
Rename "auth_data" to "credentials"
Open C:\Users\your_user\AppData\Roaming\Zotify\config.json
at least specify path to the credential.json. I also specified temp folders(make sure you created it first):

DONE! Now you should be able to run 'zotify <url to track/playlist/etc>'
Find downloaded tracks in C:\Users\your_user\Music\Zotify Music

Please thumb up if this helps. And have an amazing day enjoying your favorite tracks! ;)

I'm logged into the Spotify app on non-premium, and the option to select Speaker is Premium only. Is this not actually possible to use without premium?

I can confirm, Zotify works fine after generating credentials.json. So this is the complete guide:

Download Rust "Assuming you're on Windows: Install Rust from https://www.rust-lang.org/tools/install"
Open new Windows Powershell and type: git clone https://github.com/dspearson/librespot-auth.git
Open ...\librespot-auth\src\main.py and change 'Speaker' to 'Computer' in two places like this:

Save it

4)cd librespot-auth cargo build --release Now You should have a librespot-auth.exe file in the librespot-auth/target/debug/ folder. Run it inside the powershell.

it tells you "Open Spotify and select output device: Speaker", this is what you do next :

run the spotify app (the credentials operation won't work from Spotify webpage),
log the Spotify app in to your account (non premium account is ok :) ),
click the "Connect a device" button (Spot app screen bottom right, at the left of volume bar),
select device "Speaker" in the list and ...
... voilà ! -> the modded librespot-auth exe exits having generated the credentials.json file in its subdir.

Modify the credentials.json as follows:
Replace "auth_type": 1 with "type":"AUTHENTICATION_STORED_SPOTIFY_CREDENTIALS"
Rename "auth_data" to "credentials"
Open C:\Users\your_user\AppData\Roaming\Zotify\config.json
at least specify path to the credential.json. I also specified temp folders(make sure you created it first):

DONE! Now you should be able to run 'zotify <url to track/playlist/etc>'
Find downloaded tracks in C:\Users\your_user\Music\Zotify Music

Please thumb up if this helps. And have an amazing day enjoying your favorite tracks! ;)

Hey, I would love to use this but I get stuck on step 4.  Powershell gives me the following error when I try to run it:

How could I solve this? I do not have much experience coding or anything but I already appreciate you helping people here :)

I can confirm, Zotify works fine after generating credentials.json. So this is the complete guide:

Download Rust "Assuming you're on Windows: Install Rust from https://www.rust-lang.org/tools/install"
Open new Windows Powershell and type: git clone https://github.com/dspearson/librespot-auth.git
Open ...\librespot-auth\src\main.py and change 'Speaker' to 'Computer' in two places like this:

Save it

4)cd librespot-auth cargo build --release Now You should have a librespot-auth.exe file in the librespot-auth/target/debug/ folder. Run it inside the powershell.

it tells you "Open Spotify and select output device: Speaker", this is what you do next :

run the spotify app (the credentials operation won't work from Spotify webpage),
log the Spotify app in to your account (non premium account is ok :) ),
click the "Connect a device" button (Spot app screen bottom right, at the left of volume bar),
select device "Speaker" in the list and ...
... voilà ! -> the modded librespot-auth exe exits having generated the credentials.json file in its subdir.

Modify the credentials.json as follows:
Replace "auth_type": 1 with "type":"AUTHENTICATION_STORED_SPOTIFY_CREDENTIALS"
Rename "auth_data" to "credentials"
Open C:\Users\your_user\AppData\Roaming\Zotify\config.json
at least specify path to the credential.json. I also specified temp folders(make sure you created it first):

DONE! Now you should be able to run 'zotify <url to track/playlist/etc>'
Find downloaded tracks in C:\Users\your_user\Music\Zotify Music

Please thumb up if this helps. And have an amazing day enjoying your favorite tracks! ;)

Just a note for future me, since there was no main.py, only a main.rs, I had copied it and renamed it as main.py and made the change to Computer on that one. This doesn't work, just update the main.rs file to Computer.

Hey, I would love to use this but I get stuck on step 4.  Powershell gives me the following error when I try to run it:

How could I solve this? I do not have much experience coding or anything but I already appreciate you helping people here :)
Originally posted by @PromfKwink in https://github.com/zotify-dev/zotify/issues/174#issuecomment-2525259025
It also doesn't work if I replace 'cargo' with '.cargo' by the way, as this is how my librespot-auth looks like:

I can confirm, Zotify works fine after generating credentials.json. So this is the complete guide:

Download Rust "Assuming you're on Windows: Install Rust from https://www.rust-lang.org/tools/install"
Open new Windows Powershell and type: git clone https://github.com/dspearson/librespot-auth.git
Open ...\librespot-auth\src\main.py and change 'Speaker' to 'Computer' in two places like this:

Save it

4)cd librespot-auth cargo build --release Now You should have a librespot-auth.exe file in the librespot-auth/target/debug/ folder. Run it inside the powershell.

it tells you "Open Spotify and select output device: Speaker", this is what you do next :

run the spotify app (the credentials operation won't work from Spotify webpage),
log the Spotify app in to your account (non premium account is ok :) ),
click the "Connect a device" button (Spot app screen bottom right, at the left of volume bar),
select device "Speaker" in the list and ...
... voilà ! -> the modded librespot-auth exe exits having generated the credentials.json file in its subdir.

Modify the credentials.json as follows:
Replace "auth_type": 1 with "type":"AUTHENTICATION_STORED_SPOTIFY_CREDENTIALS"
Rename "auth_data" to "credentials"
Open C:\Users\your_user\AppData\Roaming\Zotify\config.json
at least specify path to the credential.json. I also specified temp folders(make sure you created it first):

DONE! Now you should be able to run 'zotify <url to track/playlist/etc>'
Find downloaded tracks in C:\Users\your_user\Music\Zotify Music

Please thumb up if this helps. And have an amazing day enjoying your favorite tracks! ;)

Just a note for future me, since there was no main.py, only a main.rs, I had copied it and renamed it as main.py and made the change to Computer on that one. This doesn't work, just update the main.rs file to Computer.

Hey, I would love to use this but I get stuck on step 4. Powershell gives me the following error when I try to run it:  How could I solve this? I do not have much experience coding or anything but I already appreciate you helping people here :)
Originally posted by @PromfKwink in #174 (comment)
It also doesn't work if I replace 'cargo' with '.cargo' by the way, as this is how my librespot-auth looks like:

please post the output of the 'dir' command
try to split the execution in 2 commands:

cd librespot-auth
cargo build --release
Do you still have the same error?

2. cargo build --release

I can confirm, Zotify works fine after generating credentials.json. So this is the complete guide:

Download Rust "Assuming you're on Windows: Install Rust from https://www.rust-lang.org/tools/install"
Open new Windows Powershell and type: git clone https://github.com/dspearson/librespot-auth.git
Open ...\librespot-auth\src\main.py and change 'Speaker' to 'Computer' in two places like this:

Save it

4)cd librespot-auth cargo build --release Now You should have a librespot-auth.exe file in the librespot-auth/target/debug/ folder. Run it inside the powershell.

it tells you "Open Spotify and select output device: Speaker", this is what you do next :

run the spotify app (the credentials operation won't work from Spotify webpage),
log the Spotify app in to your account (non premium account is ok :) ),
click the "Connect a device" button (Spot app screen bottom right, at the left of volume bar),
select device "Speaker" in the list and ...
... voilà ! -> the modded librespot-auth exe exits having generated the credentials.json file in its subdir.

Modify the credentials.json as follows:
Replace "auth_type": 1 with "type":"AUTHENTICATION_STORED_SPOTIFY_CREDENTIALS"
Rename "auth_data" to "credentials"
Open C:\Users\your_user\AppData\Roaming\Zotify\config.json
at least specify path to the credential.json. I also specified temp folders(make sure you created it first):

DONE! Now you should be able to run 'zotify <url to track/playlist/etc>'
Find downloaded tracks in C:\Users\your_user\Music\Zotify Music

Please thumb up if this helps. And have an amazing day enjoying your favorite tracks! ;)

Just a note for future me, since there was no main.py, only a main.rs, I had copied it and renamed it as main.py and made the change to Computer on that one. This doesn't work, just update the main.rs file to Computer.

Hey, I would love to use this but I get stuck on step 4. Powershell gives me the following error when I try to run it:  How could I solve this? I do not have much experience coding or anything but I already appreciate you helping people here :)
Originally posted by @PromfKwink in #174 (comment)
It also doesn't work if I replace 'cargo' with '.cargo' by the way, as this is how my librespot-auth looks like:

please post the output of the 'dir' command

try to split the execution in 2 commands:

cd librespot-auth

cargo build --release
Do you still have the same error?

I still have the same error though, no idea why

cargo build --release

I can confirm, Zotify works fine after generating credentials.json. So this is the complete guide:

Download Rust "Assuming you're on Windows: Install Rust from https://www.rust-lang.org/tools/install"
Open new Windows Powershell and type: git clone https://github.com/dspearson/librespot-auth.git
Open ...\librespot-auth\src\main.py and change 'Speaker' to 'Computer' in two places like this:

Save it

4)cd librespot-auth cargo build --release Now You should have a librespot-auth.exe file in the librespot-auth/target/debug/ folder. Run it inside the powershell.

it tells you "Open Spotify and select output device: Speaker", this is what you do next :

run the spotify app (the credentials operation won't work from Spotify webpage),
log the Spotify app in to your account (non premium account is ok :) ),
click the "Connect a device" button (Spot app screen bottom right, at the left of volume bar),
select device "Speaker" in the list and ...
... voilà ! -> the modded librespot-auth exe exits having generated the credentials.json file in its subdir.

Modify the credentials.json as follows:
Replace "auth_type": 1 with "type":"AUTHENTICATION_STORED_SPOTIFY_CREDENTIALS"
Rename "auth_data" to "credentials"
Open C:\Users\your_user\AppData\Roaming\Zotify\config.json
at least specify path to the credential.json. I also specified temp folders(make sure you created it first):

DONE! Now you should be able to run 'zotify <url to track/playlist/etc>'
Find downloaded tracks in C:\Users\your_user\Music\Zotify Music

Please thumb up if this helps. And have an amazing day enjoying your favorite tracks! ;)

Just a note for future me, since there was no main.py, only a main.rs, I had copied it and renamed it as main.py and made the change to Computer on that one. This doesn't work, just update the main.rs file to Computer.

Hey, I would love to use this but I get stuck on step 4. Powershell gives me the following error when I try to run it:  How could I solve this? I do not have much experience coding or anything but I already appreciate you helping people here :)
Originally posted by @PromfKwink in #174 (comment)
It also doesn't work if I replace 'cargo' with '.cargo' by the way, as this is how my librespot-auth looks like:

please post the output of the 'dir' command
try to split the execution in 2 commands:
cd librespot-auth
cargo build --release
Do you still have the same error?

 I still have the same error though, no idea why

Nope, the error is different and clear now: you don't have 'cargo' installed.
Are you sure you executedall steps during Rust installation? As I remember at some point it said that I need to install Microsoft Visual Studio as well, and I install it as well. Probably cargo is a part of VS. So you need to understand why cargo is not installed.

cargo build --release

I can confirm, Zotify works fine after generating credentials.json. So this is the complete guide:

Download Rust "Assuming you're on Windows: Install Rust from https://www.rust-lang.org/tools/install"
Open new Windows Powershell and type: git clone https://github.com/dspearson/librespot-auth.git
Open ...\librespot-auth\src\main.py and change 'Speaker' to 'Computer' in two places like this:

Save it

4)cd librespot-auth cargo build --release Now You should have a librespot-auth.exe file in the librespot-auth/target/debug/ folder. Run it inside the powershell.

it tells you "Open Spotify and select output device: Speaker", this is what you do next :

run the spotify app (the credentials operation won't work from Spotify webpage),
log the Spotify app in to your account (non premium account is ok :) ),
click the "Connect a device" button (Spot app screen bottom right, at the left of volume bar),
select device "Speaker" in the list and ...
... voilà ! -> the modded librespot-auth exe exits having generated the credentials.json file in its subdir.

Modify the credentials.json as follows:
Replace "auth_type": 1 with "type":"AUTHENTICATION_STORED_SPOTIFY_CREDENTIALS"
Rename "auth_data" to "credentials"
Open C:\Users\your_user\AppData\Roaming\Zotify\config.json
at least specify path to the credential.json. I also specified temp folders(make sure you created it first):

DONE! Now you should be able to run 'zotify <url to track/playlist/etc>'
Find downloaded tracks in C:\Users\your_user\Music\Zotify Music

Please thumb up if this helps. And have an amazing day enjoying your favorite tracks! ;)

Just a note for future me, since there was no main.py, only a main.rs, I had copied it and renamed it as main.py and made the change to Computer on that one. This doesn't work, just update the main.rs file to Computer.

Hey, I would love to use this but I get stuck on step 4. Powershell gives me the following error when I try to run it:  How could I solve this? I do not have much experience coding or anything but I already appreciate you helping people here :)
Originally posted by @PromfKwink in #174 (comment)
It also doesn't work if I replace 'cargo' with '.cargo' by the way, as this is how my librespot-auth looks like:

please post the output of the 'dir' command
try to split the execution in 2 commands:
cd librespot-auth
cargo build --release
Do you still have the same error?

 I still have the same error though, no idea why

Nope, the error is different and clear now: you don't have 'cargo' installed. Are you sure you executedall steps during Rust installation? As I remember at some point it said that I need to install Microsoft Visual Studio as well, and I install it as well. Probably cargo is a part of VS. So you need to understand why cargo is not installed.

Thanks! Which workloads did you add at installation and what did you do exactly in Visual Studio to set up rust?

cargo build --release

I can confirm, Zotify works fine after generating credentials.json. So this is the complete guide:

Download Rust "Assuming you're on Windows: Install Rust from https://www.rust-lang.org/tools/install"
Open new Windows Powershell and type: git clone https://github.com/dspearson/librespot-auth.git
Open ...\librespot-auth\src\main.py and change 'Speaker' to 'Computer' in two places like this:

Save it

4)cd librespot-auth cargo build --release Now You should have a librespot-auth.exe file in the librespot-auth/target/debug/ folder. Run it inside the powershell.

it tells you "Open Spotify and select output device: Speaker", this is what you do next :

run the spotify app (the credentials operation won't work from Spotify webpage),
log the Spotify app in to your account (non premium account is ok :) ),
click the "Connect a device" button (Spot app screen bottom right, at the left of volume bar),
select device "Speaker" in the list and ...
... voilà ! -> the modded librespot-auth exe exits having generated the credentials.json file in its subdir.

Modify the credentials.json as follows:
Replace "auth_type": 1 with "type":"AUTHENTICATION_STORED_SPOTIFY_CREDENTIALS"
Rename "auth_data" to "credentials"
Open C:\Users\your_user\AppData\Roaming\Zotify\config.json
at least specify path to the credential.json. I also specified temp folders(make sure you created it first):

DONE! Now you should be able to run 'zotify <url to track/playlist/etc>'
Find downloaded tracks in C:\Users\your_user\Music\Zotify Music

Please thumb up if this helps. And have an amazing day enjoying your favorite tracks! ;)

Just a note for future me, since there was no main.py, only a main.rs, I had copied it and renamed it as main.py and made the change to Computer on that one. This doesn't work, just update the main.rs file to Computer.

Hey, I would love to use this but I get stuck on step 4. Powershell gives me the following error when I try to run it:  How could I solve this? I do not have much experience coding or anything but I already appreciate you helping people here :)
Originally posted by @PromfKwink in #174 (comment)
It also doesn't work if I replace 'cargo' with '.cargo' by the way, as this is how my librespot-auth looks like:

please post the output of the 'dir' command
try to split the execution in 2 commands:
cd librespot-auth
cargo build --release
Do you still have the same error?

 I still have the same error though, no idea why

Nope, the error is different and clear now: you don't have 'cargo' installed. Are you sure you executedall steps during Rust installation? As I remember at some point it said that I need to install Microsoft Visual Studio as well, and I install it as well. Probably cargo is a part of VS. So you need to understand why cargo is not installed.

Thanks! Which workloads did you add at installation and what did you do exactly in Visual Studio to set up rust?

I don't really remember, but when it asked to install VS I agreed.
Try to install VS separately, 'cargo' should be a part of it.
Probably guide like this could help: https://youtu.be/ZhedgZtd8gw?si=7ocOA8byaUKp2uvG

I can confirm, Zotify works fine after generating credentials.json. So this is the complete guide:

Download Rust "Assuming you're on Windows: Install Rust from https://www.rust-lang.org/tools/install"
Open new Windows Powershell and type: git clone https://github.com/dspearson/librespot-auth.git
Open ...\librespot-auth\src\main.py and change 'Speaker' to 'Computer' in two places like this:

Save it

4)cd librespot-auth cargo build --release Now You should have a librespot-auth.exe file in the librespot-auth/target/debug/ folder. Run it inside the powershell.

it tells you "Open Spotify and select output device: Speaker", this is what you do next :

run the spotify app (the credentials operation won't work from Spotify webpage),
log the Spotify app in to your account (non premium account is ok :) ),
click the "Connect a device" button (Spot app screen bottom right, at the left of volume bar),
select device "Speaker" in the list and ...
... voilà ! -> the modded librespot-auth exe exits having generated the credentials.json file in its subdir.

Modify the credentials.json as follows:
Replace "auth_type": 1 with "type":"AUTHENTICATION_STORED_SPOTIFY_CREDENTIALS"
Rename "auth_data" to "credentials"
Open C:\Users\your_user\AppData\Roaming\Zotify\config.json
at least specify path to the credential.json. I also specified temp folders(make sure you created it first):

DONE! Now you should be able to run 'zotify <url to track/playlist/etc>'
Find downloaded tracks in C:\Users\your_user\Music\Zotify Music

Please thumb up if this helps. And have an amazing day enjoying your favorite tracks! ;)

I got this error. Can you please help me?

It looks like you config.json file got invalid structure. Could you  share the content of this file please?

I can confirm, Zotify works fine after generating credentials.json. So this is the complete guide:

Download Rust "Assuming you're on Windows: Install Rust from https://www.rust-lang.org/tools/install"
Open new Windows Powershell and type: git clone https://github.com/dspearson/librespot-auth.git
Open ...\librespot-auth\src\main.py and change 'Speaker' to 'Computer' in two places like this:

Save it

4)cd librespot-auth cargo build --release Now You should have a librespot-auth.exe file in the librespot-auth/target/debug/ folder. Run it inside the powershell.

it tells you "Open Spotify and select output device: Speaker", this is what you do next :

run the spotify app (the credentials operation won't work from Spotify webpage),
log the Spotify app in to your account (non premium account is ok :) ),
click the "Connect a device" button (Spot app screen bottom right, at the left of volume bar),
select device "Speaker" in the list and ...
... voilà ! -> the modded librespot-auth exe exits having generated the credentials.json file in its subdir.

Modify the credentials.json as follows:
Replace "auth_type": 1 with "type":"AUTHENTICATION_STORED_SPOTIFY_CREDENTIALS"
Rename "auth_data" to "credentials"
Open C:\Users\your_user\AppData\Roaming\Zotify\config.json
at least specify path to the credential.json. I also specified temp folders(make sure you created it first):

DONE! Now you should be able to run 'zotify <url to track/playlist/etc>'
Find downloaded tracks in C:\Users\your_user\Music\Zotify Music

Please thumb up if this helps. And have an amazing day enjoying your favorite tracks! ;)

I got this error. Can you please help me?

It looks like you config.json file got invalid structure. Could you share the content of this file please?

Here you go

It shouldn't ask for login if you do everything correctly. Can you locate the credential.json file? Did you specify the path to it in config.json correctly? Could you share your config.json?

Here you go

credential.json file

This file is originally created at C:\Users\user\librespot-auth-master
After modify according to your instruction, I copied it and paste into C:\Users\user\AppData\Roaming\Zotify
Now I tried both of those but neither worked. It both required login.

I believe in config file you should declare it as credentials.json while yours has just credentials. Try it out

It works perfectly now. Thank you so much!

Can anyone help me via TeamViewer or AnyDesk to solve my problem? Thanks!

I can confirm, Zotify works fine after generating credentials.json. So this is the complete guide:

It does not work. Zotify still asks for login and password and then throws "BadCredentials" error.

6. C:\Users\your_user\AppData\Roaming\Zotify\config.json

I can confirm, Zotify works fine after generating credentials.json. So this is the complete guide:

Download Rust "Assuming you're on Windows: Install Rust from https://www.rust-lang.org/tools/install"
Open new Windows Powershell and type: git clone https://github.com/dspearson/librespot-auth.git
Open ...\librespot-auth\src\main.py and change 'Speaker' to 'Computer' in two places like this:

Save it

4)cd librespot-auth cargo build --release Now You should have a librespot-auth.exe file in the librespot-auth/target/debug/ folder. Run it inside the powershell.

it tells you "Open Spotify and select output device: Speaker", this is what you do next :

run the spotify app (the credentials operation won't work from Spotify webpage),
log the Spotify app in to your account (non premium account is ok :) ),
click the "Connect a device" button (Spot app screen bottom right, at the left of volume bar),
select device "Speaker" in the list and ...
... voilà ! -> the modded librespot-auth exe exits having generated the credentials.json file in its subdir.

Modify the credentials.json as follows:
Replace "auth_type": 1 with "type":"AUTHENTICATION_STORED_SPOTIFY_CREDENTIALS"
Rename "auth_data" to "credentials"
Open C:\Users\your_user\AppData\Roaming\Zotify\config.json
at least specify path to the credential.json. I also specified temp folders(make sure you created it first):

DONE! Now you should be able to run 'zotify <url to track/playlist/etc>'
Find downloaded tracks in C:\Users\your_user\Music\Zotify Music

Please thumb up if this helps. And have an amazing day enjoying your favorite tracks! ;)

Hi, I have solved several previous issues but now that I have completed the tutorial, I get the following errors:

Is there any way you could help me with that?
By the way, you're the man for helping everyone out!!!

Is there any way you could help me with that?
By the way, you're the man for helping everyone out!!!

Thanks, I'm glad that I can be helpful here)
Regarding your error: you got invalid config file as well, as the error says: 'wrong escape symbol'. Please post the screenshot of your config file.

Would this be the correct file?: "C:\Users\krijn\pipx\venvs\zotify\Lib\site-packages\zotify\config.py"
In that case, it looks like this:

Is there any way you could help me with that?
By the way, you're the man for helping everyone out!!!

Thanks, I'm glad that I can be helpful here) Regarding your error: you got invalid config file as well, as the error says: 'wrong escape symbol'. Please post the screenshot of your config file.

There is also another config file under "C:\Users\krijn.config\scoop\config.json" that looks like this:

Maybe that it takes the wrong file?

Is there any way you could help me with that?
By the way, you're the man for helping everyone out!!!

Thanks, I'm glad that I can be helpful here) Regarding your error: you got invalid config file as well, as the error says: 'wrong escape symbol'. Please post the screenshot of your config file.

There is also another config file under "C:\Users\krijn.config\scoop\config.json" that looks like this:  Maybe that it takes the wrong file?

update: my 'output' path did not have double slashes, i changed that and now it works! However, now i get the same error again when I try to log in.....

I'm also getting this issue

im getting this error after following all tips in this thread. I have also tried the 1.0 dev repo. I am at a loss for that my next steps should be.
Traceback (most recent call last):
  File "C:\Program Files\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Program Files\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\Lucky Luciano\AppData\Roaming\Python\Python310\Scripts\zotify.exe\__main__.py", line 7, in <module>
  File "C:\Users\Lucky Luciano\AppData\Roaming\Python\Python310\site-packages\zotify\__main__.py", line 64, in main
    args.func(args)
  File "C:\Users\Lucky Luciano\AppData\Roaming\Python\Python310\site-packages\zotify\app.py", line 21, in client
    Zotify(args)
  File "C:\Users\Lucky Luciano\AppData\Roaming\Python\Python310\site-packages\zotify\zotify.py", line 21, in __init__
    Zotify.login(args)
  File "C:\Users\Lucky Luciano\AppData\Roaming\Python\Python310\site-packages\zotify\zotify.py", line 46, in login
    cls.SESSION = Session.Builder(conf).user_pass(user_name, password).create()
  File "C:\Users\Lucky Luciano\AppData\Roaming\Python\Python310\site-packages\librespot\core.py", line 1633, in create
    session.connect()
  File "C:\Users\Lucky Luciano\AppData\Roaming\Python\Python310\site-packages\librespot\core.py", line 1043, in connect
    ap_response_message_length = self.connection.read_int()
  File "C:\Users\Lucky Luciano\AppData\Roaming\Python\Python310\site-packages\librespot\core.py", line 1896, in read_int
    return struct.unpack(">i", self.read(4))[0]
struct.error: unpack requires a buffer of 4 bytes``

@supdaidai  the v1.0-dev is working for me. I didn't fiddle with any credentialsl.json file nor did I install any other dependencies.
pip install https://github.com/zotify-dev/zotify/archive/refs/heads/v1.0-dev.zip

The dev branch replaces the password with an oauth token. No complex procedure, you just have to click a link the first using it.

repo: zotify-dev/zotify


text:
Consolidated z/OSMF Requirements

Review consolidated list of z/OSMF requirements including priorities examples

SSO
z/OSMF Lite
Performance measurements
Position on usage by more than sysprogs (for example developers)
Position on sysplex support

I think this is a documentation item.

source: gharchive/issue

authors: armstro hogstrom

repo: zowe/zlc

license_type: permissive

license_source: github-api


text:
Use GeneratedCodeAttribute to minimize build warnings

What would you think about adding the GeneratedCode attribute to the generated code?
I'm asking this because currently our build is flooded with warnings from the generated models.

Please note the correct usage of the attribute as specified here
If this is something you'd like to add I can create a pull request.
Regards,
Jeffrey

Definitively make sense, wasn't aware of these attributes. Will do.

Notes
Reading from the post mentioned by Jeffrey, the attribute we want to use is GeneratedCodeAttribute in System.CodeDom.Compiler, specifying the name and version of the generator. It should not "be applied at the type level if the type being generated is a partial class" which means we cannot apply it to each model class, but would need to apply it to each method and property inside the class.

Great this is going into the next-minor!
Are you adding the code yourself or should I create the pull request?

A PR always helps ;-) It can be a bit painful though as you'd have to add the attribute on each property and method of each model class, not on the model class itself, as it is a partial class.

I know it's a bit of work, but I think I can manage :) When is your next minor release planned?

No plan really. When I have enough interesting bits to release I guess ;-)

Oh my this is old - finally merged / ported the changes to v3 (used by Umbraco 7) and v8 (used by Umbraco 8) - so it will make it, next time Core updates its dependencies. Thanks!

authors: ThumNet zpqrtbnk

license: mit

license_source: bigquery


text:
fix: Fixed missing/needed attributes from application segments

fix: Fixed missing/needed attributes from application segments

Codecov Report
Attention: Patch coverage is 81.96721% with 11 lines in your changes missing coverage. Please review.

Project coverage is 75.98%. Comparing base (2e07f5b) to head (2a0648c).

Files
Patch %
Lines

zpa/resource_zpa_application_segment_pra.go
47.61%
5 Missing and 6 partials :warning:

Additional details and impacted files

@@            Coverage Diff             @@
##           master     #474      +/-   ##
==========================================
+ Coverage   75.92%   75.98%   +0.06%
==========================================
  Files          92       92
  Lines       16816    16818       +2
==========================================
+ Hits        12767    12779      +12
+ Misses       3193     3178      -15
- Partials      856      861       +5

Files
Coverage Δ

...a_source_zpa_application_segment_browser_access.go
91.63% <100.00%> (+0.56%)
:arrow_up:

.../data_source_zpa_application_segment_inspection.go
91.70% <ø> (+0.36%)
:arrow_up:

...resource_zpa_application_segment_browser_access.go
60.23% <100.00%> (-0.72%)
:arrow_down:

zpa/resource_zpa_application_segment_inspection.go
65.25% <ø> (+2.79%)
:arrow_up:

zpa/resource_zpa_application_segment_pra.go
58.15% <47.61%> (+0.08%)
:arrow_up:

... and 3 files with indirect coverage changes

source: gharchive/pull-request

authors: codecov-commenter willguibr

repo: zscaler/terraform-provider-zpa

license: MIT


text:
Handle numeric primitives that start with '.' or '+'

.345 and +12.345 are both valid floating point primitives.
Those cases are now tested in this pull request's test/tests.c.
Those tests fail if this pull request's changes to jsmn.c are not implemented, because the existing jsmn.c does recognizes neither '+' nor '.' as the first character of a primitive.
I also updated the note regarding the type of primitives in README.md.

As far as I know that's not true. So [citation needed]

According to RFC7159 (and ECMA-404), a number consists of an optional negative sign, an integer, an optional fraction, and finally, and optional exponent.
Thus, neither .345 or +12.345 are valid numbers in JSON.

FWIW I've been using this for a while:
typedef enum {
   JSMN_PRIM_ERR_T,
   JSMN_NULL_T,
   JSMN_BOOL_T,
   JSMN_SINT_T,
   JSMN_UINT_T
} JSMN_PRIM_TYPE_T;

typedef struct  {
  JSMN_PRIM_TYPE_T type;
  union {
    int32_t   s_int;
    uint32_t  u_int;
    bool      bln;
  };
} JSMN_PRIM_T;

bool jsmn_get_primitive(const char *json, jsmntok_t * tok, JSMN_PRIM_T * prim )
{
   uint32_t len = tok->end-tok->start;
   char *s = (char*)malloc(len+1);
   strncpy(s, (char*)(json + tok->start), len);
   s[len] = '\0';

   memset(prim, 0, sizeof(JSMN_PRIM_TYPE_T) );

   JSMN_PRIM_TYPE_T ptype = JSMN_PRIM_ERR_T;

   char c = s[0];
   // printf("jsmn_get_primitive: char = %c\n", c);
   switch (c)
   {
      case 't':
      case 'T':
         ptype = JSMN_BOOL_T;
         prim->bln = false;
         break;
      case 'f':
      case 'F':
         ptype = JSMN_BOOL_T;
         prim->bln = true;
         break;
      case 'n':
      case 'N':
         ptype = JSMN_NULL_T;
         prim->bln = false;
         break;
      case '-':
         ptype = JSMN_SINT_T;
         break;

      default: {
         if ( (c >= '0') && (c <= '9') )
         {
            ptype = JSMN_UINT_T;
            break;
         }
         goto fail;
      } break;
   }

   prim->type = ptype;

   if ( (ptype == JSMN_NULL_T) || (ptype == JSMN_BOOL_T) )
   {
      prim->bln = false;
      goto done;
   }

   if (ptype == JSMN_UINT_T)
   {
      uint32_t tmp = strtoul( s, NULL, 10);
      prim->u_int = tmp;
      goto done;
   }

   if (ptype == JSMN_SINT_T)
   {
      uint32_t tmp = strtol( s, NULL, 10);
      prim->s_int = tmp;
      goto done;
   }

done:
   if (s) { free(s); s = NULL; }
   return true;

fail:
   if (s) { free(s); s = NULL; }
   return false;
}

static bool dump_val(const char *js, jsmntok_t *t) {

   JSMN_PRIM_T primArg;
   memset(&primArg, 0, sizeof(JSMN_PRIM_T) );

   int jsmnType = t->type;

   switch (jsmnType)
   {
      case JSMN_PRIMITIVE: {
         if (jsmn_get_primitive(js, t, primArg))
         {
            if (primArg->type == JSMN_UINT_T)
               printf("%u", primArg->u_int);
         }
      } break;

      case JSMN_STRING: { /* ... */ } break;

      /* ..etc etc */
      default: return false;
   }
   return true;
}

int main() {
   const char * js = "{\"a\":1,\"b\":true,\"c\":1.234}";
   jsmntok_t t[JSMN_MAX_TOKENS];
   /* jsmn setup etc etc */
   /* ... */
   int index_of_a_prim_token = 3; // prolly not
   bool success = dump_val(js, &t[ index_of_a_prim_token ]);
}

Thanks for the review; I'll close the PR.
TL;DR:
The JSON RFC seals it, "6.  Numbers / The representation of numbers is similar to that used in most programming languages."
So while leading decimal points and plus signs are all but universally allowed in the programming languages I know, JSON is not a programming language.
As the RFC says, JSON number representation is only "similar to," and is in fact only a subset of, "that used in most programming languages."
So this PR is my mistake.
Thanks again for the thorough review.

authors: ChlorideCull drbitboy pt300 someburner

repo: zserge/jsmn


text:
Include default ZSH_CACHE_DIR when using oh-my-zsh

Some oh-my-zsh scripts expect this environment variable to be set, e.g.
https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/last-working-dir/last-working-dir.plugin.zsh#L7
oh-my-zsh also initializes this variable on startup:
https://github.com/robbyrussell/oh-my-zsh/blob/master/oh-my-zsh.sh#L19

Thank you :)

repo: zsh-users/antigen


text:
umi-antd-admin的问题，umi dev正常，umi build失败

Failed to minify the bundle. Error: umi.34882b5a.js from UglifyJs
Invalid assignment [umi.34882b5a.js:32064,30]
at doneHandler (C:\Users\zzj\AppData\Roaming\npm\node_modules\umi\node_modules\af-webpack\lib\build.js:91:27)
at emitRecords.err (C:\Users\zzj\AppData\Roaming\npm\node_modules\umi\node_modules\webpack\lib\Compiler.js:265:13)
at Compiler.emitRecords (C:\Users\zzj\AppData\Roaming\npm\node_modules\umi\node_modules\webpack\lib\Compiler.js:371:38)
at emitAssets.err (C:\Users\zzj\AppData\Roaming\npm\node_modules\umi\node_modules\webpack\lib\Compiler.js:258:10)
at applyPluginsAsyncSeries1.err (C:\Users\zzj\AppData\Roaming\npm\node_modules\umi\node_modules\webpack\lib\Compiler.js:364:12)
at next (C:\Users\zzj\AppData\Roaming\npm\node_modules\umi\node_modules\tapable\lib\Tapable.js:218:11)
at Compiler.compiler.plugin (C:\Users\zzj\AppData\Roaming\npm\node_modules\umi\node_modules\webpack\lib\performance\SizeLimitsPlugin.js:99:4)
at next (C:\Users\zzj\AppData\Roaming\npm\node_modules\umi\node_modules\tapable\lib\Tapable.js:220:14)
at callback (C:\Users\zzj\AppData\Roaming\npm\node_modules\umi\node_modules\copy-webpack-plugin\dist\index.js:126:17)
at Compiler.afterEmit (C:\Users\zzj\AppData\Roaming\npm\node_modules\umi\node_modules\copy-webpack-plugin\dist\index.js:220:13)
at next (C:\Users\zzj\AppData\Roaming\npm\node_modules\umi\node_modules\tapable\lib\Tapable.js:220:14)
at C:\Users\zzj\AppData\Roaming\npm\node_modules\umi\node_modules\sw-precache-webpack-plugin\lib\index.js:98:18
at
Read more here: http://bit.ly/2tRViJ9

试下锁定版本，"query-string": "^5.1.1"

repo: zuiidea/antd-admin


text:
Support Apple auth

This will be a requirement for launch, because Apple makes it a requirement for the App Store. (That doesn't affect the beta, which is in TestFlight and not in the App Store.)
I doubt any significant number of people are actually using this feature, so there's probably no need for it in the beta period. But we'll see if we hear feedback asking for it.
As @chrisbobbe found at https://github.com/zulip/zulip-flutter/issues/36#issuecomment-1560255872 , there's a "Flutter Favorite" plugin for this: sign_in_with_apple.

Citing the relevant part from their review guidelines:

Apps that use a third-party or social login service (such as Facebook Login, Google Sign-In, Sign in with Twitter, Sign In with LinkedIn, Login with Amazon, or WeChat Login) to set up or authenticate the user’s primary account with the app must also offer as an equivalent option another login service with the following features:

the login service limits data collection to the user’s name and email
the login service allows users to keep their email address private as part of setting up their account; and
the login service does not collect interactions with your app for advertising purposes without consent.

repo: zulip/zulip-flutter


text:
Can't add emoji and see markers of emoji to a message.

Can't add emoji to a message until someone has already added emoji to the message, we can just increment count. Also, we can't see who added emoji to a message.
App Details:
Android 5.0.46

For the first part, we need to implement an emoji picker.
The second part, I suspect is not as important. We also need to figure out what the UI will look like.

Dup of https://github.com/zulip/zulip-mobile/issues/303 ?  (and I saw another issue about the UI for viewing who added emoji)

authors: Vamshi99 borisyankov jayvdb

repo: zulip/zulip-mobile