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

[Deviantart] Saving with filenames impossible in folders of mixed file formats? #400

Closed
cloudywings2 opened this issue Aug 27, 2019 · 1 comment

Comments

@cloudywings2
Copy link

cloudywings2 commented Aug 27, 2019

Hello,

I'm currently attempting to download a gallery using the Deviantart extractor. I'm trying to save the files with their original filenames by doing the following
"filename": "{filename}.{extension}",

Unfortunately, this is impossible in any folder that contains a both images and text documents, as text documents don't have the same types of filenames. Text documents will simply be named "None.htm," and every subsequent text document will then overwrite the previous one.

If there was a way to give files of different types different filename patterns or some kind of fallback pattern for when a name cannot be found then I could circumvent this, but there doesn't seem to be any way of doing this as far as I can tell from the documents.

Edit: I've also noticed that attempting to save a text format link by itself results in the program saving only a header jpg, instead of extracting the text content.

Edit2: I've also noticed that the "journals" setting does alter the file format that text, but setting options in the "journal" category has no effect on them.

@mikf
Copy link
Owner

mikf commented Aug 30, 2019

"filename": "{filename}.{extension}" now gets you the "original" DeviantArt filename for all files. Given that these filenames are just a formatted combination of {title}, {author[username]}, and {index}, you might have been able to use those fields to get the same "information", but now this gets all put into filename in the same format as DeviantArt uses.

If there was a way to give files of different types different filename patterns or some kind of fallback pattern for when a name cannot be found then I could circumvent this, but there doesn't seem to be any way of doing this as far as I can tell from the documents.

There is currently no way to replace a missing field with a different one, or even swap to an entirely different filename pattern, but maybe something like that will be implemented in the future.

Edit: I've also noticed that attempting to save a text format link by itself results in the program saving only a header jpg, instead of extracting the text content.

The extractors for single items and scraps had to rewritten, since those two relied on DeviantArt's actual webpages. They broke when the new "Eclipse" layout got forced on users (#392) and journals were the last thing that got fixed, but they should work again (dedea3b).

Edit2: I've also noticed that the "journals" setting does alter the file format that text, but setting options in the "journal" category has no effect on them.

The journals option lets you specify the journal format.
Using the journal subcategory, on the other hand, lets you specify options that only apply when working on journal-collection URLs like deviantart.com/user/posts/journals. For example:

"deviantart": {
  "_": "use plain text for all journal content",
  "journals": "text",

  "journal": {
    "_": "except when specifically getting all journals of a user",
    "journals": "html",
    "filename": "..."
  }
}

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

2 participants