Добавил удаление всех треков с плейлиста
This commit is contained in:
parent
3bda2fca70
commit
3bfc16d44e
1 changed files with 21 additions and 0 deletions
21
main.py
Normal file
21
main.py
Normal file
|
@ -0,0 +1,21 @@
|
|||
import asyncio
|
||||
|
||||
import yaml
|
||||
from yandex_music import Client
|
||||
|
||||
config = yaml.safe_load(open('config.yaml', 'r', encoding='utf-8'))
|
||||
client = Client(token=config['token'])
|
||||
|
||||
async def main() -> None:
|
||||
client.init()
|
||||
len_playlist = client.users_likes_tracks()
|
||||
uid = client.account_status()['account']['uid']
|
||||
|
||||
|
||||
for track in client.users_playlists(kind=3)['tracks']:
|
||||
client.users_likes_tracks_remove(track_ids=track['id'])
|
||||
print(f'Удален трек: {track['track']['title']}')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
asyncio.run(main())
|
Loading…
Add table
Reference in a new issue