make archive keys user-configurable
This commit is contained in:
@@ -402,11 +402,21 @@ Description File to store IDs of downloaded files in. Downloads of files
|
|||||||
already recorded in this archive file will be skipped_.
|
already recorded in this archive file will be skipped_.
|
||||||
|
|
||||||
The resulting archive file is not a plain text file but an SQLite3
|
The resulting archive file is not a plain text file but an SQLite3
|
||||||
database, as lookup operations are significantly faster when the
|
database, as either lookup operations are significantly faster or
|
||||||
|
memory requirements are significantly lower when the
|
||||||
amount of stored IDs gets reasonably large.
|
amount of stored IDs gets reasonably large.
|
||||||
=========== =====
|
=========== =====
|
||||||
|
|
||||||
|
|
||||||
|
extractor.*.archive-format
|
||||||
|
--------------------------
|
||||||
|
=========== =====
|
||||||
|
Type ``string``
|
||||||
|
Example ``"{id}_{offset}"``
|
||||||
|
Description An alternative `format string`_ to build archive IDs with.
|
||||||
|
=========== =====
|
||||||
|
|
||||||
|
|
||||||
Extractor-specific Options
|
Extractor-specific Options
|
||||||
==========================
|
==========================
|
||||||
|
|
||||||
|
|||||||
@@ -549,7 +549,9 @@ class DownloadArchive():
|
|||||||
self.cursor = con.cursor()
|
self.cursor = con.cursor()
|
||||||
self.cursor.execute("CREATE TABLE IF NOT EXISTS archive "
|
self.cursor.execute("CREATE TABLE IF NOT EXISTS archive "
|
||||||
"(entry PRIMARY KEY) WITHOUT ROWID")
|
"(entry PRIMARY KEY) WITHOUT ROWID")
|
||||||
self.keygen = (extractor.category + extractor.archive_fmt).format_map
|
self.keygen = (extractor.category + extractor.config(
|
||||||
|
"archive-format", extractor.archive_fmt)
|
||||||
|
).format_map
|
||||||
|
|
||||||
def check(self, kwdict):
|
def check(self, kwdict):
|
||||||
"""Return True if item described by 'kwdict' exists in archive"""
|
"""Return True if item described by 'kwdict' exists in archive"""
|
||||||
|
|||||||
Reference in New Issue
Block a user