Add entertainment category and fix incorrect variable name.
Signed-off-by: Abdulkadir Furkan Şanlı <me@abdulocra.cy>
This commit is contained in:
parent
734362014c
commit
ad13e5d69f
8
main.py
8
main.py
@ -177,7 +177,10 @@ def is_music(youtube, video_id):
|
|||||||
video_details = youtube.videos().list(id=video_id, part="snippet").execute()
|
video_details = youtube.videos().list(id=video_id, part="snippet").execute()
|
||||||
|
|
||||||
# Check if the video category is Music (typically category ID 10)
|
# Check if the video category is Music (typically category ID 10)
|
||||||
return video_details["items"][0]["snippet"]["categoryId"] == "10"
|
return video_details["items"][0]["snippet"]["categoryId"] in (
|
||||||
|
"10",
|
||||||
|
"24",
|
||||||
|
) # music, entertainment
|
||||||
|
|
||||||
|
|
||||||
async def message_callback(client, room, event):
|
async def message_callback(client, room, event):
|
||||||
@ -227,8 +230,7 @@ async def message_callback(client, room, event):
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
print(f"Failed to upload image. Failure response: {resp}")
|
print(f"Failed to upload image. Failure response: {response}")
|
||||||
|
|
||||||
|
|
||||||
if body == "!pow" and current_time - timestamp_sec < datetime.timedelta(
|
if body == "!pow" and current_time - timestamp_sec < datetime.timedelta(
|
||||||
seconds=30
|
seconds=30
|
||||||
|
Loading…
Reference in New Issue
Block a user