fix condition type file
This commit is contained in:
parent
cb64dd47ab
commit
ec4135c5d0
@ -66,7 +66,7 @@ class WPimport:
|
||||
if len(res) == 0:
|
||||
data = page.content
|
||||
img_type = "image/png"
|
||||
if img_name.split(".")[1]:
|
||||
if img_name.split(".")[1] == "jpg" or img_name.split(".")[1] == "jpeg":
|
||||
img_type = "image/jpg"
|
||||
headers={ 'Content-Type': img_type,'Content-Disposition' : 'attachment; filename={0}'.format(img_name)}
|
||||
r = requests.post("http://{0}/wp-json/wp/v2/media".format(self._wordpress), auth=self._basic, headers=headers, data=data)
|
||||
|
Loading…
x
Reference in New Issue
Block a user