add robot flag to parse_useragent
This commit is contained in:
parent
224fcf7955
commit
1828701abd
1 changed files with 2 additions and 0 deletions
|
@ -63,6 +63,7 @@ UA_REGEXPS = {
|
|||
'browser': [
|
||||
'(Camino)\/(\d+)',
|
||||
'(chromeframe)\/(\d+)',
|
||||
'(Google Web Preview).+Chrome\/(\d+)',
|
||||
'(Chrome)\/(\d+)',
|
||||
'(Epiphany)\/(\d+)',
|
||||
'(Firefox)\/(\d+)',
|
||||
|
@ -281,6 +282,7 @@ def parse_useragent(useragent):
|
|||
'string': string
|
||||
}
|
||||
break;
|
||||
data['robot'] = data['browser']['name'] in ['Google Web Preview', 'Googlebot']
|
||||
return data
|
||||
|
||||
def removeSpecialCharacters(text):
|
||||
|
|
Loading…
Reference in a new issue