-
Notifications
You must be signed in to change notification settings - Fork 0
/
StandaloneWindowsChrome.py
40 lines (38 loc) · 1.33 KB
/
StandaloneWindowsChrome.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import os, GenerateStandalone
databaseInputFile = os.path.join(os.path.expandvars("%LOCALAPPDATA%"), "Google", "Chrome", "User Data", "Default", "History")
sqlHistoryItems = "\
SELECT \
urls.id, \
urls.url, \
urls.title, \
CAST(urls.last_visit_time / 1000 AS INT) - 11644473600000 AS lastVisitTime, \
urls.visit_count AS visitCount, \
urls.typed_count AS typedCount \
FROM urls \
ORDER BY lastVisitTime DESC;"
sqlVisitItems = "\
SELECT \
visits.url AS id, \
visits.id AS visitId, \
CAST(visits.visit_time / 1000 AS INT) - 11644473600000 AS visitTime, \
visits.from_visit AS referringVisitId, \
CASE (16 + visits.transition % 16) % 16 \
WHEN 0 THEN \"link\" \
WHEN 1 THEN \"typed\" \
WHEN 2 THEN \"auto_bookmark\" \
WHEN 3 THEN \"auto_subframe\" \
WHEN 4 THEN \"manual_subframe\" \
WHEN 5 THEN \"generated\" \
WHEN 6 THEN \"auto_toplevel\" \
WHEN 7 THEN \"form_submit\" \
WHEN 8 THEN \"reload\" \
WHEN 9 THEN \"keyword\" \
WHEN 10 THEN \"keyword_generated\" \
ELSE \"typed\" \
END AS transition, \
IFNULL(visit_source.source, 999) AS visitOrigin \
FROM visits \
LEFT JOIN visit_source on visits.id = visit_source.id \
ORDER BY visits.visit_time DESC;"
copyDatabaseInputFile = True
GenerateStandalone.generateStandalone(databaseInputFile, sqlHistoryItems, sqlVisitItems, copyDatabaseInputFile)