diff --git a/App/.idea/modules.xml b/App/.idea/modules.xml
index cc95f4e..77dad0e 100644
--- a/App/.idea/modules.xml
+++ b/App/.idea/modules.xml
@@ -2,7 +2,7 @@
-
+
\ No newline at end of file
diff --git a/App/.idea/sqlDataSources.xml b/App/.idea/sqlDataSources.xml
index b125209..61ffe1d 100644
--- a/App/.idea/sqlDataSources.xml
+++ b/App/.idea/sqlDataSources.xml
@@ -8,7 +8,7 @@
-
+
diff --git a/App/messages/es_ES.json b/App/messages/es_ES.json
deleted file mode 100644
index d402d04..0000000
--- a/App/messages/es_ES.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "welcome": [
- {
- "msg": "Hola, bienvenido {} 😄\nUsa el comando /help para *obtener más ayuda* o empieza a *usar el bot* ya mismo 🎶\n\nSi quieres estar al tanto de las _últimas noticias_ sobre el bot, échale un vistazo al canal oficial: @ytMDBot"
- }
- ],
- "help": [
- {
- "msg": "Para descargar una canción puedes:\n â– *Buscar* 🔎 la canción por _tÃtulo y artista_, enviándoselo directamente al bot\n â– *Enviar* directamente la _URL_ 🔗 del vÃdeo\n â– Seleccionar una *canción ya descargada* desde el historial 🕒\n\n",
- "more_help": "Para más ayuda, navega con los botones que aparecen debajo",
- "d_via_tt-at": "*Descarga*[ ]({})canciones enviando directamente el _tÃtulo_ 🎤 y _artista_ 🗣 de la canción al bot",
- "d_via_url": "Comienza[ ]({})directamente *con la descarga* enviando la URL del vÃdeo de YouTube\n\nPuedes usar un bot _inline_ como @vid para agilizar este proceso",
- "d_via_history": "Accede[ ]({})a tu *historial* mediante el comando /history, desde donde podrás _seleccionar directamente_ la canción que quieras descargar"
- }
- ]
-}
\ No newline at end of file
diff --git a/App/.idea/deployment.xml b/youtube_md_bot/.idea/deployment.xml
similarity index 100%
rename from App/.idea/deployment.xml
rename to youtube_md_bot/.idea/deployment.xml
diff --git a/App/.idea/inspectionProfiles/Project_Default.xml b/youtube_md_bot/.idea/inspectionProfiles/Project_Default.xml
similarity index 100%
rename from App/.idea/inspectionProfiles/Project_Default.xml
rename to youtube_md_bot/.idea/inspectionProfiles/Project_Default.xml
diff --git a/App/.idea/misc.xml b/youtube_md_bot/.idea/misc.xml
similarity index 100%
rename from App/.idea/misc.xml
rename to youtube_md_bot/.idea/misc.xml
diff --git a/youtube_md_bot/.idea/modules.xml b/youtube_md_bot/.idea/modules.xml
new file mode 100644
index 0000000..cc95f4e
--- /dev/null
+++ b/youtube_md_bot/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/youtube_md_bot/.idea/sqlDataSources.xml b/youtube_md_bot/.idea/sqlDataSources.xml
new file mode 100644
index 0000000..b125209
--- /dev/null
+++ b/youtube_md_bot/.idea/sqlDataSources.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/App/.idea/vcs.xml b/youtube_md_bot/.idea/vcs.xml
similarity index 100%
rename from App/.idea/vcs.xml
rename to youtube_md_bot/.idea/vcs.xml
diff --git a/App/.idea/workspace.xml b/youtube_md_bot/.idea/workspace.xml
similarity index 90%
rename from App/.idea/workspace.xml
rename to youtube_md_bot/.idea/workspace.xml
index 67844d2..39a1312 100644
--- a/App/.idea/workspace.xml
+++ b/youtube_md_bot/.idea/workspace.xml
@@ -2,9 +2,11 @@
-
+
+
+
@@ -84,24 +86,29 @@
-
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
+
+
@@ -151,26 +158,11 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
+
+
@@ -187,15 +179,6 @@
-
-
-
-
-
-
-
-
-
@@ -221,7 +204,6 @@
-
@@ -236,8 +218,11 @@
-
+
+
+
+
@@ -263,6 +248,7 @@
+
@@ -289,7 +275,6 @@
-
@@ -315,7 +300,7 @@
-
+
@@ -420,7 +405,14 @@
1530120152704
-
+
+ 1530200290328
+
+
+
+ 1530200290328
+
+
@@ -438,6 +430,7 @@
+
@@ -448,7 +441,6 @@
-
@@ -467,7 +459,8 @@
-
+
+
@@ -475,24 +468,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -569,10 +544,6 @@
-
-
-
-
@@ -618,10 +589,6 @@
-
-
-
-
@@ -653,10 +620,6 @@
-
-
-
-
@@ -779,13 +742,6 @@
-
-
-
-
-
-
-
@@ -827,20 +783,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -881,21 +823,48 @@
-
+
-
-
-
-
-
-
+
+
-
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/App/.idea/App.iml b/youtube_md_bot/.idea/youtube_md_bot.iml
similarity index 100%
rename from App/.idea/App.iml
rename to youtube_md_bot/.idea/youtube_md_bot.iml
diff --git a/App/application.py b/youtube_md_bot/__init__.py
similarity index 91%
rename from App/application.py
rename to youtube_md_bot/__init__.py
index a27705e..9a78c07 100644
--- a/App/application.py
+++ b/youtube_md_bot/__init__.py
@@ -6,6 +6,7 @@
from out import cPrint, Colors
from upgrader import PiPUpgrader
from database import DatabaseOperationsBase
+from utils import Constants, logger
from handlers.StartHandler import StartHandler
from handlers.HelpHandler import HelpHandler
from handlers.DeveloperHandler import DeveloperHandler
@@ -21,7 +22,7 @@ def handler_definer():
from telegram.ext import CommandHandler, MessageHandler, Filters
handlers = []
- with open("messages/es_ES.json", 'r') as messages_file:
+ with open(Constants.A_APP_MESSAGES, 'r') as messages_file:
messages: dict = messages_file.read()
start = StartHandler(messages["welcome"])
help_handler = HelpHandler(messages["help"])
@@ -30,6 +31,7 @@ def handler_definer():
url = URLHandler(messages["url_messages"])
text = TextHandler(messages["text"])
unexpected = UnexpectedHandler(messages["unexpected"])
+
handlers.append(CommandHandler("start", start.start))
handlers.append(CommandHandler("help", help_handler.help))
handlers.append(CommandHandler("develop", dev.develop))
@@ -61,9 +63,10 @@ def main(arguments: Namespace):
database_password = arguments.db_password
must_show_version = arguments.version
if must_show_version:
- print("Version")
+ cPrint("Version: " + Constants.A_APP_VERSION + "-" + Constants.A_APP_TAG_R +
+ " (" + Constants.A_APP_TAG + ")", Colors.BOLD)
exit(0)
- if not path.exists("app_data.dict"):
+ if not path.exists(Constants.A_APP_DATA_FILE):
if not token:
raise ValueError("You must add token at least the first time you execute this app")
elif not youtube_api_key:
@@ -77,7 +80,7 @@ def main(arguments: Namespace):
if not database_password:
alphabet = string.ascii_letters + string.digits
database_password = ''.join(secrets.choice(alphabet) for i in range(32))
- with open("app_data.dict", "wb") as app_data_file:
+ with open(Constants.A_APP_DATA_FILE, "wb") as app_data_file:
app_data = {"TOKEN": token,
"YT_API": youtube_api_key,
"CREATOR_ID": creator_id,
@@ -89,11 +92,11 @@ def main(arguments: Namespace):
cPrint("Initializing bot...", Colors.GREEN)
cPrint("Looking for packages updates...", Colors.GREEN)
- upgrader = PiPUpgrader("requirements.txt")
+ upgrader = PiPUpgrader(Constants.A_APP_REQ_FILE)
upgrader.upgradePackages()
cPrint("Obtaining values...", Colors.GREEN)
- with open("app_data.dict", "rb") as app_data_file:
+ with open(Constants.A_APP_DATA_FILE, "rb") as app_data_file:
app_data = pickle.load(app_data_file)
cPrint("Starting database system...", Colors.GREEN)
diff --git a/App/database/__init__.py b/youtube_md_bot/database/__init__.py
similarity index 100%
rename from App/database/__init__.py
rename to youtube_md_bot/database/__init__.py
diff --git a/App/db_script_pycharm.ddl b/youtube_md_bot/db_script_pycharm.ddl
similarity index 100%
rename from App/db_script_pycharm.ddl
rename to youtube_md_bot/db_script_pycharm.ddl
diff --git a/App/handlers/DeveloperHandler.py b/youtube_md_bot/handlers/DeveloperHandler.py
similarity index 100%
rename from App/handlers/DeveloperHandler.py
rename to youtube_md_bot/handlers/DeveloperHandler.py
diff --git a/App/handlers/HelpHandler.py b/youtube_md_bot/handlers/HelpHandler.py
similarity index 100%
rename from App/handlers/HelpHandler.py
rename to youtube_md_bot/handlers/HelpHandler.py
diff --git a/App/handlers/StartHandler.py b/youtube_md_bot/handlers/StartHandler.py
similarity index 100%
rename from App/handlers/StartHandler.py
rename to youtube_md_bot/handlers/StartHandler.py
diff --git a/App/handlers/TextHandler.py b/youtube_md_bot/handlers/TextHandler.py
similarity index 100%
rename from App/handlers/TextHandler.py
rename to youtube_md_bot/handlers/TextHandler.py
diff --git a/App/handlers/URLHandler.py b/youtube_md_bot/handlers/URLHandler.py
similarity index 100%
rename from App/handlers/URLHandler.py
rename to youtube_md_bot/handlers/URLHandler.py
diff --git a/App/handlers/UnexpectedHandler.py b/youtube_md_bot/handlers/UnexpectedHandler.py
similarity index 100%
rename from App/handlers/UnexpectedHandler.py
rename to youtube_md_bot/handlers/UnexpectedHandler.py
diff --git a/App/handlers/VideoIDHandler.py b/youtube_md_bot/handlers/VideoIDHandler.py
similarity index 100%
rename from App/handlers/VideoIDHandler.py
rename to youtube_md_bot/handlers/VideoIDHandler.py
diff --git a/App/handlers/__init__.py b/youtube_md_bot/handlers/__init__.py
similarity index 100%
rename from App/handlers/__init__.py
rename to youtube_md_bot/handlers/__init__.py
diff --git a/youtube_md_bot/messages/messages.json b/youtube_md_bot/messages/messages.json
new file mode 100644
index 0000000..d31cd04
--- /dev/null
+++ b/youtube_md_bot/messages/messages.json
@@ -0,0 +1,25 @@
+{
+ "es_ES": [
+ {
+ "welcome": [
+ {
+ "msg": "Hola, bienvenido {} 😄\nUsa el comando /help para *obtener más ayuda* o empieza a *usar el bot* ya mismo 🎶\n\nSi quieres estar al tanto de las _últimas noticias_ sobre el bot, échale un vistazo al canal oficial: @ytMDBot"
+ }
+ ],
+ "help": [
+ {
+ "msg": "Para descargar una canción puedes:\n â– *Buscar* 🔎 la canción por _tÃtulo y artista_, enviándoselo directamente al bot\n â– *Enviar* directamente la _URL_ 🔗 del vÃdeo\n â– Seleccionar una *canción ya descargada* desde el historial 🕒\n\n",
+ "more_help": "Para más ayuda, navega con los botones que aparecen debajo",
+ "d_via_tt-at": "*Descarga*[ ]({})canciones enviando directamente el _tÃtulo_ 🎤 y _artista_ 🗣 de la canción al bot",
+ "d_via_url": "Comienza[ ]({})directamente *con la descarga* enviando la URL del vÃdeo de YouTube\n\nPuedes usar un bot _inline_ como @vid para agilizar este proceso",
+ "d_via_history": "Accede[ ]({})a tu *historial* mediante el comando /history, desde donde podrás _seleccionar directamente_ la canción que quieras descargar"
+ }
+ ]
+ }
+ ],
+ "en_US": [
+ {
+
+ }
+ ]
+}
\ No newline at end of file
diff --git a/App/out/__init__.py b/youtube_md_bot/out/__init__.py
similarity index 100%
rename from App/out/__init__.py
rename to youtube_md_bot/out/__init__.py
diff --git a/App/requirements.txt b/youtube_md_bot/requirements.txt
similarity index 100%
rename from App/requirements.txt
rename to youtube_md_bot/requirements.txt
diff --git a/App/upgrader/__init__.py b/youtube_md_bot/upgrader/__init__.py
similarity index 100%
rename from App/upgrader/__init__.py
rename to youtube_md_bot/upgrader/__init__.py
diff --git a/App/utils/__init__.py b/youtube_md_bot/utils/__init__.py
similarity index 50%
rename from App/utils/__init__.py
rename to youtube_md_bot/utils/__init__.py
index 55f0bad..23b4021 100644
--- a/App/utils/__init__.py
+++ b/youtube_md_bot/utils/__init__.py
@@ -5,3 +5,10 @@ class Constants:
D_USER_DICT = {"state": 0,
"is_downloading_video": False,
"pending_videos": 0}
+
+ A_APP_VERSION = "0.2"
+ A_APP_TAG = "development"
+ A_APP_TAG_R = "d"
+ A_APP_DATA_FILE = "app_data.dict"
+ A_APP_REQ_FILE = "requirements.txt"
+ A_APP_MESSAGES = "messages/messages.json"
diff --git a/App/utils/logger.py b/youtube_md_bot/utils/logger.py
similarity index 100%
rename from App/utils/logger.py
rename to youtube_md_bot/utils/logger.py