From f296067797583ba90f4b5294f28966e04bbb6bff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Wed, 6 Mar 2024 00:46:19 +0100 Subject: [PATCH] [naver] unescape post 'title' and 'description' --- gallery_dl/extractor/naver.py | 6 ++++-- test/results/naver.py | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/gallery_dl/extractor/naver.py b/gallery_dl/extractor/naver.py index 1c85d361..d3150e6d 100644 --- a/gallery_dl/extractor/naver.py +++ b/gallery_dl/extractor/naver.py @@ -47,8 +47,10 @@ class NaverPostExtractor(NaverBase, GalleryExtractor): extr = text.extract_from(page) data = { "post": { - "title" : extr('"og:title" content="', '"'), - "description": extr('"og:description" content="', '"'), + "title" : text.unescape(extr( + '"og:title" content="', '"')), + "description": text.unescape(extr( + '"og:description" content="', '"')).replace(" ", " "), "num" : text.parse_int(self.post_id), }, "blog": { diff --git a/test/results/naver.py b/test/results/naver.py index 0dc0e368..a763a5b5 100644 --- a/test/results/naver.py +++ b/test/results/naver.py @@ -41,9 +41,9 @@ __tests__ = ( }, "post": { "date" : "dt:2013-03-05 17:48:00", - "description": " ◈     PROMOTER :핑수 ˚ 아담 EDITOR:핑수   넵:이크:핑수...", + "description": " ◈ PROMOTER :핑수 ˚ 아담 EDITOR:핑수 넵:이크:핑수...", "num" : 70161391809, - "title" : "[공유] { 합작}  OH, MY GOD! ~ 아 또 무슨 종말을 한다 그래~" + "title" : "[공유] { 합작}  OH, MY GOD! ~ 아 또 무슨 종말을 한다 그래~", }, "count" : 2, "num" : range(1, 2),