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

[FurAffinity] Add username_url keyword #821

Closed
espressoelf opened this issue Jun 10, 2020 · 4 comments
Closed

[FurAffinity] Add username_url keyword #821

espressoelf opened this issue Jun 10, 2020 · 4 comments

Comments

@espressoelf
Copy link

Currently, gallery-dl only lists the real username, but not the username used in urls, i.e. https://www.furaffinity.net/gallery/[username_url]/. While the difference isn't huge (mostly lower-case and underscores stripped), I'd prefer using the url-version of the username for folders.

Example: https://www.furaffinity.net/user/rabidfairy/
username is Rabid_Fairy, username_url would be rabidfairy

I'd use the avatar section for getting it.

Example image: https://www.furaffinity.net/view/36738425/
Example image from a user without a custom avatar: https://www.furaffinity.net/view/36712627/

Old layout:

<div class="classic-submissiont-title avatar">
    <a href="/user/maebuns/"><img class="avatar" alt="maebuns" src="//a.facdn.net/1591749344/maebuns.gif"></a>
</div>

New layout:

<div class="submission-id-avatar">
    <a href="/user/maebuns/"><img class="submission-user-icon floatleft avatar" src="//a.facdn.net/1591749344/maebuns.gif"></a>
</div>

Thanks for your consideration.

@mikf
Copy link
Owner

mikf commented Jun 10, 2020

You can transform a real username into a url username with the not too well documented formatting options, i.e. {user!l:R_//} to lowercase the name !l and replace all underscores with an empty string R_//.

Furaffinity usernames can only consist of letter, digits, and -_~. as special characters and only underscores get removed in URLs it seems.

@espressoelf
Copy link
Author

Sounds like a good workaround, I'll try that, thank you. A variable for that would still by very appreciated, if you find the time.

Another question about string manipulation: since I'm downloading faves from many artists, I started putting them in subfolders of the first letter, i.e. images from rabidfairy would be saved in ./gallery-dl/furaffinity/r/rabidfairy/ - how do I achieve that?

@mikf
Copy link
Owner

mikf commented Jun 10, 2020

{user[0]} to access the first character in user, and you can combine this with lowercasing and replacing operations if needed. You can also do slicing: {user[2:5]}

@espressoelf
Copy link
Author

"directory": ["{artist[0]!l}", "{artist!l:R_//}"],
"filename": "{filename}.{extension}"

Does the trick for now, thanks for your support! If you want, you can close this issue now - or later if you plan to implement the initial suggestion.

Time to retire my own script and replace it with gallery-dl. <3

@mikf mikf closed this as completed in ffb6c52 Jun 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants