forked from bakamono12/Terabox-Bypass
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
34 lines (27 loc) · 943 Bytes
/
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
import os
import logging
import re
from dotenv import load_dotenv
load_dotenv()
logger = logging.getLogger(__name__)
my_cookie = os.environ.get("MY_COOKIES")
my_headers = os.environ.get("MY_HEADERS")
session_string = os.environ.get("session_string")
allowed_groups = os.environ.get("allowed_groups") or "-123232ZCVZB" # added random group id to avoid NoneType error
# allowed_groups = ["-123232ZCVZB"] or ["121222xxx", "123456xxx"]
owner_id = os.environ.get("owner_id") or ""
try:
my_cookie = eval(my_cookie)
my_headers = eval(my_headers)
allowed_groups = eval(allowed_groups)
except Exception as e:
logger.error(f"Error parsing env variables: {e}")
def extract_links(message):
# fetch all links
try:
url_pattern = r'https?://\S+'
matches = re.findall(url_pattern, message)
return matches
except Exception as e:
logger.error(f"Error extracting links: {e}")
return []