(url)
Returns the Photo ID for a Photo URL

    >>> get_photo_id('https://farm9.staticflickr.com/8747/12346789012_bf1e234567_b.jpg')
    '12346789012'

    >>> get_photo_id('https://www.flickr.com/photos/someuser/12345678901/')
    '12345678901'
Returns the Photo ID for a Photo URL
Returns the Photo ID for a Photo URL
def get_photo_id(url):
    """Returns the Photo ID for a Photo URL

    >>> get_photo_id('https://farm9.staticflickr.com/8747/12346789012_bf1e234567_b.jpg')
    '12346789012'

    >>> get_photo_id('https://www.flickr.com/photos/someuser/12345678901/')
    '12345678901'

    """

    photo_id_re = [
        "http://.*flickr.com/[^/]+/([^_]+)_.*",
        "https://.*staticflickr.com/[^/]+/([^_]+)_.*",
        "https?://.*flickr.com/photos/[^/]+/([^/]+).*",
    ]

    for regex in photo_id_re:
        match = re.match(regex, url)
        if match:
            return match.group(1)
def get_photo_id ( url ) : photo_id_re = [ "http://.*flickr.com/[^/]+/([^_]+)_.*" , "https://.*staticflickr.com/[^/]+/([^_]+)_.*" , "https?://.*flickr.com/photos/[^/]+/([^/]+).*" , ] for regex in photo_id_re : match = re . match ( regex , url ) if match : return match . group ( 1 )