Skip to content

Commit 3d8bace

Browse files
committed
Update readme with pip installation
1 parent 7a26bc5 commit 3d8bace

File tree

2 files changed

+45
-10
lines changed

2 files changed

+45
-10
lines changed

README.md

Lines changed: 43 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
<p align="center">
66
<a href="https://github.com/abhishekmj303/ytm2spt/stargazers"><img src="https://img.shields.io/github/stars/abhishekmj303/ytm2spt?colorA=363a4f&colorB=b7bdf8&style=for-the-badge"></a>
7-
<a href="https://github.com/abhishekmj303/ytm2spt/releases"><img src="https://img.shields.io/github/downloads/abhishekmj303/ytm2spt/total?colorA=363a4f&colorB=a6da95&style=for-the-badge"></a>
8-
<a href="https://github.com/abhishekmj303/ytm2spt/issues"><img src="https://img.shields.io/github/issues/abhishekmj303/ytm2spt?colorA=363a4f&colorB=f5a97f&style=for-the-badge"></a>
7+
<a href="https://github.com/abhishekmj303/ytm2spt/releases/latest"><img src="https://img.shields.io/github/v/release/abhishekmj303/ytm2spt?colorA=363a4f&colorB=a6da95&style=for-the-badge"></a>
8+
<a href="https://github.com/abhishekmj303/ytm2spt/releases"><img src="https://img.shields.io/github/downloads/abhishekmj303/ytm2spt/total?colorA=363a4f&colorB=f5a97f&style=for-the-badge"></a>
99
</p>
1010

1111
<p align="center">
@@ -34,6 +34,10 @@
3434

3535
### Spotify Developer Account
3636

37+
**Why?**
38+
39+
By setting up a Developer account and creating your own credentials (like keys), you are ensuring that the app connects to your account in a safe way without sharing your login details with anyone. It gives you full control over what the app can access and helps keep your Spotify account secure.
40+
3741
1. Create a new app: https://developer.spotify.com/dashboard
3842
2. Set "Redirect URI" to `http://localhost:8888/callback`
3943
![Spotify create new app](media/spotify_create_app.png)
@@ -53,6 +57,25 @@ Download the latest version from the [releases page](https://github.com/abhishek
5357
>
5458
> **Linux**: You need to run the app from terminal, if you want the to know the progress of the transfer.
5559
60+
**Using pip or [pipx](https://github.com/pypa/pipx#install-pipx):**
61+
62+
[![PyPI - Version](https://img.shields.io/pypi/v/ytm2spt?colorA=363a4f&colorB=c6a0f6&style=for-the-badge)](https://pypi.org/project/ytm2spt/)
63+
[![PyPI - Downloads](https://img.shields.io/pypi/dm/ytm2spt?colorA=363a4f&colorB=f0c6c6&style=for-the-badge)](https://pypi.org/p/ytm2spt/)
64+
65+
If you have Python installed, you can install the app using [pipx](https://pipx.pypa.io/) (recommended) or pip.
66+
67+
```sh
68+
pipx install ytm2spt
69+
```
70+
71+
or
72+
73+
```sh
74+
pip install ytm2spt
75+
```
76+
77+
After installation, you can run the app using the command `ytm2spt`.
78+
5679

5780
### Spotify Settings
5881

@@ -78,7 +101,7 @@ Python3 is required to run the app. You can download it from [python.org](https:
78101

79102
### Install Dependencies
80103
```sh
81-
pip install -r requirements.txt
104+
pip install .
82105
```
83106

84107
### Run the App
@@ -118,17 +141,17 @@ pip install -r requirements.txt
118141

119142
### Youtube OAuth (Only for private playlists)
120143

121-
Run the following command to login to your Youtube account and save the credentials to `oauth.json`
144+
Run the following command to login to your Youtube account and save the credentials to `ytmusicapi-oauth.json`
122145
```sh
123-
ytmusicapi oauth
146+
ytmusicapi-oauth
124147
```
125148

126149
## Usage
127150

128151
```sh
129152
$ source .env
130-
$ python ytm2spt.py -h
131-
usage: main.py [-h] -yt YOUTUBE_URL_OR_ID
153+
$ ytm2spt -h
154+
usage: ytm2spt [-h] -yt YOUTUBE_URL_OR_ID
132155
[-sp SPOTIFY_URL_OR_ID | -spname SPOTIFY_PLAYLIST_NAME]
133156
[-ytauth YOUTUBE_OAUTH_JSON]
134157
[-n | -d] [-l LIMIT]
@@ -142,13 +165,25 @@ options:
142165
-spname SPOTIFY_PLAYLIST_NAME, --spotify-playlist-name SPOTIFY_PLAYLIST_NAME
143166
Spotify Playlist Name (Default: Youtube Playlist Name)
144167
-ytauth YOUTUBE_OAUTH_JSON, --youtube-oauth-json YOUTUBE_OAUTH_JSON
145-
Youtube OAuth JSON filepath (run 'ytmusicapi oauth')
168+
Youtube OAuth JSON filepath (run 'ytmusicapi-oauth')
146169
-n, --create-new Force create a new playlist
147170
-d, --dryrun Do not add to Spotify
148171
-l LIMIT, --limit LIMIT
149172
Limit the number of songs to fetch
150173
```
151174

175+
```sh
176+
$ ytmusicapi-oauth -h
177+
usage: ytmusicapi-oauth [-h] [-b] [file]
178+
179+
positional arguments:
180+
file file path to store the json (Default: ytmusic-oauth.json)
181+
182+
options:
183+
-h, --help show this help message and exit
184+
-b, --open-browser open browser for OAuth login (Default: True)
185+
```
186+
152187
### Examples
153188

154189
Sample Playlist: Pop Certified ([YouTube Music](https://music.youtube.com/playlist?list=RDCLAK5uy_lBNUteBRencHzKelu5iDHwLF6mYqjL-JU) to [Spotify](https://open.spotify.com/playlist/6DyIxXHMwuEMbsfPTIr9C8))

src/ytm2spt/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def get_args():
3333
type=str,
3434
default=None,
3535
required=False,
36-
help="Youtube OAuth JSON filepath (run 'ytmusicapi oauth')"
36+
help="Youtube OAuth JSON filepath (run 'ytmusicapi-oauth')"
3737
)
3838
run_group = parser.add_mutually_exclusive_group(required=False)
3939
run_group.add_argument(
@@ -92,7 +92,7 @@ def oauth():
9292
nargs="?",
9393
type=str,
9494
default="ytmusicapi-oauth.json",
95-
help="file path to store the json (Default: ytmusic-oauth.json)",
95+
help="file path to store the json (Default: ytmusicapi-oauth.json)",
9696
)
9797

9898
args = parser.parse_args()

0 commit comments

Comments
 (0)