aboutsummaryrefslogtreecommitdiff
path: root/mbbmlib.py
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2023-04-01 22:43:02 -0400
committerB. Stack <bgstack15@gmail.com>2023-04-01 22:43:02 -0400
commit2c28ba890e3f03b0cd2f8d7dd4cfc52e3e8b3b26 (patch)
tree79b8dc47e431a6ab0c17309fd354c533fc234c9e /mbbmlib.py
parentfix more UTF-8 errors (diff)
downloadmbbmlib-2c28ba890e3f03b0cd2f8d7dd4cfc52e3e8b3b26.tar.gz
mbbmlib-2c28ba890e3f03b0cd2f8d7dd4cfc52e3e8b3b26.tar.bz2
mbbmlib-2c28ba890e3f03b0cd2f8d7dd4cfc52e3e8b3b26.zip
WIP: handle 17-row Firefox moz_places, but icons are broken right now
Diffstat (limited to 'mbbmlib.py')
-rw-r--r--mbbmlib.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/mbbmlib.py b/mbbmlib.py
index 0d000ef..55b7e61 100644
--- a/mbbmlib.py
+++ b/mbbmlib.py
@@ -7,6 +7,7 @@
# Purpose: Add favicons to bookmarks in exported html file
# History:
# 2022-03-05 fix even more UTF-8 crap
+# 2023-04-01 add bare 17-row Firefox moz_places support. Still need to follow probably origin_id to moz_origins to the icons file to moz_icons?
# Usage:
# main command is export_bookmarks_to_html.
# Reference:
@@ -335,11 +336,17 @@ class Bookmark:
bid, btype, parent, fk, position, title, keyword_id, folder_type, dateAdded, lastModified, guid, syncStatus, syncChangeCounter = row
db_bookmarks.append(db_bookmark(bid, btype, parent, fk, position, title, keyword_id, folder_type, dateAdded, lastModified, guid, syncStatus, syncChangeCounter))
for row in raw_places:
+ #print(f"DEBUG: len(row): {len(row)}, row: {row}")
if (len(row)) == 15:
# LibreWolf, observed 2021-12-02 has no column for favicon_id.
pid, url, title, rev_host, visit_count, hidden, typed, frecency, last_visit_date, guid, foreign_count, url_hash, description, preview_image_url, origin_id = row
favicon_id = 0
+ elif len(row) == 17:
+ # Firefox probably 111.0, observed 2023-04-01 added a new row
+ pid, url, title, rev_host, visit_count, hidden, typed, frecency, last_visit_date, guid, foreign_count, url_hash, description, preview_image_url, origin_id, site_name, recalc_frecency = row
+ favicon_id = 0
else:
+ # 16 rows?
pid, url, title, rev_host, visit_count, hidden, typed, favicon_id, frecency, last_visit_date, guid, foreign_count, url_hash, description, preview_image_url, origin_id = row
db_places.append(db_place(pid, url, title, rev_host, visit_count, hidden, typed, favicon_id, frecency, last_visit_date, guid, foreign_count, url_hash, description, preview_image_url, origin_id))
@@ -470,7 +477,7 @@ class db_bookmark:
return encoded
class db_place:
- def __init__(self,pid,url,title,rev_host,visit_count,hidden,typed,favicon_id,frecency,last_visit_date,guid,foreign_count,url_hash,description,preview_image_url,origin_id):
+ def __init__(self,pid,url,title,rev_host,visit_count,hidden,typed,favicon_id,frecency,last_visit_date,guid,foreign_count,url_hash,description,preview_image_url,origin_id,recalc_frecency=None):
self.pid = pid
self.url = url
self.title = title
@@ -487,6 +494,7 @@ class db_place:
self.description = description
self.preview_image_url = preview_image_url
self.origin_id = origin_id
+ self.recalc_frecency = recalc_frecency
class db_icon:
def __init__(self,iid,icon_url,fixed_icon_url,width,root,color,expire_ms,data):
bgstack15