This commit is contained in:
Kovid Goyal 2025-01-05 14:52:18 +05:30
parent d2ff5bb2dd
commit bff5e922ae
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 3 additions and 4 deletions

View File

@ -2,7 +2,6 @@
# vim:fileencoding=utf-8
import json
import re
from datetime import date
from calibre.web.feeds.news import BasicNewsRecipe, classes

View File

@ -11,8 +11,8 @@ lwn.net
import re
import sys
from calibre.web.feeds.news import BasicNewsRecipe
from calibre.utils.date import now as nowf
from calibre.web.feeds.news import BasicNewsRecipe
class WeeklyLWN(BasicNewsRecipe):
@ -87,7 +87,7 @@ class WeeklyLWN(BasicNewsRecipe):
return self.pub_date
def parse_publication_date(self, soup):
from dateutil.parser import parse, ParserError
from dateutil.parser import ParserError, parse
try:
date_match = re.match(r'.* +for +([^\[]*)', self.tag_to_string(soup.head.title.string))
# dateutil.parser.parse() is considered thread-safe