*get useful image metadata for the image found at a give Flickr share URL*

        **Key Arguments:**
            - ``url`` -- the share URL for the flickr image (or just the unique photoid)

        **Return:**
            - ``images`` -- a dictionary of the various image sizes that can be accessed (key is the width in pixels and value is the direct image URL)
            - ``title`` -- the title of the image as set by the user
            - ``desc`` -- the description of the image as set by the user
            - ``photoId`` -- the unique photoID of the image

        **Usage:**

            To get some associated metadata related to the image at a given Flcikr share URL run the `get_photo_metadata` method. Note the URL can be any of the various Flickr URL flavours.

            .. code-block:: python

                from picaxe import picaxe
                flickr = picaxe(
                    log=log,
                    settings=settings
                )
                images, title, desc, photoId = flickr.get_photo_metadata(
                    url="https://www.flickr.com/photos/92344046@N06/30455210056")

                images, title, desc, photoId= flickr.get_photo_metadata(
                    url="https://www.flickr.com/gp/923440134@N06/0930a6")

                images, title, desc, photoId = flickr.get_photo_metadata(
                    url="http://flic.kr/p/NpdUV5")

                images, title, desc, photoId = flickr.get_photo_metadata(
                    url=30455210056)

def get_photo_metadata(
            self,
            url):
        """*get useful image metadata for the image found at a give Flickr share URL*

        **Key Arguments:**
            - ``url`` -- the share URL for the flickr image (or just the unique photoid)

        **Return:**
            - ``images`` -- a dictionary of the various image sizes that can be accessed (key is the width in pixels and value is the direct image URL)
            - ``title`` -- the title of the image as set by the user
            - ``desc`` -- the description of the image as set by the user
            - ``photoId`` -- the unique photoID of the image

        **Usage:**

            To get some associated metadata related to the image at a given Flcikr share URL run the `get_photo_metadata` method. Note the URL can be any of the various Flickr URL flavours.

            .. code-block:: python

                from picaxe import picaxe
                flickr = picaxe(
                    log=log,
                    settings=settings
                )
                images, title, desc, photoId = flickr.get_photo_metadata(
                    url="https://www.flickr.com/photos/92344046@N06/30455210056")

                images, title, desc, photoId= flickr.get_photo_metadata(
                    url="https://www.flickr.com/gp/923440134@N06/0930a6")

                images, title, desc, photoId = flickr.get_photo_metadata(
                    url="http://flic.kr/p/NpdUV5")

                images, title, desc, photoId = flickr.get_photo_metadata(
                    url=30455210056)

        """
        self.log.info('starting the ``get_photo_metadata`` method')

        photoid = None
        if "flic" not in url and "/" not in url:
            photoid = url.strip()
        elif "flic.kr" in url:
            base58 = url.split("/")[-1]
            alphabet = '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'
            base_count = len(alphabet)
            photoid = 0
            multi = 1
            base58 = base58[::-1]
            for char in base58:
                photoid += multi * alphabet.index(char)
                multi = multi * base_count
        else:
            regex = re.compile(
                r'http(s)?\:\/\/www\.flickr\.com/photos/[^/]*/(?P<photoid>\d*)(/)?', re.S)
            matchObject = regex.match(url)

            if not matchObject:
                response = requests.get(url)
                matchObject = regex.match(response.url)
                if not matchObject:
                    if response.history:
                        for resp in response.history:
                            matchObject = regex.match(resp.url)
                            if matchObject:
                                break
            if not matchObject:
                self.log.error(
                    'cound not get flickr photoid from the URL, can\'t continue' % locals())
            else:
                photoid = matchObject.group("photoid")

        if not photoid:
            return "Could not get photoId"

        try:
            response = requests.get(
                url="https://api.flickr.com/services/rest/",
                params={
                    "method": "flickr.photos.getSizes",
                    "photo_id": photoid,
                    "format": "json",
                    "nojsoncallback": "1",
                },
                auth=self.auth,
            )
        except requests.exceptions.RequestException:
            print('HTTP Request failed')

        data = response.json()

        images = {}
        for image in data["sizes"]["size"]:
            images[image["width"]] = image["source"]
            if image["label"].lower() == "original":
                images["original"] = image["source"]

        try:
            response = requests.get(
                url="https://api.flickr.com/services/rest/",
                params={
                    "method": "flickr.photos.getInfo",
                    "photo_id": photoid,
                    "format": "json",
                    "nojsoncallback": "1",
                },
                auth=self.auth,
            )
        except requests.exceptions.RequestException:
            print('HTTP Request failed')

        data = response.json()
        title = data["photo"]["title"]["_content"]
        desc = data["photo"]["description"]["_content"]
        photoId = data["photo"]["id"]

        self.log.info('completed the ``get_photo_metadata`` method')
        return images, title, desc, photoId