Skip to content
This repository was archived by the owner on Jun 26, 2024. It is now read-only.
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions examples/get_chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def main():
"Album",
"Date",
"Genres",
"Secondary Genres",
"RYM Rating",
"Ratings",
"Reviews",
Expand Down
12 changes: 12 additions & 0 deletions rymscraper/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,18 @@ def get_chart_row_infos(row: element.Tag) -> dict:
except Exception as e:
logger.error("Error when fetching Genres: %s", e)
dict_row["Genres"] = "NA"
try:
dict_row["Secondary Genres"] = ", ".join(
[
x.text
for x in row.find(
"div", {"class": "page_charts_section_charts_item_genres_secondary"}
).find_all("a", {"class": "genre"})
]
)
except Exception as e:
logger.error("Error when fetching Secondary Genres (Very likely the album doesn't have secondaries.): %s", e)
dict_row["Secondary Genres"] = "NA"
try:
dict_row["RYM Rating"] = row.find(
"span", {"class": "page_charts_section_charts_item_details_average_num"}
Expand Down