Add playlist importing from Spotify and YouTube#16
Draft
Conversation
Co-authored-by: lucamignatti <78500318+lucamignatti@users.noreply.github.com>
Co-authored-by: lucamignatti <78500318+lucamignatti@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] add playlist importing from spotify and youtube. this was supported for spotify in older versions.
Add playlist importing from Spotify and YouTube
Jul 10, 2025
Owner
|
instead of importing it to the queue, can we make that a queueplaylist command and for the actual importplaylist command import them to the users playlists? @copilot |
…r playlist support Co-authored-by: lucamignatti <78500318+lucamignatti@users.noreply.github.com>
Co-authored-by: lucamignatti <78500318+lucamignatti@users.noreply.github.com>
Author
Done! I've split the functionality as requested:
Also added Changes in commit bbcde4b |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Restores and enhances playlist importing functionality for Spotify and YouTube that was supported in older versions of the bot. This implements the missing "platform playlist support" feature mentioned in the roadmap.
Changes Made
🎵 Backend Enhancements
getplaylist()function to Spotify backend: Extracts songs from Spotify playlist URLs with full pagination support and authenticationgetplaylist()function to YouTube backend: Extracts songs from YouTube playlist URLs using yt-dlp with robust error handling🤖 New Discord Command
Added
/importplaylist <url> [platform]slash command with:🔧 Technical Improvements
📖 Documentation Updates
Usage Examples
Testing
Fixes the playlist importing functionality that users have been requesting, bringing back this popular feature while maintaining the modern plugin-based architecture.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
www.youtube.comimport asyncio
import sys
sys.path.append('Backends/Music')
import youtube
Test getplaylist function with a sample YouTube playlist
async def test_playlist():
# Test with a small public playlist (using a Rick Astley playlist as an example)
test_url = 'REDACTED'
print('Testing YouTube playlist import...')
try:
songs, title = await youtube.getplaylist(test_url, None)
print(f'Playlist: {title}')
print(f'Found {len(songs)} songs')
if songs:
for i, song in enumerate(songs[:3]): # Show first 3 songs
print(f'{i+1}. {song.title} by {song.author} ({song.length}s)')
except Exception as e:
print(f'Error: {e}')
asyncio.run(test_playlist())` (dns block)
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.