This program is intended to gather VSCO images from my personal VSCO account, but it can be used with any public account. Due to VSCO not having an open API I needed to do a bit of reverse engineering to figure out the endpoints I needed to access in order to be able to do this.
Request | Description |
---|---|
GET https://vsco.co/content/Static/userinfo?callback=60 | VSCO Session Cookie called vs |
GET https://vsco.co/ajxp/{$vs_goes_here}/2.0/sites?subdomain={$account_name} | The id field is needed from sites |
GET https://vsco.co/ajxp/{$vs_goes_here}/2.0/medias?site_id={$site_id} | This endpoint returns your all your photos and videos |
Using these routes allow me to download all my images from my VSCO account and tag them with the tags I have posted the photo with.This then allows me to set up a route on my own server to return photos to my portfolio website.
The last request above is used to pull all data from the medias
collect under a VSCO account which is all photos and videos.
Once all posts are collected, I filter out the hashtags as I will use them with the naming of the photo with the upload_date
when I download it locally. The reason for this(for now) is, that I can then use another program to fetch images by location
and upload date as the location would be one of the hashtags in a post.
Python 3.8+
Install requirements:
pip3 install -r requirements.txt
Run the program:
usage: vsco_parser.py [-h] [-a] [-p] [-c] username
positional arguments:
username The account username of which you which to scrape gallery data from.
optional arguments:
-h, --help show this help message and exit
-a, --allImages Downloads all files from a users VSCO profile
-p, --printRawImageData
Prints all the json information from the last download request
-c, --collectImageURLData
Collects and store only the image URL, location tag, and timedate stamp