#!/bin/bash if [[ "$1" == '--help' || "$1" == '-h' ]]; then printf 'Usage: %q [FILENAME]\n' "$0" >&2 printf 'Prints all ignored URLs from the wpull 2.x SQLite DB at FILENAME (default: wpull.db) to stdout\n' >&2 exit fi if [[ $# -eq 1 ]] then filename="$1" else filename=wpull.db fi if [[ ! -f "${filename}" ]] then printf 'Error: %q does not exist or is not a regular file\n' "${filename}" >&2 exit 1 fi sqlite3 "${filename}" 'SELECT url FROM queued_urls JOIN url_strings ON url_string_id = url_strings.id WHERE status = "skipped" AND status_code IS NULL AND try_count = 1 AND inline_level IS NULL'