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
| #!/usr/bin/env bash | |
| BASEDIR=$(dirname "$0") | |
| cd "$BASEDIR" || exit | |
| echo ".... Locale setup." | |
| sudo apt install language-pack-ru | |
| echo ".... Install python env" | |
| sudo apt install -y python3 python3-venv |
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
| from random import random | |
| from yandex_music import Track | |
| class Radio: | |
| def __init__(self, client): | |
| self.client = client | |
| self.station_id = None | |
| self.station_from = None |
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
| from pathlib import Path | |
| from yandex_music import Client, Track | |
| # Get formatted file name from track info | |
| def get_file_name(track_obj: Track, ext: str, bitrate: int) -> str: | |
| artist_name = track_obj.artists[0].name if track_obj.artists else "" | |
| album_name = track_obj.albums[0].title if track_obj.albums else "" | |
| file_name = f'[{artist_name}][{album_name}] {track_obj.title} ({bitrate}).{ext}' |
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
| import os | |
| from pathlib import Path | |
| from time import sleep | |
| from yandex_music import Client | |
| # LOGIN = "" | |
| # PASSWORD = "" | |
| # token = Client().generate_token_by_username_and_password(LOGIN, PASSWORD) | |
| # print("TOKEN:", token) |