Use requests.get(url).json()
instead of import
ing the json
module
This commit is contained in:
parent
e0e72866a2
commit
08a9880a58
@ -1,14 +1,13 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
import requests, json, os, re
|
||||
import requests, os, re
|
||||
|
||||
def getContentFromURL(url):
|
||||
if API_KEY != '':
|
||||
url = f'https://www.googleapis.com/youtube/v3/{url}&key={API_KEY}'
|
||||
else:
|
||||
url = f'https://yt.lemnoslife.com/noKey/{url}'
|
||||
content = requests.get(url).text
|
||||
data = json.loads(content)
|
||||
data = requests.get(url).json()
|
||||
return data
|
||||
|
||||
VIDEO_ID = input('Video id: ')
|
||||
|
Reference in New Issue
Block a user