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': [
|
'browser': [
|
||||||
'(Camino)\/(\d+)',
|
'(Camino)\/(\d+)',
|
||||||
'(chromeframe)\/(\d+)',
|
'(chromeframe)\/(\d+)',
|
||||||
|
'(Google Web Preview).+Chrome\/(\d+)',
|
||||||
'(Chrome)\/(\d+)',
|
'(Chrome)\/(\d+)',
|
||||||
'(Epiphany)\/(\d+)',
|
'(Epiphany)\/(\d+)',
|
||||||
'(Firefox)\/(\d+)',
|
'(Firefox)\/(\d+)',
|
||||||
|
@ -281,6 +282,7 @@ def parse_useragent(useragent):
|
||||||
'string': string
|
'string': string
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
data['robot'] = data['browser']['name'] in ['Google Web Preview', 'Googlebot']
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def removeSpecialCharacters(text):
|
def removeSpecialCharacters(text):
|
||||||
|
|
Loading…
Reference in a new issue