mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-22 02:32:33 +01:00
[naver] recognize '.naver' URLs
https://blog.naver.com/PostView.naver?…
This commit is contained in:
parent
36fc510d3a
commit
7b28418f69
@ -26,7 +26,8 @@ class NaverPostExtractor(NaverBase, GalleryExtractor):
|
||||
"{post[date]:%Y-%m-%d} {post[title]}")
|
||||
archive_fmt = "{blog[id]}_{post[num]}_{num}"
|
||||
pattern = (r"(?:https?://)?blog\.naver\.com/"
|
||||
r"(?:PostView\.nhn\?blogId=(\w+)&logNo=(\d+)|(\w+)/(\d+)/?$)")
|
||||
r"(?:PostView\.n(?:aver|hn)\?blogId=(\w+)&logNo=(\d+)|"
|
||||
r"(\w+)/(\d+)/?$)")
|
||||
example = "https://blog.naver.com/BLOGID/12345"
|
||||
|
||||
def __init__(self, match):
|
||||
@ -73,7 +74,8 @@ class NaverBlogExtractor(NaverBase, Extractor):
|
||||
subcategory = "blog"
|
||||
categorytransfer = True
|
||||
pattern = (r"(?:https?://)?blog\.naver\.com/"
|
||||
r"(?:PostList.nhn\?(?:[^&#]+&)*blogId=([^&#]+)|(\w+)/?$)")
|
||||
r"(?:PostList\.n(?:aver|hn)\?(?:[^&#]+&)*blogId=([^&#]+)|"
|
||||
r"(\w+)/?$)")
|
||||
example = "https://blog.naver.com/BLOGID"
|
||||
|
||||
def __init__(self, match):
|
||||
@ -81,12 +83,11 @@ class NaverBlogExtractor(NaverBase, Extractor):
|
||||
self.blog_id = match.group(1) or match.group(2)
|
||||
|
||||
def items(self):
|
||||
|
||||
# fetch first post number
|
||||
url = "{}/PostList.nhn?blogId={}".format(self.root, self.blog_id)
|
||||
post_num = text.extract(
|
||||
post_num = text.extr(
|
||||
self.request(url).text, 'gnFirstLogNo = "', '"',
|
||||
)[0]
|
||||
)
|
||||
|
||||
# setup params for API calls
|
||||
url = "{}/PostViewBottomTitleListAsync.nhn".format(self.root)
|
||||
|
@ -24,6 +24,12 @@ __tests__ = (
|
||||
"#sha1_metadata": "a6e23d19afbee86b37d6e7ad934650c379d2cb1e",
|
||||
},
|
||||
|
||||
{
|
||||
"#url" : "https://blog.naver.com/PostView.naver?blogId=rlfqjxm0&logNo=221430673006",
|
||||
"#category": ("", "naver", "post"),
|
||||
"#class" : naver.NaverPostExtractor,
|
||||
},
|
||||
|
||||
{
|
||||
"#url" : "https://blog.naver.com/gukjung",
|
||||
"#category": ("", "naver", "blog"),
|
||||
@ -42,4 +48,10 @@ __tests__ = (
|
||||
"#count" : 12,
|
||||
},
|
||||
|
||||
{
|
||||
"#url" : "https://blog.naver.com/PostList.naver?blogId=gukjung",
|
||||
"#category": ("", "naver", "blog"),
|
||||
"#class" : naver.NaverBlogExtractor,
|
||||
},
|
||||
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user