File size: 2,137 Bytes
634ce31
 
 
 
 
 
 
 
 
138e7e8
634ce31
 
 
8c3b06f
634ce31
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
from os import environ as env

class Telegram:
    API_ID = int(env.get("TELEGRAM_API_ID", 12345))
    API_HASH = env.get("TELEGRAM_API_HASH", "xyz")
    OWNER_ID = [int(x) for x in env.get("OWNER_ID", "5530237028").split()]
    ALLOWED_USER_IDS = env.get("ALLOWED_USER_IDS", "").split()
    BOT_USERNAME = env.get("TELEGRAM_BOT_USERNAME", "xxxx_streambot")
    BOT_TOKEN = env.get("TELEGRAM_BOT_TOKEN", "1234567:xyz")
    CHANNEL_ID = int(env.get("TELEGRAM_CHANNEL_ID", -1002041882858))
    SECRET_CODE_LENGTH = int(env.get("SECRET_CODE_LENGTH", 10))

class Server:
    BASE_URL = env.get("BASE_URL", "https://jerrrycans-file2.hf.space")
    BIND_ADDRESS = env.get("BIND_ADDRESS", "0.0.0.0")
    PORT = int(env.get("PORT", 7860))

# Suppose PICS is defined as a string of links separated by spaces:
PICS = env.get("PICS", "https://envs.sh/0Uw.jpg https://envs.sh/0Uq.jpg https://envs.sh/0U0.jpg https://envs.sh/0UW.jpg https://envs.sh/0UI.jpg https://telegra.ph/file/3d0fac76ab59a4ef83b3a.jpg https://i.imgur.com/byGIN5S.jpg https://telegra.ph/file/d9b391fa763286dea1c38.jpg")

# LOGGING CONFIGURATION
LOGGER_CONFIG_JSON = {
    'version': 1,
    'formatters': {
        'default': {
            'format': '[%(asctime)s][%(name)s][%(levelname)s] -> %(message)s',
            'datefmt': '%d/%m/%Y %H:%M:%S'
        },
    },
    'handlers': {
        'file_handler': {
            'class': 'logging.FileHandler',
            'filename': 'event-log.txt',
            'formatter': 'default'
        },
        'stream_handler': {
            'class': 'logging.StreamHandler',
            'formatter': 'default'
        }
    },
    'loggers': {
        'uvicorn': {
            'level': 'INFO',
            'handlers': ['file_handler', 'stream_handler']
        },
        'uvicorn.error': {
            'level': 'WARNING',
            'handlers': ['file_handler', 'stream_handler']
        },
        'bot': {
            'level': 'INFO',
            'handlers': ['file_handler', 'stream_handler']
        },
        'hydrogram': {
            'level': 'INFO',
            'handlers': ['file_handler', 'stream_handler']
        }
    }
}