• Convert Firefox places.sqlite bookmarks into a readable text file

    From Dean Hoffman@21:1/5 to All on Wed Mar 8 09:47:04 2023
    XPost: alt.comp.software.firefox

    Sometimes when I run a search and open up a dozen or more pages, I want to
    use that search result in a USENET posting where I just want all the URLs. Normally I manually laboriously cut and paste into a text file.

    Subject title 1
    [URL]
    Subject title 2
    [URL]
    Subject title 3
    [URL]
    ...

    I thought I had a bright idea of saving time by using the bookmarks.html
    file which I could save all the open tabs into and convert to text.

    I don't normally use bookmarks so it will contain just the current tabs.
    I right click any tab > Select All Tabs > Bookmark Tabs

    That should save all the tabs into the bookmarks file.
    Help > More Troubleshooting Information > Application Basics > Profile Folder > Open Folder = %APPDATA%\Mozilla\Firefox\Profiles\
    I was surprised there is no longer a bookmarks.html file there.
    Just the bookmarksbackups folder and the places.sqlite file.

    Googling, the first hit was an online tool to convert the session file. https://www.jeffersonscher.com/ffu/scrounger.html
    But that will contain the entire history to weed through.
    And it requires closing all the open tabs (which could lose data if
    something goes wrong and you can't get them all back when they are open).

    I just want the bookmarks in a text file. Not the history.

    Googling, the next few hits are complicated scripts running session
    add ons and python converters from the sqlite format to Excel.

    Example.
    sqlite3 -csv -header places.sqlite "select datetime(moz_historyvisits.visit_date/1000000, 'unixepoch', 'localtime') as datum, moz_places.url, moz_places.title from moz_places, moz_historyvisits where moz_places.id = moz_historyvisits.place_id and moz_places.title like
    '%' order by datum" |
    convertfrom-csv | select -last 3 | fl

    That's too much for something that should be very simple.
    Is there something simpler to convert places.sqlite > places.txt?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul@21:1/5 to Dean Hoffman on Wed Mar 8 12:13:35 2023
    XPost: alt.comp.software.firefox

    On 3/8/2023 10:47 AM, Dean Hoffman wrote:
    Sometimes when I run a search and open up a dozen or more pages, I want to use that search result in a USENET posting where I just want all the URLs.
    Normally I manually laboriously cut and paste into a text file.

    Subject title 1
    [URL]
    Subject title 2
    [URL]
    Subject title 3
    [URL]
    ...

    I thought I had a bright idea of saving time by using the bookmarks.html file which I could save all the open tabs into and convert to text.

    I don't normally use bookmarks so it will contain just the current tabs.
    I right click any tab > Select All Tabs > Bookmark Tabs

    That should save all the tabs into the bookmarks file.
    Help > More Troubleshooting Information > Application Basics > Profile Folder > Open Folder = %APPDATA%\Mozilla\Firefox\Profiles\
    I was surprised there is no longer a bookmarks.html file there.
    Just the bookmarksbackups folder and the places.sqlite file.

    Googling, the first hit was an online tool to convert the session file. https://www.jeffersonscher.com/ffu/scrounger.html
    But that will contain the entire history to weed through.
    And it requires closing all the open tabs (which could lose data if
    something goes wrong and you can't get them all back when they are open).

    I just want the bookmarks in a text file. Not the history.

    Googling, the next few hits are complicated scripts running session add ons and python converters from the sqlite format to Excel.
    Example.
    sqlite3 -csv -header places.sqlite "select datetime(moz_historyvisits.visit_date/1000000, 'unixepoch', 'localtime') as datum, moz_places.url, moz_places.title from moz_places, moz_historyvisits where moz_places.id = moz_historyvisits.place_id and moz_
    places.title like '%' order by datum" |
     convertfrom-csv | select -last 3 | fl

    That's too much for something that should be very simple.
    Is there something simpler to convert places.sqlite > places.txt?

    Firefox should have an Export Bookmarks function.
    This is THE easiest way to get bookmarks.

    *******

    You can dump the raw database if you want. No selectors applied at all,
    means everything it has got is in here.

    sqlite3 places.sqlite .dump > places.txt

    The 242 value, stitches these two together. moz_places is where a single visit went to.
    That gives the URL. The bookmark has a matching text description. These
    are "tables" which share an "index value".

    INSERT INTO moz_places VALUES(242,'http://mirror.math.princeton.edu/pub/gentoo/releases/amd64/20160704/',
    'Index of /pub/gentoo/releases/amd64/20160704',
    'ude.notecnirp.htam.rorrim.',1,0,0,20,1645368201088000,
    '2odbob4OBKf3',1,125509967514132,NULL,NULL);

    INSERT INTO moz_bookmarks VALUES(39,1,242,2,9,'Index of /pub/gentoo/releases/amd64/20160704',
    NULL,NULL,1645370731176000,1645370731176000,'N6bMacL4T_dk',1,1);

    But then, that's not fit for human consumption, as no selectors
    were applied and a lot of edits (scripts) will be required. And it looks
    like I haven't located the table with the Favicon in it.

    In Windows 10, you can run the bash shell, and load up sqlite browser
    in bash shell (WSLg graphically enabled version). Microsoft makes a
    claim that there is a WSLg version in the Microsoft Store now, that
    works in Windows 10. But what is in the browser, is no better than the
    text I just showed you.

    *******

    But you're also missing the bookmarkbackups folder. This is lz4 compressed.
    The file is in .json format.

    bookmarks-2023-03-07_49_FAAABBBCCCDDDEEEFa-3jA==.jsonlz4

    I wrote my own decompressor. It's just a wrapper for the lz4.c that
    comes in the Firefox source tarball. While github has a version too,
    the identifier in the header of this file is different.

    gcc -c lz4.c # lz4.c, lz4.h, likely in Firefox source tarball.
    gcc -c unmoz.c
    gcc -o unmoz.exe lz4.o unmoz.o

    unmoz.exe test.jsonlz4 output.json.txt

    This is not as convenient as a Bookmark Export. The format is nice,
    but not ready for some purpose. You can notice a pointer to a Favicon
    is in this entry.

    {
    "guid": "1ixB6N11arNd",
    "title": "GitHub - yt-dlp/yt-dlp: A youtube-dl fork with additional features and fixes",
    "index": 1,
    "dateAdded": 1650167819095000, <=== there's a converter to make dates...
    "lastModified": 1650167819095000,
    "id": 18,
    "typeCode": 1,
    "iconUri": "https://github.githubassets.com/favicons/favicon.svg",
    "type": "text/x-moz-place",
    "uri": "https://github.com/yt-dlp/yt-dlp#release-files" <=== The bookmark URL
    }

    My biggest concern about browsers, is that they are LOSING bookmarks.
    Every time I do one of these posts, I find an extraordinarily low
    number of bookmarks. Like there's an expiry date.

    Paul

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Marc Auslander@21:1/5 to Dean Hoffman on Wed Mar 8 11:37:13 2023
    XPost: alt.comp.software.firefox

    On 3/8/2023 10:47 AM, Dean Hoffman wrote:
    Sometimes when I run a search and open up a dozen or more pages, I want
    to use that search result in a USENET posting where I just want all the
    URLs.
    Normally I manually laboriously cut and paste into a text file.

    Subject title 1
    [URL]
    Subject title 2
    [URL]
    Subject title 3
    [URL]
    ...

    I thought I had a bright idea of saving time by using the bookmarks.html
    file which I could save all the open tabs into and convert to text.

    I don't normally use bookmarks so it will contain just the current tabs.
    I right click any tab > Select All Tabs > Bookmark Tabs

    That should save all the tabs into the bookmarks file.
    Help > More Troubleshooting Information > Application Basics > Profile
    Folder > Open Folder = %APPDATA%\Mozilla\Firefox\Profiles\
    I was surprised there is no longer a bookmarks.html file there.
    Just the bookmarksbackups folder and the places.sqlite file.

    Googling, the first hit was an online tool to convert the session file. https://www.jeffersonscher.com/ffu/scrounger.html
    But that will contain the entire history to weed through.
    And it requires closing all the open tabs (which could lose data if
    something goes wrong and you can't get them all back when they are open).

    I just want the bookmarks in a text file. Not the history.

    Googling, the next few hits are complicated scripts running session add
    ons and python converters from the sqlite format to Excel.
    Example.
    sqlite3 -csv -header places.sqlite "select datetime(moz_historyvisits.visit_date/1000000, 'unixepoch', 'localtime')
    as datum, moz_places.url, moz_places.title from moz_places,
    moz_historyvisits where moz_places.id = moz_historyvisits.place_id and moz_places.title like '%' order by datum" |
     convertfrom-csv | select -last 3 | fl

    That's too much for something that should be very simple.
    Is there something simpler to convert places.sqlite > places.txt?

    What about export bookmarks as html?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Molly Mockford@21:1/5 to Dean Hoffman on Wed Mar 8 18:11:48 2023
    XPost: alt.comp.software.firefox

    On 08/03/23 15:47, Dean Hoffman wrote:

    I just want the bookmarks in a text file. Not the history.

    What I do is Bookmarks -> Manage Bookmarks -> Import and Backup ->
    Export Bookmarks to HTML. OK, it isn't a straightforward text file,
    because it displays the page titles, with a link to the URL, and if you
    View Source you will see a lot more than the basic URL is there.
    However, if you copy that data to a plain text file and run a quick edit
    on it, deleting everything including and after {?utm_medium}, and then including and after {/"} (ignoring the braces, which I am using purely
    as delimiters), this should get you pretty close to what you need.
    --
    Molly Mockford
    Nature loves variety. Unfortunately, society hates it. (Milton Diamond
    Ph.D.)
    (My Reply-To address *is* valid, though may not remain so for ever.)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Molly Mockford@21:1/5 to Molly Mockford on Wed Mar 8 18:13:57 2023
    XPost: alt.comp.software.firefox

    On 08/03/23 18:11, Molly Mockford wrote:
    On 08/03/23 15:47, Dean Hoffman wrote:

    I just want the bookmarks in a text file. Not the history.

    What I do is Bookmarks -> Manage Bookmarks -> Import and Backup ->
    Export Bookmarks to HTML. OK, it isn't a straightforward text file,
    because it displays the page titles, with a link to the URL, and if you
    View Source you will see a lot more than the basic URL is there.
    However, if you copy that data to a plain text file and run a quick edit
    on it, deleting everything including and after {?utm_medium}, and then including and after {/"} (ignoring the braces, which I am using purely
    as delimiters), this should get you pretty close to what you need.

    Of course, one only sees mistakes after posting! I should have said
    'after {/"}', not 'including and after {/"}'. Sorry!
    --
    Molly Mockford
    Nature loves variety. Unfortunately, society hates it. (Milton Diamond
    Ph.D.)
    (My Reply-To address *is* valid, though may not remain so for ever.)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Big Al@21:1/5 to this is what Dean Hoffman on Wed Mar 8 13:36:09 2023
    XPost: alt.comp.software.firefox

    On 3/8/23 10:47, this is what Dean Hoffman wrote:
    Sometimes when I run a search and open up a dozen or more pages, I want to use that search result in a USENET posting
    where I just want all the URLs.
    Normally I manually laboriously cut and paste into a text file.

    Subject title 1
    [URL]
    Subject title 2
    [URL]
    Subject title 3
    [URL]
    ...

    I thought I had a bright idea of saving time by using the bookmarks.html file which I could save all the open tabs into
    and convert to text.

    I don't normally use bookmarks so it will contain just the current tabs.
    I right click any tab > Select All Tabs > Bookmark Tabs

    That should save all the tabs into the bookmarks file.
    Help > More Troubleshooting Information > Application Basics > Profile Folder > Open Folder =
    %APPDATA%\Mozilla\Firefox\Profiles\
    I was surprised there is no longer a bookmarks.html file there.
    Just the bookmarksbackups folder and the places.sqlite file.

    Googling, the first hit was an online tool to convert the session file. https://www.jeffersonscher.com/ffu/scrounger.html
    But that will contain the entire history to weed through.
    And it requires closing all the open tabs (which could lose data if
    something goes wrong and you can't get them all back when they are open).

    I just want the bookmarks in a text file. Not the history.

    Googling, the next few hits are complicated scripts running session add ons and python converters from the sqlite format
    to Excel.
    Example.
    sqlite3 -csv -header places.sqlite "select datetime(moz_historyvisits.visit_date/1000000, 'unixepoch', 'localtime') as
    datum, moz_places.url, moz_places.title from moz_places, moz_historyvisits where moz_places.id =
    moz_historyvisits.place_id and moz_places.title like '%' order by datum" |
     convertfrom-csv | select -last 3 | fl

    That's too much for something that should be very simple.
    Is there something simpler to convert places.sqlite > places.txt?
    browser.bookmarks.autoExportHTML in about:config set it to true.
    When you close Firefox every time it will export to bookmarks.html in your profile folder.
    It's great if you want to import into Edge/Chrome etc.
    --
    Al

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From RonTheGuy@21:1/5 to Dean Hoffman on Wed Mar 8 12:01:14 2023
    XPost: alt.comp.software.firefox

    On Mar 08, 2023, Dean Hoffman wrote
    (in article<news:tuaala$g5l3$1@paganini.bofh.team>):

    I thought I had a bright idea of saving time by using the bookmarks.html
    file which I could save all the open tabs into and convert to text.

    What I used to do is snapshot so it's all of what you want, but done wrong.
    Bookmarks > Search Bookmarks > WINDOWS+PRINTSCREEN

    What I do now only gets half of what you want, but that half is done right.
    Bookmarks > Manage Bookmarks > CONTROL+A CONTROL+C
    WINDOWS+R > notepad.exe > CONTROL + V

    Every URL is text but you have to OCR the image to get all titles in text.

    Ron, the humblest guy in town.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Zaghadka@21:1/5 to Hoffman on Wed Mar 8 17:31:04 2023
    XPost: alt.comp.software.firefox

    On Wed, 8 Mar 2023 09:47:04 -0600, in alt.comp.os.windows-10, Dean
    Hoffman wrote:

    That's too much for something that should be very simple.
    Is there something simpler to convert places.sqlite > places.txt?

    CTRL+SHIFT+O

    This will open the bookmarks manager.

    In bookmarks manager:

    Import and Backup -> Export Bookmarks to HTML...

    --
    Zag

    No one ever said on their deathbed, 'Gee, I wish I had
    spent more time alone with my computer.' ~Dan(i) Bunten

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Zaidy036@21:1/5 to Dean Hoffman on Wed Mar 8 20:20:07 2023
    XPost: alt.comp.software.firefox

    On 3/8/2023 10:47 AM, Dean Hoffman wrote:
    Sometimes when I run a search and open up a dozen or more pages, I want
    to use that search result in a USENET posting where I just want all the
    URLs.
    Normally I manually laboriously cut and paste into a text file.

    Subject title 1
    [URL]
    Subject title 2
    [URL]
    Subject title 3
    [URL]
    ...

    I thought I had a bright idea of saving time by using the bookmarks.html
    file which I could save all the open tabs into and convert to text.

    I don't normally use bookmarks so it will contain just the current tabs.
    I right click any tab > Select All Tabs > Bookmark Tabs

    That should save all the tabs into the bookmarks file.
    Help > More Troubleshooting Information > Application Basics > Profile
    Folder > Open Folder = %APPDATA%\Mozilla\Firefox\Profiles\
    I was surprised there is no longer a bookmarks.html file there.
    Just the bookmarksbackups folder and the places.sqlite file.

    Googling, the first hit was an online tool to convert the session file. https://www.jeffersonscher.com/ffu/scrounger.html
    But that will contain the entire history to weed through.
    And it requires closing all the open tabs (which could lose data if
    something goes wrong and you can't get them all back when they are open).

    I just want the bookmarks in a text file. Not the history.

    Googling, the next few hits are complicated scripts running session add
    ons and python converters from the sqlite format to Excel.
    Example.
    sqlite3 -csv -header places.sqlite "select datetime(moz_historyvisits.visit_date/1000000, 'unixepoch', 'localtime')
    as datum, moz_places.url, moz_places.title from moz_places,
    moz_historyvisits where moz_places.id = moz_historyvisits.place_id and moz_places.title like '%' order by datum" |
     convertfrom-csv | select -last 3 | fl

    That's too much for something that should be very simple.
    Is there something simpler to convert places.sqlite > places.txt?
    add extension "Email Tabs" then use its option "Copy Links to Clipboard"

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul@21:1/5 to gtr on Thu Mar 9 11:08:55 2023
    XPost: alt.comp.software.firefox

    On 3/9/2023 10:56 AM, gtr wrote:
    On 2023-03-08 15:31:04 +0000, Zaghadka said:

    Import and Backup -> Export Bookmarks to HTML

    Is there a subsequent HTML to TEXT conversion out there?

    A classical answer would be "why, open the HTML with
    a browser, and save as Text". But I doubt the result
    visually would be all that useful :-) It needs some
    newlines inserted for proper formatting.

    This is an example of one entry, saved as text. The title
    can arbitrarily switch to a new line. The URL is in <> brackets.

    GitHub - yt-dlp/yt-dlp: A youtube-dl fork with additional features and
    fixes <https://github.com/yt-dlp/yt-dlp#release-files>

    Paul

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From gtr@21:1/5 to Zaghadka on Thu Mar 9 07:56:26 2023
    XPost: alt.comp.software.firefox

    On 2023-03-08 15:31:04 +0000, Zaghadka said:

    Import and Backup -> Export Bookmarks to HTML

    Is there a subsequent HTML to TEXT conversion out there?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mr. Man-wai Chang@21:1/5 to Dean Hoffman on Fri Mar 10 00:15:36 2023
    XPost: alt.comp.software.firefox

    On 3/8/2023 11:47 PM, Dean Hoffman wrote:
    Sometimes when I run a search and open up a dozen or more pages, I want to use that search result in a USENET posting where I just want all the URLs. Normally I manually laboriously cut and paste into a text file.

    Googling, the next few hits are complicated scripts running session
    add ons and python converters from the sqlite format to Excel.

    Example.
    sqlite3 -csv -header places.sqlite "select datetime(moz_historyvisits.visit_date/1000000, 'unixepoch', 'localtime') as datum, moz_places.url, moz_places.title from moz_places, moz_historyvisits where moz_places.id = moz_historyvisits.place_id and moz_places.title like '%' order by datum" |
    convertfrom-csv | select -last 3 | fl

    That's too much for something that should be very simple.
    Is there something simpler to convert places.sqlite > places.txt?

    Try searching for "sqlite" in the add-on page... basically, it's a
    database dump.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)