Skip to content

Instantly share code, notes, and snippets.

View huntfx's full-sized avatar

Peter Hunt huntfx

View GitHub Profile
@huntfx
huntfx / reddit-user-downloader.py
Last active April 2, 2024 23:21
Download all the media on a Reddit user profile.
"""This is a basic script I mashed together to download all the media on a users profile.
Nothing else I found seemed to work well, so I added support for all the media types I came across.
The code isn't particularly clean or optimised, it just gets the job done.
Usage:
UserDownloader(username).download()
It will download to `current_dir/username/filename.ext`.
An SQLite database saved in the same folder is used to ignore duplicate urls and file hashes.
@huntfx
huntfx / kelpergl-location-history.py
Created July 17, 2023 08:02
Quick script to convert the Google Location History "Records.json" into a format compatible with kepler.gl
import csv
import json
# Open the JSON file and read its contents
print('Loading data...')
with open('Records.json') as json_file:
data = json.load(json_file)
# Create a CSV file and write the headers
print('Processing data...')
@huntfx
huntfx / decrypt-mysql-workbench-user-data.py
Created August 1, 2023 12:58
Read and decrypt the user data from MySQL workbench.
import os
import re
import win32crypt # Requires pywin32 package
WORKBENCH_REGEX = re.compile(
'(?P<dbm>[A-z]+)'
'@'
'(?P<host>[A-z0-9._-]+)'
':'