add private method get info album

This commit is contained in:
Valentin CZERYBA 2023-08-29 22:26:15 +02:00
parent b4d0fe8aa0
commit 2e21040196

View File

@ -139,6 +139,24 @@ class WPimport:
self._logger.error("{0} : Exception error for get author : {1}".format(self._name, err)) self._logger.error("{0} : Exception error for get author : {1}".format(self._name, err))
return author return author
def _getInfoAlbum(self, link):
self._logger.info("{0} : Info album : {1}".format(self._name, link))
link_o = urlparse(link)
if len(link_o.netloc) > 0:
self._logger.info("{0} : get album info from web : {1}".format(self._name, link_o))
try:
response = self._request.get(link)
if response.status_code == 200:
self._logger.info("{0} : get content info from web : {1}".format(self._name, link_o))
except ConnectionError as err:
self._logger.error("{0} : Connection error for get album info : {1}".format(self._name, err))
exit(1)
except Exception as err:
self._logger.error("{0} : Exception error for get album info : {1}".format(self._name, err))
exit(1)
else:
self._logger.info("{0} : get album info from file : {1}".format(self._name, link_o))
def _addOrUpdateAlbum(self, soup): def _addOrUpdateAlbum(self, soup):
self._logger.info("{0} : Add/Update Album".format(self._name)) self._logger.info("{0} : Add/Update Album".format(self._name))
albumbody = soup.find("div", class_="albumbody") albumbody = soup.find("div", class_="albumbody")