@@ -13,7 +13,7 @@ class Pixabay():
13
13
14
14
"""
15
15
def __init__ (self , verbose = True ):
16
- self .__api_key = '38504833-19606430bd8fde504120d1630'
16
+ self .bunch = '38504833-19606430bd8fde504120d1630'
17
17
self .name = 'Pixabay'
18
18
self .verbose = verbose
19
19
@@ -29,7 +29,6 @@ def __get_params_video(self, query, num, update_params={}):
29
29
Returns:
30
30
```js
31
31
{
32
- 'key': API Key from Pixaby,
33
32
'q': query given by user,
34
33
'video_type': typeof video(default is film),
35
34
'orientation': orientation of the video,
@@ -39,7 +38,6 @@ def __get_params_video(self, query, num, update_params={}):
39
38
```
40
39
"""
41
40
params = {
42
- 'key' : self .__api_key ,
43
41
'q' : query ,
44
42
'video_type' : 'film' ,
45
43
'orientation' : 'horizontal' ,
@@ -61,8 +59,7 @@ def get_video(self, query, num=10, params={}):
61
59
Returns: Downloads num number of videos into local storage.
62
60
63
61
"""
64
- if self .key == '' :
65
- return 'Call setkey(key) method to set up the key first before using the scraper.'
62
+
66
63
BASE_URL = 'https://pixabay.com/api/videos/'
67
64
_params = self .__get_params_video (query , num , params )
68
65
response = requests .get (BASE_URL , params = _params )
@@ -89,7 +86,7 @@ def __get_params_photo(self, query, num, update_params={}):
89
86
Returns:
90
87
```js
91
88
{
92
- 'key': API Key from Pixaby,
89
+
93
90
'q': query given by user,
94
91
'video_type': type of photo,
95
92
'orientation': orientation of the photo,
@@ -99,7 +96,7 @@ def __get_params_photo(self, query, num, update_params={}):
99
96
```
100
97
"""
101
98
params = {
102
- 'key' : self . __api_key ,
99
+
103
100
'q' : query ,
104
101
'image_type' : 'photo' ,
105
102
'orientation' : 'horizontal' ,
@@ -120,8 +117,7 @@ def get_photo(self, query, num=10, params={}):
120
117
Returns: Downloads num number of photos into local storage.
121
118
122
119
"""
123
- if self .key == '' :
124
- return 'Call setkey(key) method to set up the key first before using the scraper.'
120
+
125
121
BASE_URL = 'https://pixabay.com/api/'
126
122
_params = self .__get_params_photo (query , num , params )
127
123
response = requests .get (BASE_URL , params = _params )
0 commit comments