Skip to content

Commit

Permalink
title: use rsplit
Browse files Browse the repository at this point in the history
  • Loading branch information
pbui committed Nov 24, 2024
1 parent c044f74 commit c2f5c23
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/bobbit/modules/title.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ async def reddit_title(bot, message, url):

try:
post_title = re.findall(r'<meta property="og:title" content="([^"]+)"', text)[0]
post_title, subreddit = post_title.split(' - ', 1)
post_title, subreddit = post_title.rsplit(' - ', 1)
return message.with_body(bot.client.format_text(
'{color}{green}{}{color}: {bold}{}{bold}',
subreddit, html.unescape(post_title)
Expand Down

0 comments on commit c2f5c23

Please sign in to comment.