Export download history from chrome
Asked Answered
S

2

6

I use Google Chrome on Linux Debian 10. And I download many files by this (thousands). And I should to export links, I downloaded files from. I was looking for method in the Internet and found some JS-scripts, I should paste to console on chrome://downloads/ page like:

ditems = document.querySelector("downloads-manager").shadowRoot.querySelector("iron-list").querySelectorAll("downloads-item");

var div = document.createElement('div');

[].forEach.call(ditems, function (el) {
var br = document.createElement('br');
var hr = document.createElement('hr');
div.appendChild(el.shadowRoot.querySelector("#url"));
div.appendChild(br);
div.appendChild(hr);

});
document.body.innerHTML=""
document.body.appendChild(div);
document.head.style.innerHTML="";

But each from this code covered only little part of my downloads list. First, I decided It's because my big list is not loaded full, so I spent time to scroll down till the end and tried again, but nothing had changed. What should I do? Screenshots: 1, before; 2, before; 1, after; 2, after. Such I want to say, It shows only little random part of big list.

Spalla answered 11/10, 2020 at 10:36 Comment(2)
Try to directly extract it from the downloads database. It's the 'downloads' table from Default/History.Podgy
@shkiperdesna did you find a way to export Chrome's download history?Assumption
A
3

As @joy-jin mentioned in his comment, you can extract it from Chrome's history database.

  1. Locate the History file:
    • on macOS: ~/Library/Application\ Support/Google/Chrome/Default/
    • on Windows: %LocalAppData%\Google\Chrome\User Data\Default
    • on Linux: ~/.config/google-chrome/Default
  2. Make a copy of the file History to another location (you can't use the original while Chrome is open).
  3. Now, you can extract the download links from the copied file, either using sqlite3 CLI, or using a GUI SQLite viewer such as DB Browser for SQLite. The download links are in the table downloads_url_chains.

Similar question that contains some useful sqlite3 commands: https://superuser.com/questions/602252/can-chrome-browser-history-be-exported-to-an-html-file

Assumption answered 11/2, 2023 at 17:1 Comment(0)
S
0

I am using this snippet in the console of the download manager tab:

document.querySelector("body > downloads-manager")
.shadowRoot.querySelectorAll("downloads-item")
.forEach(e => setTimeout (console.log.bind (console, e.shadowRoot.querySelector("#url").href)))

This setTimeout (console.log.bind(console, …)) call prevents the line numbers in the console and makes it easier to copy and paste the list.

Sidhu answered 21/9, 2024 at 14:23 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.