-
-
Notifications
You must be signed in to change notification settings - Fork 975
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
[kemonoparty] add 'favorites' option (#2826) #2831
Conversation
I forgot to remove this function after replacing regex method with the 'favorites' option
I've tested this with Ubuntu 20.04 in WSL and it is working using the new setting. One thing though is that URL inputs specifying posts or artists will be ignored so the setting is the only way to choose. That's fine for me, but I thought I'd point it out. If this is fine, this pull could close #2826 maybe. |
I can make it recognize them, but should specifying them overwrite the config option? (is the config option useless?) |
Kind of, but I would still keep it, now that you have implemented it.
Yes, use To capture URL arguments, extend pattern = BASE_PATTERN + r"/favorites(?:/?\?([^#]+))?" and use def __init__(self, match):
KemonopartyExtractor.__init__(self, match)
self.favorites = text.parse_query(match.group(2)).get("type") |
Thank you both very much. I tested it again using Coomer and Kemonoparty in Ubuntu 20.04 via WSL2. It works both ways and the URL does take priority over the option. |
@@ -450,7 +450,7 @@ class KemonopartyFavoriteExtractor(KemonopartyExtractor): | |||
def __init__(self, match): | |||
KemonopartyExtractor.__init__(self, match) | |||
self.favorites = text.parse_query( | |||
match.group(2)).get("type") or self.config("favorites", "artist") | |||
match.group(2)).get("type", self.config("favorites", "artist")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In a sense this is worse than before. because it always calls self.config()
even if the URL query parameters have a type
.
By using a or b
, b
only gets evaluated when a
is empty and not at all when a
has a "true" value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, thanks.
No description provided.