-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Save more info in --download-archive #1299
Comments
Well, you also can work programmatically with JSON files in folder, might even be easier. |
Yes, I can write a script what I would run after gallery-dl to concatenate all JSONs into one single file and then remove them. And this is the problem. There is no way for users to collect the additional information in user friendly way. I assume to collect the info in a DB what can be viewed like a usual excel file, with https://sqlitebrowser.org/. For example, in case of Pixiv I expect to see a table for each artist where there are columns: id, title, creating date... description, all tags and so on. The other example. A booru. A user have downloaded some works. And decided after some time to upload them to another booru site. So, this functional should allow to users to collect the additional information just by adding a keyword and specifing that info they want to save. But I think it would be really nice if by default to define some default fields for each extractor that should be saved by just adding the keyword at executing this program. (without the manual configuring of the setting file) |
I found something interesting here "postprocessors": [{
"name": "metadata",
"mode": "custom",
"extension": "html",
"format": "<h4>ID: {id}</h4>\n<br>\n{caption}\n<hr>\n{tags}\n<hr>"
}], The result: |
But it still creates tons of files among the downloaded images. Request 1 (Metadata root folder)I think it would be useful, if it would be possible to specify a root folder for metadata and For example, if I download an image to With this setting you can always use Request 2 (Array quotes)Also I think it would be more appropriate if Request 3 (Translated tags [pixiv])Add the support of the translated tags. https://www.pixiv.net/ajax/illust/84677043 With Req 2 + Req 3: |
Replace |
Request 4 (
|
Technitically you can just save the entire JSONs in DB. For good representation it's possible to use JSON1 extension to create virtual tables with the required fields based on the main table with JSONs. It's easy to implement. Just save JSONs in a BD now. For example, with The virtual tables for the representation can be created later. All information is already stored in one place. Also the virtual tables can be modified/changed multiple times without any problem. |
Maybe you could add something like this in your config.json and use a custom DB file instead of what the archive option makes? "pixiv": {
"postprocessors": [{
"name": "exec",
"command": [
"sqlite3",
"~/gallery-dl/pixiv/pixiv.sqlite3",
"INSERT OR REPLACE INTO pixiv_gdl (filename, filepath, page_count, rating, tags, title, description) VALUES('{filename}.{extension}', '{user['id']} {user['account']}', '{page_count}', '{rating}', '{tags}', '{title}', '{caption}');"
]
}]
} where you manually create the CREATE TABLE IF NOT EXISTS pixiv_gdl (
filename varchar(64) NOT NULL UNIQUE,
filepath varchar(64) NOT NULL,
page_count integer NOT NULL,
rating varchar(16) NOT NULL,
tags varchar(1024) DEFAULT '[]',
title varchar(64),
description varchar(3072)
); just a suggestion :P |
I would like to save more info in
--download-archive
SQLite DB.Or probably it makes sense to add an additional SQLite DB with the new argument like
--info-archive
or--metadata-archive
.I want to save the description and tags of the work (other info I can save in filename), and I don't like how
--write-metadata
works. It generate too much files. And in fact it contains a lof of unnecessary information.For example, for Pixiv I can save
user[id]}
,{id}
,{user[name]}
,{date:%Y.%m.%d}
,{title}
in filename andlast-modified
as file's mtime.However I can't save the description and tags.
--write-metadata
is overkill. And these json files make chaos in the folder.I think, the best decidion of this — one file (database) with the selected information (columns for each
{category}
). In order to work with it programatically later.The text was updated successfully, but these errors were encountered: