Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Как получить ID пользователя? #25

Open
AlexInCube opened this issue Jul 18, 2023 · 3 comments
Open

Как получить ID пользователя? #25

AlexInCube opened this issue Jul 18, 2023 · 3 comments

Comments

@AlexInCube
Copy link

Я пытаюсь получить плейлисты пользователей.

Если публичные ссылки на плейлисты/треки выглядят так. Из такой ссылки я могу сразу вытащить ID и плейлиста и трека:
https://music.yandex.com/album/5307396/track/38633706
То у пользователей вот так, тут нет циферного ID для пользователя. А все методы требуют именно циферный ID (number или integer)
https://music.yandex.ru/users/kasimova.06/playlists/1001
И я не понимаю, как мне kasimova.06 превратить в ID пользователя. Чтобы передать его в client.user.getPlaylistById()
Я не вижу маршрутов для этого в API и методов в пакете для JavaScript.

@AlexInCube
Copy link
Author

Поменяв в файле UserService.d.ts в функции getPlaylistById параметр userId с типа данных number на string, я смог получить плейлист пользователя.

@acherkashin
Copy link
Owner

@AlexInCube А в качестве строки, что передаёте?

@AlexInCube
Copy link
Author

AlexInCube commented Jul 20, 2023

Я делаю парсинг ссылки https://music.yandex.ru/users/alexander.tsimbalistiy/playlists/1000
И достаю оттуда alexander.tsimbalistiy, и передаю это в функцию getPlaylistById

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants