Skip to content

Commit

Permalink
JSON ContentType
Browse files Browse the repository at this point in the history
  • Loading branch information
krypton-byte committed Oct 22, 2021
1 parent 676debf commit bea8a28
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tiktok_downloader/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ def snapt(path):
return js
except Exception as e:
print(e)
return json.dumps({
return Response(json.dumps({
'msg':'url tidak valid'
})
}), headers={'Content-Type':'application/json'})
elif path not in ['snaptik', 'ssstik', 'tikmate','mdown']:
return json.dumps({'msg':'path tidak ditemukan'})
if request.args.get('url'):
Expand All @@ -72,8 +72,8 @@ def snapt(path):
return Response(json.dumps([{'type':i.type,'url':i.json} for i in res],indent=4), headers={'Content-Type':'application/json'})
except Exception as e:
print(e)
return json.dumps({
return Response(json.dumps({
'msg':'url tidak valid'
})
}, indent=4),headers={'Content-Type':'application/json'})
else:
return json.dumps({'msg':'url parameter required'}, indent=4)

0 comments on commit bea8a28

Please sign in to comment.