BinaryONe commited on
Commit
a9bff04
·
1 Parent(s): 8b528a3

Callback Update

Browse files
FileStream/bot/plugins/FileHandlers/callback.py CHANGED
@@ -159,10 +159,11 @@ async def cb_data(bot: Client, update: CallbackQuery):
159
  #name = file_caption if (file_caption) != "None/Unknown" else file_name
160
  from FileStream.Tools.cleanup import Get_Title_Year
161
  title, year = Get_Title_Year(name)
162
- print(f"ANY \n {title}\n {year} Resp :",search_tmdb_any(title, year))
 
 
163
  if msg_type == 'MOVIE':
164
  resp=search_tmdb_movies(name)
165
- res = imdb.search(title, year=year)
166
  print("TMDB Movie Response:",resp,"\n IMDB",res)
167
  result={
168
  'title': resp['title'],
@@ -185,13 +186,13 @@ async def cb_data(bot: Client, update: CallbackQuery):
185
  "privacy_type": "PUBLIC",
186
  "user_id": user_id,
187
  "user_type": "TELEGRAM",
 
188
  "TMDB_id": result['id'],
189
  "title": result['title'],
190
  "type": result['media_type'],
191
  "subtype":"Unknown",
192
  "quality":"Unknown",
193
  }
194
-
195
  file_info = get_file_info(message, instruction)
196
  # Here we are Adding the File Into the database First
197
  inserted_id = await db.add_file(file_info)
@@ -227,20 +228,17 @@ async def cb_data(bot: Client, update: CallbackQuery):
227
  message_id = int(usr_cmd[2])
228
  message = await FileStream.get_messages(user_id, message_id)
229
  instruction = {
230
-
231
- "privacy_type": "PRIVATE",
232
- "user_id": user_id,
233
- "user_type": "TELEGRAM"
234
  }
235
  file_info = get_file_info(message, instruction)
236
  # Here we are Adding the File Into the database First
237
  db_id = await db.add_file(file_info)
238
  await get_file_ids(False, db_id, message)
239
-
240
  if True:
241
  file_info = await db.get_file(db_id)
242
  reply_markup, stream_text = await priv_func(file_info['file']['file_name'], file_info['file']['file_size'])
243
-
244
  await update.message.edit_text(
245
  text=stream_text,
246
  parse_mode=ParseMode.HTML,
 
159
  #name = file_caption if (file_caption) != "None/Unknown" else file_name
160
  from FileStream.Tools.cleanup import Get_Title_Year
161
  title, year = Get_Title_Year(name)
162
+ print(f"ANY SEARCH :{title} YEAR :{year} Resp : {search_tmdb_any(title, year)}")
163
+ res = imdb.search(title, year=year)[0]
164
+ print(f"IMDB Response :{imdb.get_by_id(res['id'])}")
165
  if msg_type == 'MOVIE':
166
  resp=search_tmdb_movies(name)
 
167
  print("TMDB Movie Response:",resp,"\n IMDB",res)
168
  result={
169
  'title': resp['title'],
 
186
  "privacy_type": "PUBLIC",
187
  "user_id": user_id,
188
  "user_type": "TELEGRAM",
189
+ "IMDB_id": res['id'],
190
  "TMDB_id": result['id'],
191
  "title": result['title'],
192
  "type": result['media_type'],
193
  "subtype":"Unknown",
194
  "quality":"Unknown",
195
  }
 
196
  file_info = get_file_info(message, instruction)
197
  # Here we are Adding the File Into the database First
198
  inserted_id = await db.add_file(file_info)
 
228
  message_id = int(usr_cmd[2])
229
  message = await FileStream.get_messages(user_id, message_id)
230
  instruction = {
231
+ "privacy_type": "PRIVATE",
232
+ "user_id": user_id,
233
+ "user_type": "TELEGRAM"
 
234
  }
235
  file_info = get_file_info(message, instruction)
236
  # Here we are Adding the File Into the database First
237
  db_id = await db.add_file(file_info)
238
  await get_file_ids(False, db_id, message)
 
239
  if True:
240
  file_info = await db.get_file(db_id)
241
  reply_markup, stream_text = await priv_func(file_info['file']['file_name'], file_info['file']['file_size'])
 
242
  await update.message.edit_text(
243
  text=stream_text,
244
  parse_mode=ParseMode.HTML,
FileStream/bot/plugins/FileHandlers/stream.py CHANGED
@@ -61,6 +61,7 @@ async def private_receive_handler(bot: Client, message: Message):
61
  "privacy_type":"PUBLIC",
62
  "user_id":message.from_user.id if (message.chat.type == ChatType.PRIVATE) else message.chat.id,
63
  "user_type": "TELEGRAM",
 
64
  "TMDB_id": "Unknown",
65
  "title":"Unknown",
66
  "type": "Unknown",
 
61
  "privacy_type":"PUBLIC",
62
  "user_id":message.from_user.id if (message.chat.type == ChatType.PRIVATE) else message.chat.id,
63
  "user_type": "TELEGRAM",
64
+ "IMDB_id": "Unknown",
65
  "TMDB_id": "Unknown",
66
  "title":"Unknown",
67
  "type": "Unknown",
FileStream/utils/FileProcessors/file_properties.py CHANGED
@@ -191,6 +191,7 @@ def get_file_info(message, instruction):
191
  "user_id": instruction['user_id'],
192
  "user_type": instruction['user_type'],
193
  "message_id": message.id,
 
194
  "TMDB_id": instruction['TMDB_id'],
195
  "title": instruction['title'],
196
  "type": instruction['type'],
 
191
  "user_id": instruction['user_id'],
192
  "user_type": instruction['user_type'],
193
  "message_id": message.id,
194
+ "IMDB_id": instruction['IMDB_id'],
195
  "TMDB_id": instruction['TMDB_id'],
196
  "title": instruction['title'],
197
  "type": instruction['type'],