Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions app/scrapers/generalized.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,11 @@ def get_page(self, query, startIndex=0, qtype=''):
url = self.imageURL
elif qtype == 'news' and self.name in NEWS_SCRAPERS:
url = self.newsURL
payload = {self.queryKey: query, self.startKey: startIndex,
self.qtype: qtype}
if qtype == '':
payload = {self.queryKey: query, self.startKey: startIndex}
else:
payload = {self.queryKey: query, self.startKey: startIndex,
self.qtype: qtype}
if self.name == 'mojeek' and qtype == 'news':
payload['fmt'] = 'news'
response = requests.get(url, headers=self.headers, params=payload)
Expand Down