Spaces:
Running
Running
BinaryONe
commited on
Commit
·
201eb7b
1
Parent(s):
458bb26
Callback Update
Browse files
FileStream/TMDB/__init__.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import re
|
2 |
from tmdbv3api import TMDb, Search, Movie,TV
|
3 |
from FileStream.config import TMDB
|
|
|
4 |
|
5 |
# Initialize the TMDb API
|
6 |
tmdb = TMDb()
|
|
|
1 |
import re
|
2 |
from tmdbv3api import TMDb, Search, Movie,TV
|
3 |
from FileStream.config import TMDB
|
4 |
+
from .Endpoint import search_tmdb_any, search_tmdb_tv, search_tmdb_movies
|
5 |
|
6 |
# Initialize the TMDb API
|
7 |
tmdb = TMDb()
|
FileStream/bot/plugins/FileHandlers/callback.py
CHANGED
@@ -117,11 +117,11 @@ async def cb_data(bot: Client, update: CallbackQuery):
|
|
117 |
parse_mode=ParseMode.HTML,
|
118 |
disable_web_page_preview=True,
|
119 |
reply_markup=InlineKeyboardMarkup([
|
120 |
-
[InlineKeyboardButton("Movie", callback_data=f"{'privup' if upload_type =='PRIVATE' else 'pubup'}_{user_id}_{message_id}
|
121 |
-
[InlineKeyboardButton("WebSeries", callback_data=f"{'privup' if upload_type =='PRIVATE' else 'pubup'}_{user_id}_{message_id}
|
122 |
-
[InlineKeyboardButton("Anime", callback_data=f"{'privup' if upload_type =='PRIVATE' else 'pubup'}_{user_id}_{message_id}
|
123 |
-
[InlineKeyboardButton("Documentary", callback_data=f"{'privup' if upload_type =='PRIVATE' else 'pubup'}_{user_id}_{message_id}
|
124 |
-
[InlineKeyboardButton("Regular", callback_data=f"{'privup' if upload_type =='PRIVATE' else 'pubup'}_{user_id}_{message_id}
|
125 |
[ InlineKeyboardButton("ᴄʟᴏsᴇ", callback_data="close")]
|
126 |
]),
|
127 |
)
|
@@ -158,6 +158,24 @@ async def cb_data(bot: Client, update: CallbackQuery):
|
|
158 |
}
|
159 |
file_caption = getattr(message, "caption", f"{get_name(message)}" ) or "None/Unknown"
|
160 |
file_name = get_name(message)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
161 |
print("Detail",file_caption,"\nFile:",file_name,"\n Message Detail",message)
|
162 |
file_info = get_file_info(message, instruction)
|
163 |
# Here we are Adding the File Into the database First
|
|
|
117 |
parse_mode=ParseMode.HTML,
|
118 |
disable_web_page_preview=True,
|
119 |
reply_markup=InlineKeyboardMarkup([
|
120 |
+
[InlineKeyboardButton("Movie", callback_data=f"{'privup' if upload_type =='PRIVATE' else 'pubup'}_{user_id}_{message_id}_MOVIE")],
|
121 |
+
[InlineKeyboardButton("WebSeries", callback_data=f"{'privup' if upload_type =='PRIVATE' else 'pubup'}_{user_id}_{message_id}_WEBSERIES")],
|
122 |
+
[InlineKeyboardButton("Anime", callback_data=f"{'privup' if upload_type =='PRIVATE' else 'pubup'}_{user_id}_{message_id}_ANIME")],
|
123 |
+
[InlineKeyboardButton("Documentary", callback_data=f"{'privup' if upload_type =='PRIVATE' else 'pubup'}_{user_id}_{message_id}_DOCUMENTARY")],
|
124 |
+
[InlineKeyboardButton("Regular", callback_data=f"{'privup' if upload_type =='PRIVATE' else 'pubup'}_{user_id}_{message_id}_REGULAR")],
|
125 |
[ InlineKeyboardButton("ᴄʟᴏsᴇ", callback_data="close")]
|
126 |
]),
|
127 |
)
|
|
|
158 |
}
|
159 |
file_caption = getattr(message, "caption", f"{get_name(message)}" ) or "None/Unknown"
|
160 |
file_name = get_name(message)
|
161 |
+
name = file_caption if file_caption != "None/Unknown" else file_name
|
162 |
+
|
163 |
+
from FileStream.TMDB import search_tmdb_any, search_tmdb_tv, search_tmdb_movies
|
164 |
+
if msg_type == 'MOVIE':
|
165 |
+
|
166 |
+
print(search_tmdb_movies(name))
|
167 |
+
elif msg_type == "WEBSERIES":
|
168 |
+
print(search_tmdb_any(name))
|
169 |
+
elif msg_type == "ANIME":
|
170 |
+
print(search_tmdb_any(name))
|
171 |
+
elif msg_type == "DOCUMENTARY":
|
172 |
+
print("bike is Yamaha")
|
173 |
+
elif msg_type == "REGULAR":
|
174 |
+
print("bike is Yamaha")
|
175 |
+
else:
|
176 |
+
print("Please choose correct answer")
|
177 |
+
|
178 |
+
file_info = get_file_info(message, instruction)
|
179 |
print("Detail",file_caption,"\nFile:",file_name,"\n Message Detail",message)
|
180 |
file_info = get_file_info(message, instruction)
|
181 |
# Here we are Adding the File Into the database First
|