[exhentai] add 'fav' option (#4409)
The name 'favorite' is already taken as extractor subcategory
This commit is contained in:
@@ -1475,6 +1475,22 @@ Description
|
|||||||
* ``"exhentai.org"``: Use ``exhentai.org`` for all URLs
|
* ``"exhentai.org"``: Use ``exhentai.org`` for all URLs
|
||||||
|
|
||||||
|
|
||||||
|
extractor.exhentai.fav
|
||||||
|
----------------------
|
||||||
|
Type
|
||||||
|
``string``
|
||||||
|
Example
|
||||||
|
``"4"``
|
||||||
|
Description
|
||||||
|
After downloading a gallery,
|
||||||
|
add it to your account's favorites as the given category number.
|
||||||
|
|
||||||
|
Note: Set this to `"favdel"` to remove galleries from your favorites.
|
||||||
|
|
||||||
|
Note: This will remove any Favorite Notes when applied
|
||||||
|
to already favorited galleries.
|
||||||
|
|
||||||
|
|
||||||
extractor.exhentai.limits
|
extractor.exhentai.limits
|
||||||
-------------------------
|
-------------------------
|
||||||
Type
|
Type
|
||||||
|
|||||||
@@ -179,6 +179,20 @@ class ExhentaiGalleryExtractor(ExhentaiExtractor):
|
|||||||
if source == "hitomi":
|
if source == "hitomi":
|
||||||
self.items = self._items_hitomi
|
self.items = self._items_hitomi
|
||||||
|
|
||||||
|
def favorite(self, slot="0"):
|
||||||
|
url = self.root + "/gallerypopups.php"
|
||||||
|
params = {
|
||||||
|
"gid": self.gallery_id,
|
||||||
|
"t" : self.gallery_token,
|
||||||
|
"act": "addfav",
|
||||||
|
}
|
||||||
|
data = {
|
||||||
|
"favcat" : slot,
|
||||||
|
"apply" : "Apply Changes",
|
||||||
|
"update" : "1",
|
||||||
|
}
|
||||||
|
self.request(url, method="POST", params=params, data=data)
|
||||||
|
|
||||||
def items(self):
|
def items(self):
|
||||||
self.login()
|
self.login()
|
||||||
|
|
||||||
@@ -223,6 +237,10 @@ class ExhentaiGalleryExtractor(ExhentaiExtractor):
|
|||||||
data["_http_validate"] = None
|
data["_http_validate"] = None
|
||||||
yield Message.Url, url, data
|
yield Message.Url, url, data
|
||||||
|
|
||||||
|
fav = self.config("fav")
|
||||||
|
if fav is not None:
|
||||||
|
self.favorite(fav)
|
||||||
|
|
||||||
def _items_hitomi(self):
|
def _items_hitomi(self):
|
||||||
if self.config("metadata", False):
|
if self.config("metadata", False):
|
||||||
data = self.metadata_from_api()
|
data = self.metadata_from_api()
|
||||||
|
|||||||
Reference in New Issue
Block a user