IYKYK. 😄
Working on Ubuntu 20.04 hosted by DigitalOcean. YMMV.
- python3
- pip3
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome-stable_current_amd64.deb
git clone https://github.com/byalextran/southwest-headers
cd southwest-headers
pip3 install virtualenv
virtualenv env
env/bin/pip install -r requirements.txt
Figure out what version of Chrome you've installed.
google-chrome --version
Download the same version of ChromeDriver into the southwest-headers
directory and unzip it.
Example:
wget https://chromedriver.storage.googleapis.com/96.0.4664.45/chromedriver_linux64.zip
unzip chromedriver_linux64.zip
This is necessary so Southwest doesn't detect Selenium and provide invalid headers. Huge hat tip.
Note: Replace dog
in the command below with exactly three random alphabetic characters.
perl -pi -e 's/cdc_/dog_/g' chromedriver
No arguments saves the headers to southwest_headers.json
in the current directory.
env/bin/python southwest-headers.py
Include an argument if you want to specify where the headers are saved to.
env/bin/python southwest-headers.py /PATH/TO/FILENAME.json
The JSON file can then be used in whatever app to auto check-in (assuming the script adds support for reading this file).
I've added support in my script here:
https://github.com/byalextran/southwest-checkin
For now, I'd recommend running this script as a daily cronjob to ensure headers are refreshed regularly. They change periodically, so if this isn't done there's a chance you'll have expired headers when you try to check in.
crontab -e
And then copy/paste the following at the end of the file (making sure to update it with the absolute path):
0 2 * * * cd /ABSOLUTE/PATH/TO/southwest-headers/ && env/bin/python southwest-headers.py
That would run at 2:00am every day with the file southwest_headers.json
(the default filename) saved in the southwest-headers
folder.