How to get static image url from flickr URL?

前端 未结 7 1365
长情又很酷
长情又很酷 2020-12-24 01:40

Is it possible to get static image URL from the flickr URL via an api call or some script ?
For eg :
Flickr URL -> http://www.flickr.com/photos/53067560@N00/26581

7条回答
  •  感动是毒
    2020-12-24 02:15

    Get it from the html code of the image. :)

    Parse the atribute style and get your required Static URL :)

    page_soup = soup(page_html,"lxml")
    all_links = page_soup.find("div",{"class":"view photo-list-view requiredToShowOnServer photostream"}).findAll("div",{"class":"view photo-list-photo-view requiredToShowOnServer photostream awake"})
    for link in all_links:
        image_url = link["style"].split("//")[1].replace('");','')
        print(image_url)
    

    The above section of Python code will print out all the images url needed available on Photostream tab in Flickr.

提交回复
热议问题