forked from hplatforms/URL-Yukleyici
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
92 lines (64 loc) · 2.36 KB
/
config.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
import re
import os
from os import environ
from dotenv import load_dotenv
from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton
import logging
logging.basicConfig(
format='%(name)s - %(levelname)s - %(message)s',
handlers=[logging.FileHandler('log.txt'),
logging.StreamHandler()],
level=logging.INFO
)
LOGGER = logging
id_pattern = re.compile(r'^.\d+$')
if os.path.exists('config.env'):
load_dotenv('config.env')
# get a token from @BotFather
BOT_TOKEN = environ.get("BOT_TOKEN", "")
# The Telegram API things
# Get these values from my.telegram.org
APP_ID = int(environ.get("APP_ID", 1234))
API_HASH = environ.get("API_HASH", "")
# the download location, where the HTTP Server runs
DOWNLOAD_LOCATION = "./DOWNLOADS"
# Update channel for Force Subscribe
auth_channel = environ.get('AUTH_CHANNEL')
auth_grp = environ.get('AUTH_GROUP')
AUTH_CHANNEL = int(auth_channel) if auth_channel and id_pattern.search(auth_channel) else None
# Broadcast
BROADCAST_AS_COPY = bool(environ.get("BROADCAST_AS_COPY", True))
# Log Channel ID
log_channel = environ.get('LOG_CHANNEL')
LOG_CHANNEL = int(log_channel) if log_channel else None
# Telegram maximum file upload size
MAX_FILE_SIZE = 50000000
TG_MAX_FILE_SIZE = 2097152000
# chunk size that should be used with requests
CHUNK_SIZE = int(environ.get("CHUNK_SIZE", 128))
# default thumbnail to be used in the videos
DEF_THUMB_NAIL_VID_S = environ.get("DEF_THUMB_NAIL_VID_S", "")
# proxy for accessing youtube-dl in GeoRestricted Areas
# Get your own proxy from https://github.com/rg3/youtube-dl/issues/1091#issuecomment-230163061
HTTP_PROXY = environ.get("HTTP_PROXY", "")
# maximum message length in Telegram
MAX_MESSAGE_LENGTH = 4096
# set timeout for subprocess
PROCESS_MAX_TIMEOUT = 3600
# watermark file
DEF_WATER_MARK_FILE = ""
# your telegram id
OWNER_ID = int(environ.get("OWNER_ID"))
# database session name, example: urluploader
SESSION_NAME = environ.get("SESSION_NAME", "")
# database uri (mongodb)
DATABASE_URL = environ.get("DATABASE_URL", "")
# Heroku
HEROKU_APP_NAME = environ.get('HEROKU_APP_NAME', None)
HEROKU_API_KEY = environ.get('HEROKU_API_KEY', None)
# Advertisement
PROMO = str(environ.get("PROMO", "True")).lower() == 'true'
# Pasaport
PASS = os.environ.get("PASS", None).upper()
# Other
SEND_LOGS_WHEN_DYING = str(environ.get("SEND_LOGS_WHEN_DYING", "True")).lower() == 'true'