Skip to content

Commit 3e45088

Browse files
author
Foxlet
committed
youtube.py - URL fixes for v3
1 parent 289c456 commit 3e45088

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

plugins/youtube.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
base_url = 'https://www.googleapis.com/youtube/v3/'
1616
api_url = base_url + 'videos?part=contentDetails%2C+snippet%2C+statistics&id={}&key={}'
17-
search_api_url = base_url + 'search?part=id&q={}&maxResults=1&key={}'
17+
search_api_url = base_url + 'search?part=id&maxResults=1'
1818
video_url = "http://youtu.be/%s"
1919

2020

@@ -85,9 +85,9 @@ def youtube(text):
8585
if json['pageInfo']['totalResults'] == 0:
8686
return 'no results found'
8787

88-
video_id = json['items'][0]['id']
88+
video_id = json['items'][0]['id']['videoId']
8989

90-
return get_video_description(video_id) + " - " + video_url % video_id
90+
return get_video_description(video_id, dev_key) + " - " + video_url % video_id
9191

9292

9393
@hook.command("youtime", "ytime")

0 commit comments

Comments
 (0)