summaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/2chan.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@ubuntu.com>2019-12-25 19:40:28 -0500
committerLibravatarUnit 193 <unit193@ubuntu.com>2019-12-25 19:40:28 -0500
commitf9a1a9dcb7df977eeac9544786df9c0b93795815 (patch)
tree8cb69cf7685da8d7e4deb7dc1d6b209098e1ddfb /gallery_dl/extractor/2chan.py
parent0c73e982fa596da07f23b377621ab894a9e64884 (diff)
New upstream version 1.12.1upstream/1.12.1
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]