[itaku:stars] update
- remove type hints - add test - update docs/supportedsites
This commit is contained in:
@@ -478,7 +478,7 @@ Consider all listed sites to potentially be NSFW.
|
|||||||
<tr>
|
<tr>
|
||||||
<td>Itaku</td>
|
<td>Itaku</td>
|
||||||
<td>https://itaku.ee/</td>
|
<td>https://itaku.ee/</td>
|
||||||
<td>Galleries, individual Images, Search Results</td>
|
<td>Galleries, individual Images, Search Results, Stars</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@@ -65,6 +65,15 @@ class ItakuGalleryExtractor(ItakuExtractor):
|
|||||||
return self.api.galleries_images(*self.groups)
|
return self.api.galleries_images(*self.groups)
|
||||||
|
|
||||||
|
|
||||||
|
class ItakuStarsExtractor(ItakuExtractor):
|
||||||
|
subcategory = "stars"
|
||||||
|
pattern = BASE_PATTERN + r"/profile/([^/?#]+)/stars(?:/(\d+))?"
|
||||||
|
example = "https://itaku.ee/profile/USER/stars"
|
||||||
|
|
||||||
|
def posts(self):
|
||||||
|
return self.api.galleries_images_starred(*self.groups)
|
||||||
|
|
||||||
|
|
||||||
class ItakuImageExtractor(ItakuExtractor):
|
class ItakuImageExtractor(ItakuExtractor):
|
||||||
subcategory = "image"
|
subcategory = "image"
|
||||||
pattern = BASE_PATTERN + r"/images/(\d+)"
|
pattern = BASE_PATTERN + r"/images/(\d+)"
|
||||||
@@ -85,15 +94,6 @@ class ItakuSearchExtractor(ItakuExtractor):
|
|||||||
return self.api.search_images(params)
|
return self.api.search_images(params)
|
||||||
|
|
||||||
|
|
||||||
class ItakuStarsExtractor(ItakuExtractor):
|
|
||||||
subcategory = "stars"
|
|
||||||
pattern = BASE_PATTERN + r"/profile/([^/?#]+)/stars(?:/(\d+))?"
|
|
||||||
example = "https://itaku.ee/profile/USER/stars"
|
|
||||||
|
|
||||||
def posts(self):
|
|
||||||
return self.api.stars_images(*self.groups)
|
|
||||||
|
|
||||||
|
|
||||||
class ItakuAPI():
|
class ItakuAPI():
|
||||||
|
|
||||||
def __init__(self, extractor):
|
def __init__(self, extractor):
|
||||||
@@ -148,11 +148,11 @@ class ItakuAPI():
|
|||||||
}
|
}
|
||||||
return self._pagination(endpoint, params, self.image)
|
return self._pagination(endpoint, params, self.image)
|
||||||
|
|
||||||
def stars_images(self, username: str, section: str = None):
|
def galleries_images_starred(self, username, section=None):
|
||||||
endpoint = "/galleries/images/user_starred_imgs/"
|
endpoint = "/galleries/images/user_starred_imgs/"
|
||||||
params = {
|
params = {
|
||||||
"cursor" : None,
|
"cursor" : None,
|
||||||
"stars_of": self.user(username)["owner"],
|
"stars_of" : self.user(username)["owner"],
|
||||||
"sections" : section,
|
"sections" : section,
|
||||||
"date_range": "",
|
"date_range": "",
|
||||||
"ordering" : "-date_added",
|
"ordering" : "-date_added",
|
||||||
|
|||||||
@@ -30,6 +30,15 @@ __tests__ = (
|
|||||||
"sections" : ["Fanart/Pokemon"],
|
"sections" : ["Fanart/Pokemon"],
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"#url" : "https://itaku.ee/profile/piku/stars",
|
||||||
|
"#category": ("", "itaku", "stars"),
|
||||||
|
"#class" : itaku.ItakuStarsExtractor,
|
||||||
|
"#pattern" : r"https://itaku\.ee/api/media/gallery_imgs/[^/?#]+\.(jpg|png|gif)",
|
||||||
|
"#range" : "1-10",
|
||||||
|
"#count" : 10,
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"#url" : "https://itaku.ee/images/100471",
|
"#url" : "https://itaku.ee/images/100471",
|
||||||
"#category": ("", "itaku", "image"),
|
"#category": ("", "itaku", "image"),
|
||||||
|
|||||||
Reference in New Issue
Block a user