[GH-ISSUE #948] Insufficient client scope, reason:none #569

Closed
opened 2026-02-27 23:23:24 +03:00 by kerem · 1 comment
Owner

Originally created by @FFGamer04 on GitHub (Mar 10, 2023).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/948

Hey, I was trying to write a python bot that reads reddit comments and adds them to a playlist, but im getting the error http status: 403, code:-1 - https://api.spotify.com/v1/playlists/3htsB9RNJiBZZ5ogUnBKXf/tracks : Insufficient client scope, reason: None

I don't know what I'm doing wrong in the auth, so any help would be appreciated.

import praw
from praw.models import *
import spotipy
import spotipy.util as util
from spotipy.oauth2 import SpotifyOAuth
import time


reddit = praw.Reddit(
    username= 'reddit_username',
    password= 'reddit_password',
    client_id='reddit_client_id',
    client_secret='reddit_client_secret',
    user_agent='python:spotifyimporterbot:v1.0(by u/)',
)



sp = spotipy.Spotify(auth_manager=SpotifyOAuth(client_id="spotify_client_id",
                                               client_secret="spotify_client_secret",
                                               redirect_uri="https://localhost:8888/callback",
                                               scope="playlist-modify-private"));



users=[];

submission= reddit.submission("reddit_submission_id");
print (submission.title)

submission.comments.replace_more(limit=None)
for top_level_comment in submission.comments:
     if 'open.spotify.com' in top_level_comment.body and top_level_comment.author not in users:
        
        #Print the comment
        print(top_level_comment.body)
        

        # Add the track to the playlist
        sp.playlist_add_items('playlist_id', [top_level_comment.body]);

        # Add the username of the user who added the music/comment to the set
        users.append(top_level_comment.author)

        # Sleep for 1 second to prevent going over the rate limit
        time.sleep(1)
   
Originally created by @FFGamer04 on GitHub (Mar 10, 2023). Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/948 Hey, I was trying to write a python bot that reads reddit comments and adds them to a playlist, but im getting the error `http status: 403, code:-1 - https://api.spotify.com/v1/playlists/3htsB9RNJiBZZ5ogUnBKXf/tracks : Insufficient client scope, reason: None` I don't know what I'm doing wrong in the auth, so any help would be appreciated. ```python import praw from praw.models import * import spotipy import spotipy.util as util from spotipy.oauth2 import SpotifyOAuth import time reddit = praw.Reddit( username= 'reddit_username', password= 'reddit_password', client_id='reddit_client_id', client_secret='reddit_client_secret', user_agent='python:spotifyimporterbot:v1.0(by u/)', ) sp = spotipy.Spotify(auth_manager=SpotifyOAuth(client_id="spotify_client_id", client_secret="spotify_client_secret", redirect_uri="https://localhost:8888/callback", scope="playlist-modify-private")); users=[]; submission= reddit.submission("reddit_submission_id"); print (submission.title) submission.comments.replace_more(limit=None) for top_level_comment in submission.comments: if 'open.spotify.com' in top_level_comment.body and top_level_comment.author not in users: #Print the comment print(top_level_comment.body) # Add the track to the playlist sp.playlist_add_items('playlist_id', [top_level_comment.body]); # Add the username of the user who added the music/comment to the set users.append(top_level_comment.author) # Sleep for 1 second to prevent going over the rate limit time.sleep(1) ```
kerem 2026-02-27 23:23:24 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@FFGamer04 commented on GitHub (Mar 14, 2023):

It magically fixed itself. I'll close this issue for now

<!-- gh-comment-id:1468510922 --> @FFGamer04 commented on GitHub (Mar 14, 2023): It magically fixed itself. I'll close this issue for now
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotipy#569
No description provided.