Pass `bookmark.href` as is.
from base64 import b64encode
-from urllib.parse import urlsplit, urljoin
+from urllib.parse import urljoin
import sys
import socket
import time
self.start = int(time.time())
bookmark.icon = None
- split_results = urlsplit(bookmark.href)
- url_type, netloc, url_path, query, url_tag = split_results
- url_host = split_results.hostname
-
- if query:
- url = "%s://%s%s?%s" % (url_type, url_host, url_path, query)
- else:
- url = "%s://%s%s" % (url_type, url_host, url_path)
error, redirect_code, redirect_to, headers, content = \
- self.get(bookmark, url, True)
+ self.get(bookmark, bookmark.href, True)
if error:
bookmark.error = error
icon = None
if not icon:
icon = "/favicon.ico"
- icon_url = urljoin(
- "%s://%s%s" % (url_type, url_host, url_path), icon)
+ icon_url = urljoin(bookmark.href, icon)
self.log(" looking for icon at: %s" % icon_url)
if icon_url in icons:
if icons[icon_url]:
self.log(" no header: %s" % key)
md5 = md5wrapper()
- if url_type == "ftp": # Pass welcome message through MD5
+ if bookmark.href.startswith("ftp://"):
+ # Pass welcome message through MD5
ftp_welcome = self.get_ftp_welcome()
if not isinstance(ftp_welcome, bytes):
ftp_welcome = ftp_welcome.encode(charset or 'utf-8')
]
-from urllib.parse import urlsplit, quote, unquote
+from urllib.parse import unquote
import os
BKMK_FORMAT = os.environ.get("BKMK_FORMAT", "MOZILLA")
def __init__(self, href, add_date, last_visit=None, last_modified=None,
keyword=None, comment='', icon_href=None, icon=None,
charset=None, parser_charset=None):
- split_results = urlsplit(href)
- protocol, netloc, path, query, tag = split_results
- user = split_results.username
- password = split_results.password
- host = split_results.hostname
- port = split_results.port
-
- if protocol == 'place':
- href = protocol + ":"
- else:
- href = protocol + "://"
- if user:
- href += quote(user)
- if password:
- href += ':' + quote(password)
- href += '@'
- if host:
- href += host.encode('idna').decode('ascii')
- if port:
- href += ':%d' % port
- if path:
- href += path
-
self.href = href
self.add_date = add_date
self.last_visit = last_visit
bookmarks.html.
WHAT'S NEW
+Version 5.3.1 (2024-03-??)
+
+ Renamed check_urls.py to check_urls_db.py.
+
+ Renamed check_url.py to check_urls.py.
+
+ Stop splitting and un-splitting URLs. Pass bookmark.href as is.
+
Version 5.3.0 (2024-03-06)
Added get_url.py: a script to get one file from an URL.
Version 5.3.1 (2024-03-??)
- Renamed check_urls.py to check_urls_db.py
+ Renamed check_urls.py to check_urls_db.py.
- Renamed check_url.py to check_urls.py
+ Renamed check_url.py to check_urls.py.
+
+ Stop splitting and un-splitting URLs. Pass bookmark.href as is.
Version 5.3.0 (2024-03-06)