privateone commited on
Commit
3960e89
·
verified ·
1 Parent(s): 114cb60

Update FileStream/bot/plugins/FileHandlers/callback.py

Browse files
FileStream/bot/plugins/FileHandlers/callback.py CHANGED
@@ -130,10 +130,10 @@ async def cb_data(bot: Client, update: CallbackQuery):
130
  #print("TMDB",search_tmdb_any(title, year))
131
  #print(f"IMDB ID :{get_imdb_id['results'][0]['id']}")
132
  print(f"\n** GET_ID :")
133
- pprint(get_imdb_id)
134
  res=json.loads(imdb.get_by_id(get_imdb_id['results'][0]['id']))
135
  print(f"\n** IMDB Response :")
136
- pprint(res)
137
  instruction = {
138
  "privacy_type": "PUBLIC",
139
  "user_id": user_id,
@@ -194,11 +194,13 @@ async def cb_data(bot: Client, update: CallbackQuery):
194
  print(f"\n** GET_ID {get_imdb_id}")
195
  res=json.loads(imdb.get_by_id(get_imdb_id['results'][0]['id']))
196
  print(f"\n** IMDB Response :{res}")
 
 
197
  instruction = {
198
  "privacy_type": "TEMPORARY",
199
  "user_id": user_id,
200
  "user_type": "TELEGRAM",
201
- "IMDB_id":get_imdb_id['results'][0]['id'] if get_imdb_id['results'][0]['id']else "None",
202
  "poster": res.get("poster", "") ,
203
  "title": res.get("name", "") ,
204
  "release_date":res.get("datePublished", ""),
@@ -207,7 +209,7 @@ async def cb_data(bot: Client, update: CallbackQuery):
207
  "keywords":res["keywords"].split(",") if res.get("keywords") else [],
208
  "genre": res.get("genre", []) ,
209
  }
210
-
211
  file_info = get_file_info(message, instruction)
212
  # Here we are Adding the File Into the database First
213
  inserted_id = await db.add_temp_file(file_info)
 
130
  #print("TMDB",search_tmdb_any(title, year))
131
  #print(f"IMDB ID :{get_imdb_id['results'][0]['id']}")
132
  print(f"\n** GET_ID :")
133
+ #pprint(get_imdb_id)
134
  res=json.loads(imdb.get_by_id(get_imdb_id['results'][0]['id']))
135
  print(f"\n** IMDB Response :")
136
+ #pprint(res)
137
  instruction = {
138
  "privacy_type": "PUBLIC",
139
  "user_id": user_id,
 
194
  print(f"\n** GET_ID {get_imdb_id}")
195
  res=json.loads(imdb.get_by_id(get_imdb_id['results'][0]['id']))
196
  print(f"\n** IMDB Response :{res}")
197
+ #"IMDB_id":get_imdb_id['results'][0]['id'] if get_imdb_id['results'][0]['id']else "None",
198
+
199
  instruction = {
200
  "privacy_type": "TEMPORARY",
201
  "user_id": user_id,
202
  "user_type": "TELEGRAM",
203
+ "IMDB_id":get_imdb_id['results'][0]['id'] if get_imdb_id.get("results")[0]['id'] else "None",
204
  "poster": res.get("poster", "") ,
205
  "title": res.get("name", "") ,
206
  "release_date":res.get("datePublished", ""),
 
209
  "keywords":res["keywords"].split(",") if res.get("keywords") else [],
210
  "genre": res.get("genre", []) ,
211
  }
212
+ print("Line No 212 ")
213
  file_info = get_file_info(message, instruction)
214
  # Here we are Adding the File Into the database First
215
  inserted_id = await db.add_temp_file(file_info)