26 lines
1.0 KiB
Python
26 lines
1.0 KiB
Python
import os
|
|
|
|
TELEGRAM_API_KEY = os.getenv('TELEGRAM_API_KEY')
|
|
baseURL = os.environ['baseURL']
|
|
affiliate_tag = os.environ['affiliate_tag']
|
|
HEADERS = ({'User-Agent':
|
|
'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 Safari/537.36',
|
|
'Accept-Language': 'en-US, en;q=0.5'})
|
|
DB = '/app/data/amazon.db'
|
|
|
|
telegram_proxy = os.environ.get("TELEGRAM_PROXY") == '1'
|
|
if telegram_proxy:
|
|
telegram_socks_user = os.environ.get("TELEGRAM_SOCKS_USER")
|
|
telegram_socks_password = os.environ.get("TELEGRAM_SOCKS_PASSWORD")
|
|
telegram_socks_server = os.environ.get("TELEGRAM_SOCKS_SERVER")
|
|
telegram_socks_port = os.environ.get("TELEGRAM_SOCKS_PORT")
|
|
proxy_url = f"socks5://{telegram_socks_user}:{telegram_socks_password}@{telegram_socks_server}:{telegram_socks_port}"
|
|
|
|
if baseURL.startswith("https://www."):
|
|
searchURL = baseURL[12:]
|
|
elif baseURL.startswith("http://www."):
|
|
searchURL = baseURL[11:]
|
|
baseURL = "https://www."+searchURL
|
|
else:
|
|
searchURL = baseURL
|
|
baseURL = "https://www."+baseURL |