Skip to content

Commit

Permalink
base_spider: remove priority from build_requests method
Browse files Browse the repository at this point in the history
Signed-off-by: Yohanna Lisnichuk <yohanitalisnichuk@gmail.com>
  • Loading branch information
yolile committed Mar 26, 2021
1 parent 283aa26 commit 4dfcbea
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions kingfisher_scrapy/base_spider.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def get_start_time(self, format):
date = self.crawler.stats.get_value('start_time')
return date.strftime(format)

def build_request(self, url, formatter, priority=0, **kwargs):
def build_request(self, url, formatter, **kwargs):
"""
Returns a Scrapy request, with a file name added to the request's ``meta`` attribute. If the file name doesn't
have a ``.json``, ``.csv``, ``.xlsx``, ``.rar`` or ``.zip`` extension, it adds a ``.json`` extension.
Expand Down Expand Up @@ -201,7 +201,6 @@ def build_request(self, url, formatter, priority=0, **kwargs):
:param str url: the URL to request
:param formatter: a function that accepts a URL and returns a file name
:param priority: the priority of this request (defaults to 0).
:returns: a Scrapy request
:rtype: scrapy.Request
"""
Expand All @@ -212,7 +211,7 @@ def build_request(self, url, formatter, priority=0, **kwargs):
if 'meta' in kwargs:
meta.update(kwargs.pop('meta'))

return scrapy.Request(url, meta=meta, priority=priority, **kwargs)
return scrapy.Request(url, meta=meta, **kwargs)

def build_file_from_response(self, response, **kwargs):
"""
Expand Down

0 comments on commit 4dfcbea

Please sign in to comment.