diff --git a/lib/WPImport.py b/lib/WPImport.py index e28cf1a..f1627ae 100644 --- a/lib/WPImport.py +++ b/lib/WPImport.py @@ -139,6 +139,24 @@ class WPimport: self._logger.error("{0} : Exception error for get author : {1}".format(self._name, err)) 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): self._logger.info("{0} : Add/Update Album".format(self._name)) albumbody = soup.find("div", class_="albumbody")