[nozomi] fix extractors (#7242)
update internal domains to 'gold-usergeneratedcontent.net'
This commit is contained in:
@@ -21,6 +21,7 @@ class NozomiExtractor(Extractor):
|
||||
"""Base class for nozomi extractors"""
|
||||
category = "nozomi"
|
||||
root = "https://nozomi.la"
|
||||
domain = "gold-usergeneratedcontent.net"
|
||||
filename_fmt = "{postid} {dataid}.{extension}"
|
||||
archive_fmt = "{dataid}"
|
||||
|
||||
@@ -31,8 +32,8 @@ class NozomiExtractor(Extractor):
|
||||
data = self.metadata()
|
||||
|
||||
for post_id in map(str, self.posts()):
|
||||
url = "https://j.nozomi.la/post/{}/{}/{}.json".format(
|
||||
post_id[-1], post_id[-3:-1], post_id)
|
||||
url = "https://j.{}/post/{}/{}/{}.json".format(
|
||||
self.domain, post_id[-1], post_id[-3:-1], post_id)
|
||||
response = self.request(url, fatal=False)
|
||||
|
||||
if response.status_code >= 400:
|
||||
@@ -76,8 +77,8 @@ class NozomiExtractor(Extractor):
|
||||
ext = "webp"
|
||||
|
||||
post["extension"] = ext
|
||||
post["url"] = url = "https://{}.nozomi.la/{}/{}/{}.{}".format(
|
||||
subdomain, did[-1], did[-3:-1], did, ext)
|
||||
post["url"] = url = "https://{}.{}/{}/{}/{}.{}".format(
|
||||
subdomain, self.domain, did[-1], did[-3:-1], did, ext)
|
||||
yield Message.Url, url, post
|
||||
|
||||
def posts(self):
|
||||
@@ -168,7 +169,7 @@ class NozomiSearchExtractor(NozomiExtractor):
|
||||
negative = []
|
||||
|
||||
def nozomi(path):
|
||||
url = "https://j.nozomi.la/" + path + ".nozomi"
|
||||
url = "https://j.{}/{}.nozomi".format(self.domain, path)
|
||||
return decode_nozomi(self.request(url).content)
|
||||
|
||||
for tag in self.tags:
|
||||
|
||||
@@ -12,8 +12,7 @@ __tests__ = (
|
||||
"#url" : "https://nozomi.la/post/3649262.html",
|
||||
"#category": ("", "nozomi", "post"),
|
||||
"#class" : nozomi.NozomiPostExtractor,
|
||||
"#pattern" : r"https://w\.nozomi\.la/2/15/aaa9f7c632cde1e1a5baaff3fb6a6d857ec73df7fdc5cf5a358caf604bf73152\.webp",
|
||||
"#sha1_url" : "e5525e717aec712843be8b88592d6406ae9e60ba",
|
||||
"#urls" : "https://w.gold-usergeneratedcontent.net/2/15/aaa9f7c632cde1e1a5baaff3fb6a6d857ec73df7fdc5cf5a358caf604bf73152.webp",
|
||||
"#sha1_content": "6d62c4a7fea50c0a89d499603c4e7a2b4b9bffa8",
|
||||
|
||||
"artist" : ["hammer (sunset beach)"],
|
||||
@@ -37,9 +36,15 @@ __tests__ = (
|
||||
"#comment" : "multiple images per post",
|
||||
"#category": ("", "nozomi", "post"),
|
||||
"#class" : nozomi.NozomiPostExtractor,
|
||||
"#count" : 7,
|
||||
"#sha1_url" : "fb956ccedcf2cf509739d26e2609e910244aa56c",
|
||||
"#sha1_metadata": "516ca5cbd0d2a46a8ce26679d6e08de5ac42184b",
|
||||
"#urls" : (
|
||||
"https://w.gold-usergeneratedcontent.net/3/94/085e55e355808c03dedbe74fe44db1c07435e071952e8b925a3dfe5ec3278943.webp",
|
||||
"https://w.gold-usergeneratedcontent.net/e/78/0fb5675f47e981650ab7a549cc8d90230ab0d249f35247258f6a7ceb81dd578e.webp",
|
||||
"https://w.gold-usergeneratedcontent.net/3/68/f3cde060f8e9047171bebb70e62947375ef6bdc0160f2f37ea4d5d25ebfde683.webp",
|
||||
"https://w.gold-usergeneratedcontent.net/e/41/888f1c268928adf77de609b50ade88a40f117b737cbaa1bdc264ccc2d074641e.webp",
|
||||
"https://w.gold-usergeneratedcontent.net/6/c0/d035d2851a6e8b24473d1c575e3f3df1cbee5ad2b002758c3546439dc959bc06.webp",
|
||||
"https://w.gold-usergeneratedcontent.net/b/b4/c527b2c6dde4124bdb8d7c0f061a03743aee36ccd2c8f707fd347674fc4e2b4b.webp",
|
||||
"https://w.gold-usergeneratedcontent.net/9/3a/c8b6f23fc86669724373c89d436fbc33b47078a38457243d24e80e76ad7e43a9.webp",
|
||||
),
|
||||
},
|
||||
|
||||
{
|
||||
@@ -56,7 +61,7 @@ __tests__ = (
|
||||
"#comment" : "gif",
|
||||
"#category": ("", "nozomi", "post"),
|
||||
"#class" : nozomi.NozomiPostExtractor,
|
||||
"#pattern" : r"https://g\.nozomi\.la/a/f0/d1b06469e00d72e4f6346209c149db459d76b58a074416c260ed93cc31fa9f0a\.gif",
|
||||
"#urls" : "https://g.gold-usergeneratedcontent.net/a/f0/d1b06469e00d72e4f6346209c149db459d76b58a074416c260ed93cc31fa9f0a.gif",
|
||||
"#sha1_content": "952efb78252bbc9fb56df2e8fafb68d5e6364181",
|
||||
},
|
||||
|
||||
@@ -65,7 +70,7 @@ __tests__ = (
|
||||
"#comment" : "video",
|
||||
"#category": ("", "nozomi", "post"),
|
||||
"#class" : nozomi.NozomiPostExtractor,
|
||||
"#pattern" : r"https://v\.nozomi\.la/d/0e/ff88398862669783691b31519f2bea3a35c24b6e62e3ba2d89b4409e41c660ed\.webm",
|
||||
"#urls" : "https://v.gold-usergeneratedcontent.net/d/0e/ff88398862669783691b31519f2bea3a35c24b6e62e3ba2d89b4409e41c660ed.webm",
|
||||
"#sha1_content": "57065e6c16da7b1c7098a63b36fb0c6c6f1b9bca",
|
||||
},
|
||||
|
||||
@@ -91,7 +96,7 @@ __tests__ = (
|
||||
"#url" : "https://nozomi.la/tag/3:1_aspect_ratio-1.html",
|
||||
"#category": ("", "nozomi", "tag"),
|
||||
"#class" : nozomi.NozomiTagExtractor,
|
||||
"#pattern" : r"^https://[wgv]\.nozomi\.la/\w/\w\w/\w+\.\w+$",
|
||||
"#pattern" : r"^https://[wgv]\.gold-usergeneratedcontent\.net/\w/\w\w/\w+\.\w+$",
|
||||
"#range" : "1-25",
|
||||
"#count" : ">= 25",
|
||||
},
|
||||
@@ -100,7 +105,7 @@ __tests__ = (
|
||||
"#url" : "https://nozomi.la/search.html?q=hibiscus%203:4_ratio#1",
|
||||
"#category": ("", "nozomi", "search"),
|
||||
"#class" : nozomi.NozomiSearchExtractor,
|
||||
"#count" : ">= 5",
|
||||
"#count" : range(5, 10),
|
||||
},
|
||||
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user