insert #6

Merged
v4l3n71n merged 60 commits from insert into master 2023-04-11 21:29:54 +00:00
Showing only changes of commit ec4135c5d0 - Show all commits

View File

@ -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)