Skip to content

Commit

Permalink
Fix improper parsing of FanFiction profile containing poll
Browse files Browse the repository at this point in the history
  • Loading branch information
adorabilis committed Oct 17, 2019
1 parent 51ea626 commit bc870c8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

| Cog | Version | Description |
| --- | --- | --- |
| ffembed | 1.1.0 | Automatically show FanFiction, AO3, and SIYE story info in an embed message when a supported link is detected. (Commissioned by marclapin#0812) |
| ffembed | 1.1.1 | Automatically show FanFiction, AO3, and SIYE story info in an embed message when a supported link is detected. (Commissioned by marclapin#0812) |
| ffpicker | 1.1.13 | Allow saving and retrieval of FanFiction, AO3, and SIYE stories to and from a curated collection. (Commissioned by marclapin#0812) |

## Installation
Expand Down
9 changes: 5 additions & 4 deletions ffembed/ffembed.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from bs4 import BeautifulSoup
from redbot.core import checks, commands, Config

__version__ = "1.1.0"
__version__ = "1.1.1"

BaseCog = getattr(commands, "Cog", object)

Expand Down Expand Up @@ -137,13 +137,14 @@ def parse_FanFiction_author(self, page, url):
div = page.find(id="content_wrapper_inner")
thumbnail = div.find(id="bio").img
author = div.span
desc = page.find("meta", attrs={"name": "description"})['content']
footer = div.find_all("td")[2].get_text().replace("id", "ID")
desc = page.find("meta", attrs={"name": "description"})["content"]
footer = div.find_all("td", {"colspan": "2"})[2]
footer = footer.get_text().replace("id", "ID")
footer = footer[:6] + ":" + footer[6:]
return {
"link": None,
"icon": "https://i.imgur.com/0eUBQHu.png",
"thumbnail": "https:" + thumbnail['data-original'] if thumbnail else None,
"thumbnail": "https:" + thumbnail["data-original"] if thumbnail else None,
"author": author.get_text(strip=True),
"author_link": url,
"title": None,
Expand Down

0 comments on commit bc870c8

Please sign in to comment.