Comments (5)
Sounds reasonable, feel free to submit a PR when you get around to it.
Do you think it's possible to make using SpotifyOAuth optional since it involves an extra step?
from spotify_to_ytmusic.
Library is great, but doesn't support user's liked Songs. This is because it's currently using the Client Credentials Flow. Turns out you can support user's liked songs with only a few extra steps.
I'll outline here and try put together a PR sometime, it just requires a few changes.
- Add
http://localhost
as a redirect URL on Spotify- Swap out
SpotifyClientCredentials
forSpotifyOAuth(client_id=conf['client_id'], client_secret=conf['client_secret'], scope="user-library-read", redirect_uri="http://localhost")
- When you login, it'll open a browser, ask the user to sign in, then you copy the URL back into console
- Make a new func like this:
def getSpotifyLikedTracks(self): results = [] playlists = self.api.current_user_saved_tracks(20) while playlists: for i, playlist in enumerate(playlists['items']): result = build_result(playlist); results.append(result) if playlists['next']: playlists = self.api.next(playlists) else: playlists = None return results
Splitting out
build_results
into:def build_results(tracks, album=None): results = [] for track in tracks: result = build_result(track, album) if result is not None: results.append(result) return results def build_result(track, album=None): if 'track' in track: track = track['track'] album_name = album if album else track['album']['name'] return { 'artist': ' '.join([artist['name'] for artist in track['artists']]), 'name': track['name'], 'album': album_name, 'duration': track['duration_ms']/1000 }
And then have a func somewhere in
main
doing the following:tracks = Spotify().getSpotifyLikedTracks() videoIds = ytmusic.search_songs(tracks) playlist_id = ytmusic.create_playlist("Liked Music", "Liked Music", "PRIVATE", videoIds)
Any idea when you could submit this?
I'm having a few issues
from spotify_to_ytmusic.
Hello friends, any news?
from spotify_to_ytmusic.
I'm open towards somebody submitting an implementation. The SpotifyOAuth should be optional though and only used where relevant (i.e. for all transfer, liked songs).
from spotify_to_ytmusic.
hi. I opened the spotify application on my pc (windows), then I selected all the liked songs with the Ctrl + A button and added them to a new playlist.
from spotify_to_ytmusic.
Related Issues (20)
- Issue with installing ytmusicapi HOT 1
- match.py crashes on privated videos
- KeyError: 'album'
- [add program to path]'spotify_to_ytmusic' is not recognized as an internal or external command, operable program or batch file. HOT 1
- Google OAuth not working HOT 9
- Would you like to contribute to another Spotify to Youtube Project ?
- Transfer Liked songs --> Couldn't read/write token to cache at: .cache HOT 2
- Spotify auth not working HOT 4
- Request: Add a way to retry / resume transfers if a failure occurs HOT 2
- Playlist creation failing silently HOT 6
- Spotify authentication doesn't work
- Spotify authentication doesn't work HOT 2
- Exception: Server returned HTTP 400: Bad Request. HOT 8
- App doesn`t boot HOT 2
- SpotifyOauthError: Invalid_grant - When trying to update playlist HOT 2
- OAuth not redirecting to localhost HOT 1
- HTTP 400: Bad Request. You are creating too many playlists in ALL mode HOT 2
- [FEAT] Update all HOT 2
- Invalid client HOT 6
- Issues on mac HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spotify_to_ytmusic.