-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathconst.py
42 lines (34 loc) · 1.17 KB
/
const.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
from enum import Enum
import sys
import string
import os
def supports_24bit_color():
"""Determine if the terminal supports 24-bit color."""
if sys.platform != "win32":
return os.getenv("COLORTERM") == "truecolor"
return False
class SpotifyAuthType(str, Enum):
USER = 'user'
ANONYMOUS = 'anonymous'
class colours:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKCYAN = '\033[96m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
CBLACK = '\33[30m'
CGREENBG = '\33[42m'
CREDBG = '\33[41m'
CVIOLETBG2 = '\33[105m'
SPOTIFYGREEN = '\033[38;2;30;215;96m' if supports_24bit_color() else '\033[92m'
LIKED_KEYWORD = "liked"
BASE62 = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
LEGAL_PATH_CHARACTERS = string.ascii_letters + string.digits+ " ()[]" + "_-.,&'!@#$%^&+=~`"
DEFAULT_MIN_VIEWS_FOR_DOWNLOAD = 10000
DEFAULT_MAX_LENGTH_FOR_DOWNLOAD = 60*30
UNKNOWN_ALBUM_COVER_URL = "https://github.com/couldbejake/spotify2mp3/blob/main/assets/unknown-song.png?raw=true"
HELP_URL = "https://github.com/couldbejake/spotify2mp3/issues"