mvabdi / vsco-scraper

Easily allows for scraping a VSCO
MIT License
133 stars 25 forks source link

Program crashes when attempting to download images from a user whose username ends with a hyphen #18

Closed Edgeburn closed 3 years ago

Edgeburn commented 3 years ago

Upon trying to download images from an account whose username ends with a hyphen, the program crashes with a KeyError. I have tested this in both macOS and Linux and it crashes in both.

This is the error that is output

[REDACTED]@ubuntu:~$ ./.local/bin/vsco-scraper "example-username-that-would-crash-" --getImages
Traceback (most recent call last):
  File "/home/[REDACTED]/./.local/bin/vsco-scraper", line 8, in <module>
    sys.exit(main())
  File "/home/[REDACTED]/.local/lib/python3.9/site-packages/vscoscrape/vscoscrape.py", line 364, in main
    scraper = Scraper(args.username)
  File "/home/[REDACTED]/.local/lib/python3.9/site-packages/vscoscrape/vscoscrape.py", line 28, in __init__
    self.newSiteId()
  File "/home/[REDACTED]/.local/lib/python3.9/site-packages/vscoscrape/vscoscrape.py", line 39, in newSiteId
    self.siteid = res.json()["sites"][0]["id"]
KeyError: 'sites'
[REDACTED]@ubuntu:~$ 
Edgeburn commented 3 years ago

So this isn't actually a bug, I just made the same typo over and over of the username. Oops.