Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marshalx/yandex2spotify
Simple Python script that allow to import music from Yandex.Music to Spotify
https://github.com/marshalx/yandex2spotify
python spotify yandex-music
Last synced: 3 days ago
JSON representation
Simple Python script that allow to import music from Yandex.Music to Spotify
- Host: GitHub
- URL: https://github.com/marshalx/yandex2spotify
- Owner: MarshalX
- License: mit
- Created: 2020-07-15T11:18:59.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-06-07T11:04:59.000Z (5 months ago)
- Last Synced: 2024-10-30T04:50:24.971Z (17 days ago)
- Topics: python, spotify, yandex-music
- Language: Python
- Homepage: https://yandex-music.rtfd.io
- Size: 54.7 KB
- Stars: 228
- Watchers: 7
- Forks: 24
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# yandex2spotify
A simple Python script that allows to import favorite tracks, playlists, albums, and artists from Yandex.Music to Spotify
## Installation
Requires Python 3.8 or higher.
```bash
pip3 install -r requirements.txt
```## Usage
0) [Register a dummy Spotify OAuth application](https://developer.spotify.com/dashboard) and **add `https://open.spotify.com` as a callback URI** in its settings.
1) Obtain a Yandex.Music OAuth token.[^1]
2) Run the script using Client ID and Client Secret copied from your app's Spotify dashboard:
```bash
python3 importer.py --id --secret -u -t
```3) If you don't want to import some items (likes, playlists, albums, artists) you can exclude them by specifying the `-i/--ignore` argument, for example:
```bash
python3 importer.py --id --secret -u -t -i playlists albums artists
```4) After launch, script will open the web browser with authorization dialog. After finishing authorization, you need to copy resulting URL, close browser tab and paste that URL after `Enter the URL you were redirected to:`
5) If authorization succeed - you will see log of import process.
JSON import is also available. Use `--json-path` or `-j` to specify path to JSON file in format described below.
```
[
{
"artist": "Artist Name",
"track": "Track Name"
},
{
"artist": "Artist Name",
"track": "Track Name"
},
...
]
```[^1]: Since it's impossible to register an OAuth application with Yandex.Music access scope, you have to [reuse the token from music.yandex.ru itself](https://github.com/MarshalX/yandex-music-api/discussions/513).