mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -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
|
#!/usr/bin/env python
|
||||||
|
import datetime
|
||||||
import json
|
import json
|
||||||
|
|
||||||
from calibre.web.feeds.news import BasicNewsRecipe
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
@ -73,6 +74,11 @@ class TheWire(BasicNewsRecipe):
|
|||||||
continue
|
continue
|
||||||
if not b.get('post_type', '') == 'post':
|
if not b.get('post_type', '') == 'post':
|
||||||
continue
|
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']
|
title = b['post_title']
|
||||||
desc = b['post_excerpt']
|
desc = b['post_excerpt']
|
||||||
slg = b['categories'][0]['slug'] + '/' + b['post_name']
|
slg = b['categories'][0]['slug'] + '/' + b['post_name']
|
||||||
|
Loading…
x
Reference in New Issue
Block a user