mirror of
https://github.com/Arrowar/StreamingCommunity.git
synced 2025-06-05 02:55:25 +00:00
api: Fix error parsing sc site
This commit is contained in:
parent
060a96e657
commit
89deb6c283
@ -64,8 +64,15 @@ def title_search(title_search: str) -> int:
|
||||
# Prepara le scelte per l'utente
|
||||
if site_constant.TELEGRAM_BOT:
|
||||
choices = []
|
||||
|
||||
for i, dict_title in enumerate(response.json()['data']):
|
||||
|
||||
# Collect json data
|
||||
try:
|
||||
data = response.json().get('data', [])
|
||||
except Exception as e:
|
||||
console.log(f"Error parsing JSON response: {e}")
|
||||
return 0
|
||||
|
||||
for i, dict_title in enumerate(data):
|
||||
try:
|
||||
media_search_manager.add_media({
|
||||
'id': dict_title.get('id'),
|
||||
|
Loading…
x
Reference in New Issue
Block a user