dhruv-ahuja / spoti-dl

spoti-dl: download songs, albums and playlists using Spotify links
https://pypi.org/project/spoti-dl/
MIT License
68 stars 7 forks source link

How to setup the application #7

Closed Neimod2004 closed 1 year ago

Neimod2004 commented 1 year ago

'spoti-dl' is not recognized as an internal or external command, operable program or batch file.

I followed all the steps and when I run 'pip install spoti-dl' again it says all the requirements are already satisfied

dhruv-ahuja commented 1 year ago

Hey, thanks for trying it out! Yeah, I am having issues with the deployment process and v2.0 isnt actually live yet. Sorry for the confusion. You would have to run spotidl ... command, and would not have access to the following features currently: -p and can download files in only flac and mp3.

I will revert the readme.md file to previous version as well.

dhruv-ahuja commented 1 year ago

@Neimod2004 https://github.com/dhruv-ahuja/spoti-dl#readme I've reverted the document changes for now, please check this.

I will let you know once I'm able to get the new version up and running.

Neimod2004 commented 1 year ago

It also doesn't recognize 'spotidl' as a command, even when I reïnstall and open the terminal in the right directory

dhruv-ahuja commented 1 year ago

Hey, I've released the new version, can you please try reinstalling the app? It will work now :)

Neimod2004 commented 1 year ago

C:\Users\Ds>pip install spoti-dl Requirement already satisfied: spoti-dl in c:\users\ds\appdata\roaming\python\python311\site-packages (0.9.2) Requirement already satisfied: python-dotenv<0.20.0,>=0.19.2 in c:\python311\lib\site-packages (from spoti-dl) (0.19.2) Requirement already satisfied: spotipy<3.0.0,>=2.19.0 in c:\users\ds\appdata\roaming\python\python311\site-packages (from spoti-dl) (2.23.0) Requirement already satisfied: yt-dlp<2022.0.0,>=2021.12.27 in c:\users\ds\appdata\roaming\python\python311\site-packages (from spoti-dl) (2021.12.27) Requirement already satisfied: redis>=3.5.3 in c:\users\ds\appdata\roaming\python\python311\site-packages (from spotipy<3.0.0,>=2.19.0->spoti-dl) (5.0.1) Requirement already satisfied: requests>=2.25.0 in c:\users\ds\appdata\roaming\python\python311\site-packages (from spotipy<3.0.0,>=2.19.0->spoti-dl) (2.31.0) Requirement already satisfied: six>=1.15.0 in c:\python311\lib\site-packages (from spotipy<3.0.0,>=2.19.0->spoti-dl) (1.16.0) Requirement already satisfied: urllib3>=1.26.0 in c:\python311\lib\site-packages (from spotipy<3.0.0,>=2.19.0->spoti-dl) (2.0.6) Requirement already satisfied: mutagen in c:\users\ds\appdata\roaming\python\python311\site-packages (from yt-dlp<2022.0.0,>=2021.12.27->spoti-dl) (1.47.0) Requirement already satisfied: pycryptodomex in c:\users\ds\appdata\roaming\python\python311\site-packages (from yt-dlp<2022.0.0,>=2021.12.27->spoti-dl) (3.19.0) Requirement already satisfied: websockets in c:\python311\lib\site-packages (from yt-dlp<2022.0.0,>=2021.12.27->spoti-dl) (11.0.3) Requirement already satisfied: async-timeout>=4.0.2 in c:\users\ds\appdata\roaming\python\python311\site-packages (from redis>=3.5.3->spotipy<3.0.0,>=2.19.0->spoti-dl) (4.0.3) Requirement already satisfied: charset-normalizer<4,>=2 in c:\users\ds\appdata\roaming\python\python311\site-packages (from requests>=2.25.0->spotipy<3.0.0,>=2.19.0->spoti-dl) (3.3.0) Requirement already satisfied: idna<4,>=2.5 in c:\users\ds\appdata\roaming\python\python311\site-packages (from requests>=2.25.0->spotipy<3.0.0,>=2.19.0->spoti-dl) (3.4) Requirement already satisfied: certifi>=2017.4.17 in c:\users\ds\appdata\roaming\python\python311\site-packages (from requests>=2.25.0->spotipy<3.0.0,>=2.19.0->spoti-dl) (2023.7.22)

C:\Users\Ds>spotidl help 'spotidl' is not recognized as an internal or external command, operable program or batch file.

C:\Users\Ds>spoti-dl 'spoti-dl' is not recognized as an internal or external command, operable program or batch file.

Even when I try force reïnstalling older versions it doesn't work

dhruv-ahuja commented 1 year ago

your python installed libraries are probably not inside your path, you will have to add c:\users\ds\appdata\roaming\python\python311\site-packages to your PATH environment variable. Then, restart your terminal and you should be able to invoke spoti-dl as per normal

Neimod2004 commented 1 year ago

that doesn't seem to be the problem, it still doesn't work

dhruv-ahuja commented 1 year ago

That's strange. I've tested extensively on several systems. It's most likely related to path only, can you check what is the install location listed when you run python3.11 -m pip show spoti-dl, and whether that is in the path or not.

Also, if you run python3.11 -m spoti-dl and it says something like "cannot run spoti-dl..it's a package" then that means that the app was installed properly from its end.

Neimod2004 commented 1 year ago

Ok so 'python3.11' is not recognized as a command, but 'python' is. (my python version is 3.11.0) This is what I get when I use python instead of python3.11:

C:\Users\Ds>python -m pip show spoti-dl Name: spoti-dl Version: 0.9.2 Summary: spotidl: download songs, albums and playlists using Spotify links Home-page: https://github.com/good-times-ahead/spoti-dl/ Author: Dhruv Author-email: License: MIT Location: C:\Users\Ds\AppData\Roaming\Python\Python311\site-packages Requires: python-dotenv, spotipy, yt-dlp Required-by:

C:\Users\Ds>

dhruv-ahuja commented 1 year ago

Oh got it, I missed it earlier but the problem is the fact that you have v0.9.2, can you please run pip install spoti-dl==2.0.0, this will install the latest version, and you should be able to use it then.

Neimod2004 commented 1 year ago

It's working now except that that I have changed the SPOTIPY_CLIENT_ID, SPOTIPY_CLIENT_SECRET and SPOTIPY_REDIRECT_URI in 3 different files, it still doesn't work. Probably because of all the failed installs/wrong versions. In what directory should the file be that I need to update?

dhruv-ahuja commented 1 year ago

You will have to add values to to your environment variables, you can refer to a guide online on how to do so for Windows.

Neimod2004 commented 1 year ago

image

they are set properly, I even when I reset the files it doesn't work, I will try searching for different options.

dhruv-ahuja commented 1 year ago

Are you exporting them? You have to add export in front of each env var, if you are setting it in your bash profile or bashrc file.

export SPOTIPY_CLIENT_ID=<value> and so on

Neimod2004 commented 1 year ago

the picture is the result of the 'Set' command

dhruv-ahuja commented 1 year ago

Different profiles have different commands. Most use the export command, hence me asking you to try with export.

Neimod2004 commented 1 year ago

I have tried different methods of adding the env variables, it is still the same. Also 'export' is a linux command and I am trying to run it on windows

dhruv-ahuja commented 1 year ago

You can set system wide environment variables, the same way you added python to your PATH. https://www.alphr.com/set-environment-variables-windows-11/

Neimod2004 commented 1 year ago

image

The environment variables are correct, spotipy just doesn't recognize them when I run the spoti-dl command with a url

dhruv-ahuja commented 1 year ago

I've checked everything from my end, the app works fine for me once I setup env vars and ffmpeg on Windows. You should try setting env vars in the system directly rather than the terminal. There's nothing else to do other than these steps to get the app running.

Neimod2004 commented 1 year ago

I've already tried that, my computer might be a lost cause

kenwaytis commented 1 year ago

I'm on Ubuntu and the project is a success. If you have a strong need and don't mind the hassle, I have a solution for you.

  1. (Prerequisites) Install WSL (Windows Subsystem for Linux)
  2. Install git on WSL (If WSL is Ubuntu, then apt update && apt install git is sufficient)
  3. After git cloning the project, pip install dependencies from requirements.txt
  4. Export three environment variables in the terminal
  5. Test to see if it's successful
dhruv-ahuja commented 1 year ago

The suggestion for wsl is a good one. Can you share a screenshot of your list of env ironment variables, @Neimod2004? The ones accessed through the settings menu, not the terminal ones.

dhruv-ahuja commented 1 year ago

I'm marking this one as closed, let me know if you figure it out or need further assistance.