[bilibili] extract files from 'module_top' entries (#6687)
This commit is contained in:
@@ -56,6 +56,13 @@ class BilibiliArticleExtractor(BilibiliExtractor):
|
||||
article["username"] = modules["module_author"]["name"]
|
||||
|
||||
pics = []
|
||||
|
||||
if "module_top" in modules:
|
||||
try:
|
||||
pics.extend(modules["module_top"]["display"]["album"]["pics"])
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
for paragraph in modules['module_content']['paragraphs']:
|
||||
if "pic" not in paragraph:
|
||||
continue
|
||||
|
||||
@@ -35,6 +35,24 @@ __tests__ = (
|
||||
"width" : 800,
|
||||
},
|
||||
|
||||
{
|
||||
"#url" : "https://www.bilibili.com/opus/977981688469520405",
|
||||
"#comment": "'module_top' file (#6687)",
|
||||
"#class" : bilibili.BilibiliArticleExtractor,
|
||||
"#urls" : (
|
||||
"http://i0.hdslb.com/bfs/new_dyn/c74018e8272c56a6c28a1a1dc3c586311242656443.jpg",
|
||||
),
|
||||
|
||||
"count" : 1,
|
||||
"filename" : "c74018e8272c56a6c28a1a1dc3c586311242656443",
|
||||
"extension": "jpg",
|
||||
"width" : 712,
|
||||
"height" : 1068,
|
||||
"size" : 115.80999755859375,
|
||||
"id" : "977981688469520405",
|
||||
"username" : "诗月饼",
|
||||
},
|
||||
|
||||
{
|
||||
"#url" : "https://space.bilibili.com/405279279/article",
|
||||
"#class" : bilibili.BilibiliUserArticlesExtractor,
|
||||
|
||||
Reference in New Issue
Block a user