summaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/2chan.py
diff options
context:
space:
mode:
Diffstat (limited to 'gallery_dl/extractor/2chan.py')
-rw-r--r--gallery_dl/extractor/2chan.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/gallery_dl/extractor/2chan.py b/gallery_dl/extractor/2chan.py
index 33e7929..c34cfec 100644
--- a/gallery_dl/extractor/2chan.py
+++ b/gallery_dl/extractor/2chan.py
@@ -68,6 +68,8 @@ class _2chanThreadExtractor(Extractor):
def parse(self, post):
"""Build post-object by extracting data from an HTML post"""
data = self._extract_post(post)
+ if data["name"]:
+ data["name"] = data["name"].strip()
if '<a href="/' in post:
self._extract_image(post, data)
data["tim"], _, data["extension"] = data["filename"].partition(".")
@@ -78,10 +80,10 @@ class _2chanThreadExtractor(Extractor):
@staticmethod
def _extract_post(post):
return text.extract_all(post, (
- ("no" , 'name="', '"'),
- ("post", '<b>', '</b>'),
- ("name", '<b>', ' </b>'),
- ("now" , '</font> ', ' '),
+ ("post", 'class="csb">' , '<'),
+ ("name", 'class="cnm">' , '<'),
+ ("now" , 'class="cnw">' , '<'),
+ ("no" , 'class="cno">No.', '<'),
(None , '<blockquote', ''),
("com" , '>', '</blockquote>'),
))[0]