Created
June 12, 2021 12:29
-
-
Save rigwild/7255725ad2ea370f2d36de7a93fcf181 to your computer and use it in GitHub Desktop.
Download tons of AI generated human faces using https://github.com/google/zx
This file contains hidden or 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
#!/usr/bin/env zx | |
const download = async () => { | |
await $`wget -nv -O - https://thispersondoesnotexist.com/image > file.jpg` | |
const sha1 = (await $`sha1sum file.jpg`).toString().split(' ')[0] | |
const exists = (await $`ls`.pipe(nothrow($`grep ${sha1}.jpg`))).toString().trim() !== '' | |
if (!exists) { | |
$`mv file.jpg ${sha1}.jpg` | |
return true | |
} | |
console.log('Already downloaded this one!') | |
$`rm file.jpg` | |
return false | |
} | |
while (true) { | |
const res = await download() | |
console.log() | |
if (res) await sleep(300) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment