mirror of
https://github.com/searxng/searxng.git
synced 2024-12-29 20:50:28 +00:00
[fix] #55
This commit is contained in:
parent
c14e8fe0a5
commit
faed14b2c6
1 changed files with 8 additions and 1 deletions
|
@ -17,8 +17,15 @@ paging = True
|
|||
|
||||
|
||||
def parse_url(url_string):
|
||||
endings = ['/RS', '/RK']
|
||||
endpositions = []
|
||||
start = url_string.find('http', url_string.find('/RU=')+1)
|
||||
end = min(url_string.rfind('/RS'), url_string.rfind('/RK'))
|
||||
for ending in endings:
|
||||
endpos = url_string.rfind(ending)
|
||||
if endpos > -1:
|
||||
endpositions.append(endpos)
|
||||
|
||||
end = min(endpositions)
|
||||
return unquote(url_string[start:end])
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue