Spaces:
Runtime error
Runtime error
Commit
·
6e951e6
1
Parent(s):
96d5b93
Update components/pexels.py
Browse files- components/pexels.py +2 -2
components/pexels.py
CHANGED
|
@@ -5,7 +5,7 @@ import torch
|
|
| 5 |
import soundfile as sf
|
| 6 |
|
| 7 |
# Searching for the videos
|
| 8 |
-
def search_pexels(keyword, api_key, orientation='potrait', size='medium', endpoint='videos', num_pages=50):
|
| 9 |
|
| 10 |
if orientation not in ['potrait', 'landscape', 'square']:
|
| 11 |
raise Exception("Error! orientation must be one of {'square', 'landscape', 'potrait'}")
|
|
@@ -19,7 +19,7 @@ def search_pexels(keyword, api_key, orientation='potrait', size='medium', endpoi
|
|
| 19 |
'Authorization': f'{api_key}'
|
| 20 |
}
|
| 21 |
|
| 22 |
-
url = f'{base_url}{endpoint}/search?query={keyword}&per_page={num_pages}&orientation={orientation}&
|
| 23 |
|
| 24 |
|
| 25 |
response = requests.get(url, headers=headers)
|
|
|
|
| 5 |
import soundfile as sf
|
| 6 |
|
| 7 |
# Searching for the videos
|
| 8 |
+
def search_pexels(keyword, api_key, orientation='potrait', size='medium', endpoint='videos', num_pages=50, pages=4):
|
| 9 |
|
| 10 |
if orientation not in ['potrait', 'landscape', 'square']:
|
| 11 |
raise Exception("Error! orientation must be one of {'square', 'landscape', 'potrait'}")
|
|
|
|
| 19 |
'Authorization': f'{api_key}'
|
| 20 |
}
|
| 21 |
|
| 22 |
+
url = f'{base_url}{endpoint}/search?query={keyword}&per_page={num_pages}&orientation={orientation}&page={pages}'
|
| 23 |
|
| 24 |
|
| 25 |
response = requests.get(url, headers=headers)
|