Created
April 17, 2021 20:17
-
-
Save cursorial/d0a168738d601895c7ce4ae05eef57ae to your computer and use it in GitHub Desktop.
Get Instagram Query Hashes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const updateQueryHashes = () => { | |
let urlManifest = window.__s.js | |
let urlManifestKeys = Object.keys(urlManifest) | |
let consumerFilePathKey = urlManifestKeys.filter((key) => { | |
return urlManifest[key].includes('Consumer.js') | |
}) | |
let consumerFilePath = urlManifest[consumerFilePathKey] | |
fetch(consumerFilePath) | |
.then(res => res.text()) | |
.then(data => { | |
const hashes = [...data.matchAll(/["][a-z0-9]{32}["]/g)] | |
postLikesQueryHash = hashes[5][0].replaceAll('"', '') | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment