Skip to content
This repository has been archived by the owner on Mar 3, 2021. It is now read-only.

Commit

Permalink
fix android client
Browse files Browse the repository at this point in the history
  • Loading branch information
Redcxx committed Aug 13, 2019
1 parent b89b6ff commit 992fbc8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
Binary file removed demo-gif.gif
Binary file not shown.
22 changes: 8 additions & 14 deletions pikax/api/androidclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,20 +148,14 @@ def _get_search_start_url(cls, keyword, search_type, match, sort, search_range):
cls._check_params(match=match, sort=sort, search_range=search_range)
if search_type and not params.SearchType.is_valid(search_type):
raise BaseClientException(f'search type must be type of {params.SearchType}')
param = {
'word': str(keyword)
}

if search_type is not params.SearchType.USER:
param['search_target'] = match.value
param['sort'] = sort.value

if search_range:
if params.Range.is_valid(search_range):
search_range = search_range.value
today = datetime.date.today()
param['start_date'] = str(today)
param['end_date'] = str(today - search_range)
param = {'word': str(keyword), 'search_target': match.value, 'sort': sort.value}

if search_range:
if params.Range.is_valid(search_range):
search_range = search_range.value
today = datetime.date.today()
param['start_date'] = str(today)
param['end_date'] = str(today - search_range)

encoded_params = urllib.parse.urlencode(param)
return cls._search_url.format(type=search_type.value) + encoded_params
Expand Down

0 comments on commit 992fbc8

Please sign in to comment.