I would get the filename from the URL directly and not make use of scraper.target, which can be wrong. Means that would also need a test.