Skip to content
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

Is there any way to save 'content' of a post in a separate text file? #5574

Closed
AFGreeneye opened this issue May 9, 2024 · 6 comments
Closed

Comments

@AFGreeneye
Copy link

Is there any way to save 'content' of a post in a separate text file?

gallery-dl -K https://kemono.su/patreon/...

content
  <p>Finally!</p><p>Hey everyone. </p><p>See, I started making this page before I got sick, and I am only now starting to feel close to 100% myself again. </p><p>Heheh… as I wrote this, I began to sneeze… Sniff… oh bugger. </p><p>I hope you will enjoy this page. </p><p>Yours truly</p>
@AFGreeneye
Copy link
Author

Is the answer going to be like this post: #5556

@AFGreeneye
Copy link
Author

And how can I add that setting to my gallery-dl config file?

{
	"extractor": {
		"kemonoparty": {
			"metadata": true,
			"username": "username",
			"password": "password",
			"base-directory": "E:/XXX/Picture/Kemono/",
			"discord" : {
				"directory": ["{author['username']!c}_{subcategory!c}"],
				"filename": "{author['username']!c}_{subcategory!c}_{date:%Y.%m.%d}_{filename!C}.{extension}"
			},
			"directory": ["{username!c}_{subcategory!c}"],
			"filename": "{username!c}_{subcategory!c}_{date:%Y.%m.%d}_{title!C}_{num}.{extension}"
		}
	}
}

@mikf
Copy link
Owner

mikf commented May 9, 2024

Yep, something like that. You add it by copy-pasting it into your existing settings and adjusting it:

{
    "extractor": {
	"kemonoparty": {
	    "metadata": true,
	    "username": "username",
	    "password": "password",
	    "base-directory": "E:/XXX/Picture/Kemono/",
	    "discord" : {
		    "directory": ["{author['username']!c}_{subcategory!c}"],
		    "filename": "{author['username']!c}_{subcategory!c}_{date:%Y.%m.%d}_{filename!C}.{extension}"
	    },
	    "postprocessors": [
		{
		    "name" : "metadata",
		    "event": "post",
		    "skip": true,
		    "content-format": "{content|description|''}\n",
		    "filename": "{username!c}_{subcategory!c}_{date:%Y.%m.%d}_{title!C}.txt"
		}
	    ],
	    "directory": ["{username!c}_{subcategory!c}"],
	    "filename": "{username!c}_{subcategory!c}_{date:%Y.%m.%d}_{title!C}_{num}.{extension}"
	}
    }
}

@AFGreeneye
Copy link
Author

Thanks! it works, but it copies the exact 'content' with html tags:
<p>They might be alternative, but they are damn efficient! </p><p>I hope you like it, and of course… stay obs for the rest!</p <p>Yours truly</p><p>Hammer</p>
Is there anyway that to remove the tags and put them in lines like this:

They might be alternative, but they are damn efficient!
I hope you like it, and of course… stay obs for the rest!
Yours truly
Hammer

@Hrxn
Copy link
Contributor

Hrxn commented May 9, 2024

Or, keep the tags and make a HTML file instead of a TXT one.

@mikf
Copy link
Owner

mikf commented May 9, 2024

HTML tags can be removed with !H ({content|''!H}),
but there is no easy way to also replace paragraphs with newlines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants