album-plus #24

Merged
v4l3n71n merged 6 commits from album-plus into master 2023-09-01 22:27:59 +00:00
Showing only changes of commit 2e21040196 - Show all commits

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