Skip to content

Instantly share code, notes, and snippets.

@njmulsqb
Created June 12, 2022 15:46
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save njmulsqb/1e78fceee4598734401e79aa7781a7d3 to your computer and use it in GitHub Desktop.
Save njmulsqb/1e78fceee4598734401e79aa7781a7d3 to your computer and use it in GitHub Desktop.
This is the wrapper I made around SourceMapper tool to fetch sourcemaps on large scale. Blog post: https://njmulsqb.github.io/2022/05/31/Hunting-Sourcemaps-On-Steroids.html
import sys
import subprocess
import os
parentDir = 'sourceMapsToJS'
sourceMapURL = sys.argv[1]
dirName = sourceMapURL.strip(
'https://').strip('http://').strip('www.').replace('/', '-').replace('.', '-')
if not os.path.exists(parentDir):
os.mkdir(parentDir)
os.chdir(parentDir)
subprocess.call(['sourcemapper', '-url', sourceMapURL, '-output', dirName])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment