diff path network
This commit is contained in:
parent
f01a69a1e7
commit
04da5bc5f6
@ -445,9 +445,12 @@ class WPimport:
|
||||
if len(img) > 0:
|
||||
href_a = i.get("href")
|
||||
href_img = img[0].get("src")
|
||||
href_a_o = urlparse(href_a)
|
||||
href_img_o = urlparse(href_img)
|
||||
new_img["old_src"]=href_img
|
||||
new_img["old_href"]=href_a
|
||||
try:
|
||||
if len(href_img_o.netloc) > 0:
|
||||
page_img = self._request.get(href_img)
|
||||
|
||||
if page_img.status_code == 404:
|
||||
@ -460,6 +463,9 @@ class WPimport:
|
||||
except Exception as err:
|
||||
self._logger.error("{0} : Exception error for get image : {1}".format(self._name, err))
|
||||
exit(1)
|
||||
else:
|
||||
if os.path.exists(href_img):
|
||||
page_img = open(href_img, "r")
|
||||
self._logger.debug("{0} : Status code for image {1} : {2}".format(self._name, href_img, page_img.status_code))
|
||||
if page_img.status_code == 200:
|
||||
media=self._addOrUpdateMedia(href_img, page_img)
|
||||
|
Loading…
x
Reference in New Issue
Block a user