Skip to content

Commit

Permalink
Fix Issue where work URLs were sometimes malformed (#124)
Browse files Browse the repository at this point in the history
Sometimes, a url sent to `get_full_work_url` would contain the absolute URL instead of the relative URL. When this happened, the output of `get_full_work_url` contained the AO3 base URL twice.

Since the work URL always follows the exact same pattern, I set that pattern here.
  • Loading branch information
DDriggs00 authored Jan 31, 2024
1 parent 81e8907 commit aaeeb59
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ao3downloader/parse_soup.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def get_full_work_url(url: str) -> str:
"""Get full ao3 work url from partial url"""

work_number = parse_text.get_work_number(url)
return strings.AO3_BASE_URL + url.split(work_number)[0] + work_number
return strings.AO3_BASE_URL + "/works/" + work_number


def get_series_urls(soup: BeautifulSoup, get_all: bool) -> list[str]:
Expand Down

0 comments on commit aaeeb59

Please sign in to comment.