You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The purpose of this action is the same - to prepare a description message for a sending video, but code implementations are different and placed in 2 separate files.
Proposal
I don't think this should be implemented ASAP, but we should think about it.
A proper way to implement such complex applications is to divide the code into layers or even into (micro)services like:
Input layer. Receives links from users, checks the user rights, and puts the link info into a message queue like RabbitMQ;
Prepare layer. Gathers video information and sends it to premium or non-premium message queue;
Premium process layer and non-premium process layer. Download video and send a task to "send queue";
Send layer. Prepares and sends messages to telegram-users.
This architecture allows us to divide the application complexity and send the same message regardless of whether it's premium-download or not :)
The text was updated successfully, but these errors were encountered:
Current application architecture problems
There are a lot of points in the code which do almost the same but in a different way.
For example, here is how non-premium message is composed:
ytdlbot/ytdlbot/tasks.py
Line 641 in 324b18d
And here is how premium message is composed:
ytdlbot/ytdlbot/premium.py
Line 71 in 324b18d
The purpose of this action is the same - to prepare a description message for a sending video, but code implementations are different and placed in 2 separate files.
Proposal
I don't think this should be implemented ASAP, but we should think about it.
A proper way to implement such complex applications is to divide the code into layers or even into (micro)services like:
This architecture allows us to divide the application complexity and send the same message regardless of whether it's premium-download or not :)
The text was updated successfully, but these errors were encountered: