[GH-ISSUE #204] AttributeError: 'int' object has no attribute 'startswith' #158

Closed
opened 2026-02-27 22:08:21 +03:00 by kerem · 4 comments
Owner

Originally created by @LittleBigOwI on GitHub (Jun 1, 2021).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/204

I execute this :

from ytmusicapi import YTMusic
playlist = YTMusic.get_playlist("PL6bPxvf5dW5clc3y9wAoslzqUrmkZ5c-u", 300)
print(playlist)

and get this :

browseId = "VL" + playlistId if not playlistId.startswith("VL") else playlistId
AttributeError: 'int' object has no attribute 'startswith'

idk what's wrong, any help pls?

Originally created by @LittleBigOwI on GitHub (Jun 1, 2021). Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/204 I execute this : ``` from ytmusicapi import YTMusic playlist = YTMusic.get_playlist("PL6bPxvf5dW5clc3y9wAoslzqUrmkZ5c-u", 300) print(playlist) ``` and get this : ``` browseId = "VL" + playlistId if not playlistId.startswith("VL") else playlistId AttributeError: 'int' object has no attribute 'startswith' ``` idk what's wrong, any help pls?
kerem closed this issue 2026-02-27 22:08:21 +03:00
Author
Owner

@sigma67 commented on GitHub (Jun 2, 2021):

Are you sure that's what you executed? The error says you passed an int as first parameter (playlistId). You can try specifying parameters manually like this to be absolutely sure, although it shouldn't be needed:

playlist = YTMusic.get_playlist(playlistId="PL6bPxvf5dW5clc3y9wAoslzqUrmkZ5c-u", limit=300)

The playlist works fine for me.

<!-- gh-comment-id:852966155 --> @sigma67 commented on GitHub (Jun 2, 2021): Are you sure that's what you executed? The error says you passed an int as first parameter (playlistId). You can try specifying parameters manually like this to be absolutely sure, although it shouldn't be needed: ```python playlist = YTMusic.get_playlist(playlistId="PL6bPxvf5dW5clc3y9wAoslzqUrmkZ5c-u", limit=300) ``` The playlist works fine for me.
Author
Owner

@LittleBigOwI commented on GitHub (Jun 2, 2021):

Are you sure that's what you executed? The error says you passed an int as first parameter (playlistId). You can try specifying parameters manually like this to be absolutely sure, although it shouldn't be needed:

playlist = YTMusic.get_playlist(playlistId="PL6bPxvf5dW5clc3y9wAoslzqUrmkZ5c-u", limit=300)

The playlist works fine for me.

This (for me) results in :

TypeError: get_playlist() missing 1 required positional argument: 'self'

Again, i know what's wrong but idk how to fix it. sorry for the trouble.

<!-- gh-comment-id:852973386 --> @LittleBigOwI commented on GitHub (Jun 2, 2021): > Are you sure that's what you executed? The error says you passed an int as first parameter (playlistId). You can try specifying parameters manually like this to be absolutely sure, although it shouldn't be needed: > > ```python > playlist = YTMusic.get_playlist(playlistId="PL6bPxvf5dW5clc3y9wAoslzqUrmkZ5c-u", limit=300) > ``` > > The playlist works fine for me. This (for me) results in : ``` TypeError: get_playlist() missing 1 required positional argument: 'self' ``` Again, i know what's wrong but idk how to fix it. sorry for the trouble.
Author
Owner

@sigma67 commented on GitHub (Jun 2, 2021):

Oh. Please read the docs. You need to create a class instance first.

https://ytmusicapi.readthedocs.io/en/latest/usage.html

<!-- gh-comment-id:852981857 --> @sigma67 commented on GitHub (Jun 2, 2021): Oh. Please read the docs. You need to create a class instance first. https://ytmusicapi.readthedocs.io/en/latest/usage.html
Author
Owner

@LittleBigOwI commented on GitHub (Jun 2, 2021):

Oh. Please read the docs. You need to create a class instance first.

https://ytmusicapi.readthedocs.io/en/latest/usage.html

This worked perfectly Thanks !

<!-- gh-comment-id:853004793 --> @LittleBigOwI commented on GitHub (Jun 2, 2021): > Oh. Please read the docs. You need to create a class instance first. > > https://ytmusicapi.readthedocs.io/en/latest/usage.html This worked perfectly Thanks !
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/ytmusicapi#158
No description provided.