remove trailing backslashes from url

This commit is contained in:
iou1name 2018-04-03 17:15:50 -04:00
parent a98d839bb6
commit 0141323473

View File

@ -16,7 +16,8 @@ def Scrape(thread_url, output=None, original_filename=False, combo=False):
"""
Downloads thread page, extracts file urls and saves them to a directory.
"""
thread_url = re.sub(r"/?#.*$", "", thread_url)
thread_url = re.sub(r"\/(?:#.+)?$", "", thread_url)
# regex removes trailing backslashes and post number anchors
s = requests.Session()
s.headers.update(HEADERS)