-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.py
50 lines (38 loc) · 1.33 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
import logging
import os
import ssl
import sys
from enum import Enum
import easyocr
import telebot
from selenium.webdriver.chrome.options import Options
ssl._create_default_https_context = ssl._create_unverified_context
chrome_options = Options()
chrome_options.add_argument("--headless")
chrome_options.add_argument("--no-sandbox")
chrome_options.add_argument("--disable-dev-shm-usage")
my_id = os.environ['TG_MY_ID']
api_token = os.environ['TG_BOT_API_TOKEN']
tg_bot = telebot.TeleBot(api_token)
sleep_times = {
'init': os.environ.get('SLEEP_INIT', 3),
'after_enter': os.environ.get('SLEEP_AFTER_ENTER', 5),
'between_calls': os.environ.get('SLEEP_BETWEEN_CALLS', 60),
}
reader = easyocr.Reader(['en'], gpu=False, recog_network='english_g2')
n_iterations = 10_000
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
logger = logging.getLogger('ticketmaster_availability')
EVENTS = [
(
'TOP Milan 28.04.2025',
'https://shop.ticketmaster.it/tickets/buy-tickets-twenty-one-pilots-the-clancy-world-tour-28-april-2025-forum-assago-8877.html'
),
(
'TOP Bologna 17.04.2025',
'https://shop.ticketmaster.it/tickets/buy-tickets-twenty-one-pilots-the-clancy-world-tour-17-april-2025-unipol-arena-casalecchio-di-reno-8880.html'
)
]
class Status(Enum):
NOT_AVAILABLE = 0
AVAILABLE = 1