@@ -56,10 +56,10 @@ def generate_atom_feed(feed_url: str, feed_dict: dict):
56
56
try :
57
57
source_feed = feed_dict ['feed' ]
58
58
pubdate = mktime (source_feed .get ('published_parsed' ))
59
- pubdate = datetime .fromtimestamp (pubdate , tz = timezone .utc ) if pubdate else ''
59
+ pubdate = datetime .fromtimestamp (pubdate , tz = timezone .utc ) if pubdate else None
60
60
61
61
updated = mktime (source_feed .get ('updated_parsed' ))
62
- updated = datetime .fromtimestamp (updated , tz = timezone .utc ) if updated else ''
62
+ updated = datetime .fromtimestamp (updated , tz = timezone .utc ) if updated else None
63
63
64
64
title = get_first_non_none (source_feed , 'title' , 'subtitle' , 'info' )
65
65
subtitle = get_first_non_none (source_feed , 'subtitle' )
@@ -75,8 +75,8 @@ def generate_atom_feed(feed_url: str, feed_dict: dict):
75
75
fg .link (href = link , rel = 'alternate' )
76
76
fg .subtitle (subtitle )
77
77
fg .language (language )
78
- fg .updated (source_feed . get ( ' updated' ) )
79
- fg .pubDate (source_feed . get ( 'published' ) )
78
+ fg .updated (updated )
79
+ fg .pubDate (pubdate )
80
80
81
81
if not fg .title ():
82
82
fg .title (updated .strftime ("%Y-%m-%d %H:%M:%S" ))
@@ -87,10 +87,10 @@ def generate_atom_feed(feed_url: str, feed_dict: dict):
87
87
88
88
for entry in feed_dict ['entries' ]:
89
89
pubdate = mktime (entry .get ('published_parsed' ))
90
- pubdate = datetime .fromtimestamp (pubdate , tz = timezone .utc ) if pubdate else ''
90
+ pubdate = datetime .fromtimestamp (pubdate , tz = timezone .utc ) if pubdate else None
91
91
92
92
updated = mktime (entry .get ('updated_parsed' ))
93
- updated = datetime .fromtimestamp (updated , tz = timezone .utc ) if updated else ''
93
+ updated = datetime .fromtimestamp (updated , tz = timezone .utc ) if updated else None
94
94
95
95
title = entry .get ('title' )
96
96
link = get_first_non_none (entry , 'link' )
@@ -106,8 +106,8 @@ def generate_atom_feed(feed_url: str, feed_dict: dict):
106
106
fe .author ({'name' : author_name })
107
107
fe .id (unique_id )
108
108
fe .content (content )
109
- fe .updated (entry . get ( ' updated' ) )
110
- fe .pubDate (entry . get ( 'published' ) )
109
+ fe .updated (updated )
110
+ fe .pubDate (pubdate )
111
111
fe .summary (summary )
112
112
113
113
# id, title, updated are required
0 commit comments