mirror of
https://github.com/hastagAB/Awesome-Python-Scripts.git
synced 2024-11-27 14:01:09 +00:00
19 lines
418 B
Python
19 lines
418 B
Python
|
import argparse
|
||
|
import requests
|
||
|
|
||
|
aq = argparse.ArgumentParser()
|
||
|
aq.add_argument('-i', '--input', required=True, help="input image link")
|
||
|
|
||
|
aq.add_argument('-k', '--apikey', required=True, help="api-key")
|
||
|
|
||
|
args = vars(aq.parse_args())
|
||
|
|
||
|
r = requests.post(
|
||
|
"https://api.deepai.org/api/toonify",
|
||
|
files={
|
||
|
'image': args['input'],
|
||
|
},
|
||
|
headers={'api-key': args['apikey']}
|
||
|
)
|
||
|
print(r.json()['output_url'])
|