feat: add parse Chromium download history

This commit is contained in:
Aquilao
2021-02-07 18:07:37 +08:00
committed by ᴍᴏᴏɴD4ʀᴋ
parent 650a7d58b0
commit 0620dbc22d
3 changed files with 123 additions and 11 deletions
+25
View File
@@ -42,6 +42,16 @@ func (h *historyData) outPutJson(browser, dir string) error {
return nil
}
func (d *downloadHistoryData) outPutJson(browser, dir string) error {
filename := utils.FormatFileName(dir, browser, "download_history", "json")
err := writeToJson(filename, d.downloadHistory)
if err != nil {
return err
}
fmt.Printf("%s Get %d history, filename is %s \n", utils.Prefix, len(d.downloadHistory), filename)
return nil
}
func (p *passwords) outPutJson(browser, dir string) error {
filename := utils.FormatFileName(dir, browser, "password", "json")
err := writeToJson(filename, p.logins)
@@ -111,6 +121,15 @@ func (h *historyData) outPutCsv(browser, dir string) error {
return nil
}
func (d *downloadHistoryData) outPutCsv(browser, dir string) error {
filename := utils.FormatFileName(dir, browser, "download_history", "csv")
if err := writeToCsv(filename, d.downloadHistory); err != nil {
return err
}
fmt.Printf("%s Get %d download history, filename is %s \n", utils.Prefix, len(d.downloadHistory), filename)
return nil
}
func (p *passwords) outPutCsv(browser, dir string) error {
filename := utils.FormatFileName(dir, browser, "password", "csv")
if err := writeToCsv(filename, p.logins); err != nil {
@@ -186,6 +205,12 @@ func (h *historyData) outPutConsole() {
}
}
func (d *downloadHistoryData) outPutConsole() {
for _, v := range d.downloadHistory {
fmt.Printf("%+v\n", v)
}
}
func (p *passwords) outPutConsole() {
for _, v := range p.logins {
fmt.Printf("%+v\n", v)