mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-23 03:02:50 +01:00
apply selection options (filter, range) when using '-j'
This commit is contained in:
parent
b8cdd42cab
commit
6c9da67581
@ -335,13 +335,11 @@ class DataJob(Job):
|
|||||||
# collect data
|
# collect data
|
||||||
try:
|
try:
|
||||||
for msg in self.extractor:
|
for msg in self.extractor:
|
||||||
copy = [
|
self.dispatch(msg)
|
||||||
part.copy() if hasattr(part, "copy") else part
|
|
||||||
for part in msg
|
|
||||||
]
|
|
||||||
self.data.append(copy)
|
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
self.data.append((exc.__class__.__name__, str(exc)))
|
self.data.append((exc.__class__.__name__, str(exc)))
|
||||||
|
except BaseException:
|
||||||
|
pass
|
||||||
|
|
||||||
# dump to 'file'
|
# dump to 'file'
|
||||||
json.dump(
|
json.dump(
|
||||||
@ -349,3 +347,12 @@ class DataJob(Job):
|
|||||||
sort_keys=True, indent=2, ensure_ascii=self.ensure_ascii
|
sort_keys=True, indent=2, ensure_ascii=self.ensure_ascii
|
||||||
)
|
)
|
||||||
self.file.write("\n")
|
self.file.write("\n")
|
||||||
|
|
||||||
|
def handle_url(self, url, keywords):
|
||||||
|
self.data.append((Message.Url, url, keywords.copy()))
|
||||||
|
|
||||||
|
def handle_directory(self, keywords):
|
||||||
|
self.data.append((Message.Directory, keywords.copy()))
|
||||||
|
|
||||||
|
def handle_queue(self, url, keywords):
|
||||||
|
self.data.append((Message.Queue, url, keywords.copy()))
|
||||||
|
Loading…
Reference in New Issue
Block a user