diff --git a/post_parser.py b/post_parser.py index c38b22d..a2d496d 100644 --- a/post_parser.py +++ b/post_parser.py @@ -102,13 +102,13 @@ class PostParser: if message.sender_chat: title = getattr(message.sender_chat, 'title', '').strip() username = getattr(message.sender_chat, 'username', '').strip() - return f"{title} by @{username}" if username else title + return f"{title} (@{username})" if username else title elif message.from_user: first = getattr(message.from_user, 'first_name', '').strip() last = getattr(message.from_user, 'last_name', '').strip() username = getattr(message.from_user, 'username', '').strip() name = ' '.join(filter(None, [first, last])) - return f"{name} by @{username}" if username else name + return f"{name} (@{username})" if username else name return "Unknown author" def _generate_title(self, message: Message) -> str: diff --git a/rss_generator.py b/rss_generator.py index e235792..283dae5 100644 --- a/rss_generator.py +++ b/rss_generator.py @@ -50,9 +50,7 @@ async def generate_channel_rss(channel: str, post_parser: Optional[PostParser] = fg.link(href=f"https://t.me/{channel}", rel='alternate') fg.description(f'Telegram channel {channel} RSS feed') fg.language('ru') - #fg.dc.dc_creator(f"@{channel}") - - + fg.id(f"{base_url}/rss/{channel}") # First collect all posts @@ -127,7 +125,7 @@ async def generate_channel_rss(channel: str, post_parser: Optional[PostParser] = fe.pubDate(pub_date) fe.guid(post_link, permalink=True) - if post.get('author') and post['author'] != channel: + if post.get('author') and post['author'] != main_name: fe.author(name="", email=post['author']) rss_feed = fg.rss_str(pretty=True)