Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions moddb/pages/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ class File(BaseMetaClass):
Description of the file, as written by the author
preview : str
URL of the preview image for the file
game : str
The name of the game that the file is attached to.
"""

def __init__(self, html: bs4.BeautifulSoup):
Expand All @@ -106,6 +108,11 @@ def __init__(self, html: bs4.BeautifulSoup):
downloads = html.find("h5", string="Downloads").parent.a.string
self.today = int(re.sub(r"[(),today]", "", downloads.split(" ")[1]))
self.downloads = int(downloads.split(" ")[0].replace(",", ""))
location = html.find("h5", string="Location").parent.find_all('a')
if location[0].string == "Games":
self.game = location[1].string
else:
self.game = "None"

try:
self.category = FileCategory(
Expand Down