Skip to content

Commit

Permalink
Fix issue with index out of range for simpcity
Browse files Browse the repository at this point in the history
  • Loading branch information
jbsparrow committed Nov 16, 2024
1 parent 211f19c commit c9f95c7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cyberdrop_dl/scraper/crawlers/simpcity_crawler.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ async def forum(self, scrape_item: ScrapeItem) -> None:
scrape_item.children_limit = self.manager.config_manager.settings_data["Download_Options"][
"maximum_number_of_children"
][scrape_item.type]
post_sections = (scrape_item.url.parts[3], scrape_item.url.fragment)
if len(scrape_item.url.parts) > 3 and any("post-" in sec for sec in post_sections):

if len(scrape_item.url.parts) > 3 and any("post-" in sec for sec in (scrape_item.url.parts[3], scrape_item.url.fragment)):
url_parts = str(scrape_item.url).rsplit("post-", 1)
thread_url = URL(url_parts[0].rstrip("#"))
post_number = int(url_parts[-1].strip("/")) if len(url_parts) == 2 else 0
Expand Down

0 comments on commit c9f95c7

Please sign in to comment.