Skip to content

Commit 699ce61

Browse files
style: format code with autopep8
Format code with autopep8 This commit fixes the style issues introduced in 79a66fb according to the output from Autopep8. Details: None
1 parent acf90ea commit 699ce61

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

Pixabay Scraper/main.py

+6-10
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ class Pixabay():
1212
1313
1414
"""
15+
1516
def __init__(self, verbose=True):
1617
self.bunch = '38504833-19606430bd8fde504120d1630'
1718
self.name = 'Pixabay'
18-
self.verbose = verbose
19+
self.verbose = verbose
1920

2021
def __get_params_video(self, query, num, update_params={}):
21-
2222
"""
2323
Class - `Pixabay`
2424
Example:
@@ -48,7 +48,6 @@ def __get_params_video(self, query, num, update_params={}):
4848
return params
4949

5050
def get_video(self, query, num=10, params={}):
51-
5251
"""
5352
Class - `Pixabay`
5453
Example:
@@ -59,7 +58,7 @@ def get_video(self, query, num=10, params={}):
5958
Returns: Downloads num number of videos into local storage.
6059
6160
"""
62-
61+
6362
BASE_URL = 'https://pixabay.com/api/videos/'
6463
_params = self.__get_params_video(query, num, params)
6564
response = requests.get(BASE_URL, params=_params)
@@ -86,7 +85,7 @@ def __get_params_photo(self, query, num, update_params={}):
8685
Returns:
8786
```js
8887
{
89-
88+
9089
'q': query given by user,
9190
'video_type': type of photo,
9291
'orientation': orientation of the photo,
@@ -96,7 +95,7 @@ def __get_params_photo(self, query, num, update_params={}):
9695
```
9796
"""
9897
params = {
99-
98+
10099
'q': query,
101100
'image_type': 'photo',
102101
'orientation': 'horizontal',
@@ -117,7 +116,7 @@ def get_photo(self, query, num=10, params={}):
117116
Returns: Downloads num number of photos into local storage.
118117
119118
"""
120-
119+
121120
BASE_URL = 'https://pixabay.com/api/'
122121
_params = self.__get_params_photo(query, num, params)
123122
response = requests.get(BASE_URL, params=_params)
@@ -132,6 +131,3 @@ def get_photo(self, query, num=10, params={}):
132131
if response is not None:
133132
with open(f'photo_pixabay_{i+1:02d}.jpg', 'wb') as f:
134133
f.write(response.content)
135-
136-
137-

0 commit comments

Comments
 (0)