File tree Expand file tree Collapse file tree 6 files changed +125
-107
lines changed Expand file tree Collapse file tree 6 files changed +125
-107
lines changed Original file line number Diff line number Diff line change 1
1
__pycache__ /
2
2
venv /
3
3
.idea /
4
+ .vscode /
4
5
setenv.sh
5
6
users_data /** /* .json
6
7
users_data /** /* .pkl
Original file line number Diff line number Diff line change 10
10
11
11
from app .exceptions import OrioksInvalidLoginCredentialsException
12
12
from app .helpers import (
13
- TelegramMessageHelper ,
14
13
CommonHelper ,
15
14
UserHelper ,
16
15
)
17
- import aiogram .utils .markdown as md
18
16
19
17
from config import config
20
18
@@ -27,29 +25,6 @@ async def orioks_login_save_cookies(
27
25
user_login : int , user_password : str , user_telegram_id : int
28
26
) -> None :
29
27
# pylint: disable=protected-access
30
- user_queue = len (_sem ._waiters ) + 2
31
- if user_queue - 2 > 0 :
32
- logging .info ('login: %s' , user_queue )
33
- _cats_queue_emoji = f'{ "🐈" * (user_queue - 1 )} 🐈⬛'
34
- await TelegramMessageHelper .text_message_to_user (
35
- user_telegram_id = user_telegram_id ,
36
- message = md .text (
37
- md .text (_cats_queue_emoji ),
38
- md .text (
39
- md .text (
40
- f'Твой номер в очереди на авторизацию: { user_queue } .'
41
- ),
42
- md .text (
43
- 'Ты получишь уведомление, когда она будет выполнена.'
44
- ),
45
- sep = ' ' ,
46
- ),
47
- md .text (
48
- 'Это предотвращает слишком большую нагрузку на ОРИОКС'
49
- ),
50
- sep = '\n ' ,
51
- ),
52
- )
53
28
async with _sem :
54
29
async with ClientSession (
55
30
timeout = config .REQUESTS_TIMEOUT ,
Original file line number Diff line number Diff line change 1
- from aiogram .utils import markdown
2
-
3
1
from app .exceptions import DatabaseException
4
2
from app .models .users import UserStatus , UserNotifySettings
5
- from config import config
6
3
7
4
8
5
class UserHelper :
@@ -126,32 +123,8 @@ def get_users_with_enabled_news_subscription():
126
123
return users
127
124
128
125
@staticmethod
129
- async def increment_failed_request_count (user_telegram_id : int ) -> None :
130
- user = UserHelper .__get_user_by_telegram_id (
131
- user_telegram_id = user_telegram_id
132
- )
133
- user .failed_request_count += 1
134
- if user .failed_request_count > config .ORIOKS_MAX_FAILED_REQUESTS :
135
- from app .helpers import OrioksHelper
136
- from app .helpers import TelegramMessageHelper
137
-
138
- OrioksHelper .make_orioks_logout (user_telegram_id = user_telegram_id )
139
- await TelegramMessageHelper .text_message_to_user (
140
- user_telegram_id = user_telegram_id ,
141
- message = markdown .text (
142
- markdown .hbold ('Ваш аккаунт был деавторизирован.' ),
143
- markdown .text (
144
- '🔧 Ошибки при получении данных с сервера ОРИОКС.'
145
- ),
146
- markdown .text ('Пожалуйста, авторизуйтесь заново: /login' ),
147
- markdown .text (),
148
- markdown .text (
149
- 'Связаться с поддержкой Бота: @orioks_monitoring_support_bot'
150
- ),
151
- sep = '\n ' ,
152
- ),
153
- )
154
- user .save ()
126
+ async def increment_failed_request_count (_ : int ) -> None :
127
+ return # FIXME
155
128
156
129
@staticmethod
157
130
def reset_failed_request_count (user_telegram_id : int ) -> None :
Original file line number Diff line number Diff line change @@ -172,6 +172,7 @@ async def user_news_check_from_news_id(
172
172
message = f'[{ user_telegram_id } ] - old_json["last_id"] > last_news_id["last_id"]'
173
173
)
174
174
await session .close ()
175
+ CommonHelper .safe_delete (path = path_users_to_file )
175
176
raise Exception (
176
177
f'[{ user_telegram_id } ] - old_json["last_id"] > last_news_id["last_id"]'
177
178
)
Original file line number Diff line number Diff line change
1
+ aiofiles==0.8.0
2
+ aiogram==2.19
3
+ aioschedule==0.5.2
4
+ alembic==1.8.0
5
+ beautifulsoup4==4.10.0
6
+ Mako==1.2.0
7
+ mypy==0.960
8
+ Pillow==9.1.0
9
+ pylint-runner==0.6.0
10
+ pylint==2.14.1
11
+ python-dotenv==0.20.0
12
+ qrcode==7.3.1
13
+ requests==2.27.1
14
+ SQLAlchemy==1.4.37
15
+ types-aiofiles==0.8.8
Original file line number Diff line number Diff line change
1
+ #
2
+ # This file is autogenerated by pip-compile with Python 3.10
3
+ # by the following command:
4
+ #
5
+ # pip-compile
6
+ #
1
7
aiofiles == 0.8.0
8
+ # via -r requirements.in
2
9
aiogram == 2.19
3
- aiohttp == 3.8.1
10
+ # via -r requirements.in
11
+ aiohttp == 3.8.6
12
+ # via aiogram
4
13
aioschedule == 0.5.2
5
- aiosignal == 1.2.0
14
+ # via -r requirements.in
15
+ aiosignal == 1.3.2
16
+ # via aiohttp
6
17
alembic == 1.8.0
7
- anyio == 3.5.0
8
- astroid == 2.11.5
9
- async-generator == 1.10
10
- async-timeout == 4.0.2
11
- attrs == 21.4.0
12
- Babel == 2.9.1
18
+ # via -r requirements.in
19
+ astroid == 2.11.7
20
+ # via pylint
21
+ async-timeout == 4.0.3
22
+ # via aiohttp
23
+ attrs == 24.3.0
24
+ # via aiohttp
25
+ babel == 2.9.1
26
+ # via aiogram
13
27
beautifulsoup4 == 4.10.0
14
- certifi == 2021.10.8
15
- cffi == 1.15.0
28
+ # via -r requirements.in
29
+ certifi == 2024.12.14
30
+ # via
31
+ # aiogram
32
+ # requests
16
33
charset-normalizer == 2.0.12
17
- colorama == 0.4.4
18
- cryptography == 36.0.1
19
- dill == 0.3.5.1
20
- frozenlist == 1.3.0
21
- greenlet == 1.1.2
22
- h11 == 0.12.0
23
- html2image == 2.0.1
24
- httpcore == 0.14.7
25
- httpx == 0.22.0
26
- idna == 3.3
27
- imgkit == 1.2.2
28
- importlib-metadata == 4.11.4
29
- importlib-resources == 5.7.1
30
- install == 1.3.5
31
- isort == 5.10.1
32
- lazy-object-proxy == 1.7.1
33
- Mako == 1.2.0
34
- MarkupSafe == 2.1.1
34
+ # via
35
+ # aiohttp
36
+ # requests
37
+ colorama == 0.4.6
38
+ # via
39
+ # pylint
40
+ # pylint-runner
41
+ # qrcode
42
+ dill == 0.3.9
43
+ # via pylint
44
+ frozenlist == 1.5.0
45
+ # via
46
+ # aiohttp
47
+ # aiosignal
48
+ greenlet == 3.1.1
49
+ # via sqlalchemy
50
+ idna == 3.10
51
+ # via
52
+ # requests
53
+ # yarl
54
+ isort == 5.13.2
55
+ # via pylint
56
+ lazy-object-proxy == 1.10.0
57
+ # via astroid
58
+ mako == 1.2.0
59
+ # via
60
+ # -r requirements.in
61
+ # alembic
62
+ markupsafe == 3.0.2
63
+ # via mako
35
64
mccabe == 0.7.0
36
- multidict == 6.0.2
65
+ # via pylint
66
+ multidict == 6.1.0
67
+ # via
68
+ # aiohttp
69
+ # yarl
37
70
mypy == 0.960
38
- mypy-extensions == 0.4.3
39
- outcome == 1.1.0
40
- Pillow == 9.1.0
41
- platformdirs == 2.5.2
42
- pycparser == 2.21
71
+ # via -r requirements.in
72
+ mypy-extensions == 1.0.0
73
+ # via mypy
74
+ pillow == 9.1.0
75
+ # via -r requirements.in
76
+ platformdirs == 4.3.6
77
+ # via pylint
78
+ propcache == 0.2.1
79
+ # via yarl
43
80
pylint == 2.14.1
81
+ # via
82
+ # -r requirements.in
83
+ # pylint-runner
44
84
pylint-runner == 0.6.0
45
- pyOpenSSL == 22.0.0
46
- PySocks == 1.7.1
85
+ # via -r requirements.in
47
86
python-dotenv == 0.20.0
48
- pytz == 2021.3
87
+ # via -r requirements.in
88
+ pytz == 2024.2
89
+ # via babel
49
90
qrcode == 7.3.1
91
+ # via -r requirements.in
50
92
requests == 2.27.1
51
- rfc3986 == 1.5.0
52
- six == 1.16.0
53
- sniffio == 1.2.0
54
- sortedcontainers == 2.4.0
55
- soupsieve == 2.3.1
56
- SQLAlchemy == 1.4.37
57
- tomli == 2.0.1
58
- tomlkit == 0.11.0
59
- trio == 0.20.0
60
- trio-websocket == 0.9.2
93
+ # via -r requirements.in
94
+ soupsieve == 2.6
95
+ # via beautifulsoup4
96
+ sqlalchemy == 1.4.37
97
+ # via
98
+ # -r requirements.in
99
+ # alembic
100
+ tomli == 2.2.1
101
+ # via
102
+ # mypy
103
+ # pylint
104
+ tomlkit == 0.13.2
105
+ # via pylint
61
106
types-aiofiles == 0.8.8
62
- typing_extensions == 4.2.0
63
- urllib3 == 1.26.8
64
- wrapt == 1.14.1
65
- wsproto == 1.1.0
66
- yarl == 1.7.2
67
- zipp == 3.8.0
107
+ # via -r requirements.in
108
+ typing-extensions == 4.12.2
109
+ # via
110
+ # multidict
111
+ # mypy
112
+ urllib3 == 1.26.20
113
+ # via requests
114
+ wrapt == 1.17.2
115
+ # via astroid
116
+ yarl == 1.18.3
117
+ # via aiohttp
118
+
119
+ # The following packages are considered to be unsafe in a requirements file:
120
+ # setuptools
You can’t perform that action at this time.
0 commit comments