# ACTION can be 'count' (default), 'print', or 'write'
# ACTION can be 'count' (default), 'print', or 'write'
# FILENAME defaults to 'wpull.db'
# FILENAME defaults to 'wpull.db'
# URLPATTERN_OR_WHERE is URLPATTERN if --where isn't used or WHERE if it is.
# URLPATTERN uses SQLite's LIKE syntax with ESCAPE "\", i.e. % matches any number of characters, _ matches exactly one character, and a backslash can be used to escape these special characters.
# URLPATTERN uses SQLite's LIKE syntax with ESCAPE "\", i.e. % matches any number of characters, _ matches exactly one character, and a backslash can be used to escape these special characters.
# Must not contain quotes.
# Must not contain quotes.
# WHERE is an arbitrary SQLite 'WHERE' condition. The available tables are 'queued_urls' and 'url_strings', already joined together.
where='url LIKE "'"$1"'" ESCAPE "\" AND status = "skipped" AND try_count > 3'
fi
query='FROM queued_urls JOIN url_strings ON url_string_id = url_strings.id WHERE url LIKE "'"${urlpattern}"'" ESCAPE "\" AND status = "skipped" AND try_count > 3'
query='FROM queued_urls JOIN url_strings ON url_string_id = url_strings.id WHERE '"${where}"