Skip to content

Commit 1a4c52b

Browse files
committed
Merge pull request #159 from edwardslabs/yt_search
youtube search fails to find a video if a channel is the first result…
2 parents ec41d16 + 5bb955d commit 1a4c52b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

plugins/youtube.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def youtube(text):
8484
if not dev_key:
8585
return "This command requires a Google Developers Console API key."
8686

87-
json = requests.get(search_api_url, params={"q": text, "key": dev_key}).json()
87+
json = requests.get(search_api_url, params={"q": text, "key": dev_key, "type": "video"}).json()
8888

8989
if json.get('error'):
9090
if json['error']['code'] == 403:
@@ -106,7 +106,7 @@ def youtime(text):
106106
if not dev_key:
107107
return "This command requires a Google Developers Console API key."
108108

109-
json = requests.get(search_api_url, params={"q": text, "key": dev_key}).json()
109+
json = requests.get(search_api_url, params={"q": text, "key": dev_key, "type": "video"}).json()
110110

111111
if json.get('error'):
112112
if json['error']['code'] == 403:

0 commit comments

Comments
 (0)