mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Merge branch 'master' of https://github.com/deepakanand/calibre
This commit is contained in:
commit
2b83eaec16
@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env python
|
||||
import datetime
|
||||
import json
|
||||
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
@ -73,6 +74,11 @@ class TheWire(BasicNewsRecipe):
|
||||
continue
|
||||
if not b.get('post_type', '') == 'post':
|
||||
continue
|
||||
now = datetime.now(datetime.timezone.utc) # Ensure 'now' is offset-aware
|
||||
post_date = datetime.strptime(b['post_date'], '%Y-%m-%d %H:%M:%S').replace(tzinfo=datetime.timezone.utc) # Make 'post_date' offset-aware
|
||||
if (now - post_date).days > 1:
|
||||
self.log('Skipping', title, 'as it is too old')
|
||||
continue
|
||||
title = b['post_title']
|
||||
desc = b['post_excerpt']
|
||||
slg = b['categories'][0]['slug'] + '/' + b['post_name']
|
||||
|
Loading…
x
Reference in New Issue
Block a user