Skip to content

Commit

Permalink
update README with more clear instructions about the GUI auto login w…
Browse files Browse the repository at this point in the history
…hen credential file generated successfully
  • Loading branch information
a_pomp committed Jan 26, 2025
1 parent 3589da9 commit 7feabcf
Showing 1 changed file with 77 additions and 88 deletions.
165 changes: 77 additions & 88 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,124 +1,113 @@
# Overview
### Overview
This is a set of scripts for copying "liked" songs and playlists from Spotify to YTMusic. It provides a GUI (implemented by Yoween, formerly called spotify_to_ytmusic_gui).

This is a set of scripts for copying "liked" songs and playlists from Spotify to YTMusic.
It provides a GUI (implemented by Yoween, formerly called [spotify_to_ytmusic_gui](https://github.com/Yoween/spotify_to_ytmusic_gui)).

## Getting Started

- Install Python and Git (you may already have it)
- Make sure you have uninstalled the pip package from the original repo of linsomniac/spotify_to_ytmusic

On Windows:
```shell
python -m pip uninstall spotify2ytmusic
```

On Linux or Mac:
```bash
python3 -m pip uninstall spotify2ytmusic
```

## Setup Instructions
---

### 1. Clone & Create a Virtual Environment & Install Required Packages
### Preparation/Pre-Conditions

Start by creating and activating a Python virtual environment to isolate dependencies.
```powershell
git clone https://github.com/AmidelEst/spotify_to_ytmusic.git
cd spotify_to_ytmusic
```
1. **Install Python and Git** (you may already have them installed).
2. **Uninstall the pip package from the original repository** (if you previously installed `linsomniac/spotify_to_ytmusic`):

On Windows:
```shell
python -m venv .venv
.venv\Scripts\activate
pip install ytmusicapi tk
```
On Windows:
```bash
python -m pip uninstall spotify2ytmusic
```

On Linux or Mac:
```bash
python3 -m venv .venv
source .venv/bin/activate
pip install ytmusicapi tk
```
On Linux or Mac:
```bash
python3 -m pip uninstall spotify2ytmusic
```

---

### 2. Generate YouTube Music Credentials
### Setup Instructions

To use the YouTube Music API, you need to generate valid credentials. Follow these steps:
![GIF demonstrating how to inquire about credentials in YouTube Music](assets/youtube-music-instructions.gif)
#### 1. Clone, Create a Virtual Environment, and Install Required Packages

1. **Log in to YouTube Music**:
Open [YouTube Music](https://music.youtube.com) in Firefox and ensure you are logged in.
Start by creating and activating a Python virtual environment to isolate dependencies.

2. **Open the Inspection Tool**:
Press `F12` or (right click +inspection tool) to open the browser’s inspection tool.
```bash
git clone https://github.com/AmidelEst/spotify_to_ytmusic.git
cd spotify_to_ytmusic
```

3. **Access the Network Tab**:
Navigate to the **Network** tab and filter by `/browse`.
On Windows:
```bash
python -m venv .venv
.venv\Scripts\activate
pip install ytmusicapi tk
```

4. **Select a Request**:
Click on one of the requests under the filtered results and locate the **Request Headers** section.
On Linux or Mac:
```bash
python3 -m venv .venv
source .venv/bin/activate
pip install ytmusicapi tk
```

5. **Toggle RAW View**:
Click on the **RAW** toggle button to view the headers in raw format.

6. **Copy Headers**:
Right-click, choose **Select All**, and then copy the content.
---

7. **Paste into `raw_headers.txt`**:
Open the `raw_headers.txt` file located in the main directory of this project and paste the copied content into it.
#### 2. Generate YouTube Music Credentials

8. **Run the Script**:
To use the YouTube Music API, you need to generate valid credentials. Follow these steps:

Execute the following command to generate the credentials file:
1. **Log in to YouTube Music**: Open YouTube Music in Firefox and ensure you are logged in.
2. **Open the Inspection Tool**: Press `F12` or right-click and select *Inspect* to open the browser's inspection tool.
3. **Access the Network Tab**: Navigate to the Network tab and filter by `/browse`.
4. **Select a Request**: Click one of the requests under the filtered results and locate the *Request Headers* section.
5. **Toggle RAW View**: Click the RAW toggle button to view the headers in raw format.
6. **Copy Headers**: Right-click, choose *Select All*, and copy the content.
7. **Paste into `raw_headers.txt`**: Open the `raw_headers.txt` file located in the main directory of this project and paste the copied content into it.

On Windows:
```powershell
python spotify2ytmusic/ytmusic_credentials.py
```
**Run the Script**:

On Linux or Mac:
```shell
python3 spotify2ytmusic/ytmusic_credentials.py
```
Execute the following command to generate the credentials file:

9. **Done**:
On Windows:
```bash
python spotify2ytmusic/ytmusic_credentials.py
```

Your YouTube Music credentials are now ready.
On Linux or Mac:
```bash
python3 spotify2ytmusic/ytmusic_credentials.py
```

---
**Important**: After running this script, the authentication file will be created.
When you launch the GUI in the next step, it will automatically detect this file and log in to YouTube Music without requiring manual input. You’ll see a log message confirming this:
```
File detected, auto login
```

### 3. Use the GUI for Migration
The GUI will **ignore the 'Login to YT Music' tab** and jump straight to the 'Spotify Backup' tab.

Now you can use the graphical user interface (GUI) Tab 2 -> Tab 6
to migrate your playlists and liked songs to YouTube Music.
Start the GUI with the following command:
---

On Windows:
#### 3. Use the GUI for Migration

```shell
python -m spotify2ytmusic gui
```
Now you can use the graphical user interface (GUI) to migrate your playlists and liked songs to YouTube Music. Start the GUI with the following command:

On Linux or Mac:
On Windows:
```bash
python -m spotify2ytmusic gui
```

```bash
python3 -m spotify2ytmusic gui
```
On Linux or Mac:
```bash
python3 -m spotify2ytmusic gui
```

---

## GUI Features
### GUI Features

Once the GUI is running, you can:
Once the GUI is running, you can:

- **Backup Your Spotify Playlists**: will save your playlists and liked songs into the file "playlists.json".
- **Load Liked Songs**: Migrate your Spotify liked songs to YouTube Music.
- **List Playlists**: View your playlists and their details.
- **Copy All Playlists**: Migrate all Spotify playlists to YouTube Music.
- **Copy a Specific Playlist**: Select and migrate a specific Spotify playlist to YouTube Music.
- **Backup Your Spotify Playlists**: Save your playlists and liked songs into the file `playlists.json`.
- **Load Liked Songs**: Migrate your Spotify liked songs to YouTube Music.
- **List Playlists**: View your playlists and their details.
- **Copy All Playlists**: Migrate all Spotify playlists to YouTube Music.
- **Copy a Specific Playlist**: Select and migrate a specific Spotify playlist to YouTube Music.

---

Expand Down

0 comments on commit 7feabcf

Please sign in to comment.