Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 1274fa6

Browse files
Merge pull request avinashkranjan#2948 from avinashkranjan/deepsource-transform-b0843f12
format code with autopep8
2 parents 7cb16a6 + 699ce61 commit 1274fa6

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

‎Pixabay Scraper/main.py

Lines changed: 6 additions & 10 deletions
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)

AltStyle によって変換されたページ (->オリジナル) /