


import requests

__UpperCamelCase     :    int 	=				'YOUR API KEY'





def 	_UpperCAmelCase							(  UpperCAmelCase   :      Any    ,						UpperCAmelCase   :      Any = giphy_api_key   ):
      """simple docstring"""




      __lowerCamelCase  :   Any							    =    """+""".join(query.split()   )
      __lowerCamelCase  :   List[str]							    =    f"""https://api.giphy.com/v1/gifs/search?q={formatted_query}&api_key={api_key}"""
      __lowerCamelCase  :   Any							    =    requests.get(UpperCamelCase_   ).json()["""data"""]
      return [gif["url"] for gif in gifs]


if __name__ == "__main__":
    print('\n'.join(get_gifs('space ship')))




from datetime import datetime

import requests
from bsa import BeautifulSoup

if __name__ == "__main__":
     _SCREAMING_SNAKE_CASE 		=      input("""Enter image url: """).strip()
     print(F'''Downloading image from {url} ...''')
     _SCREAMING_SNAKE_CASE 		=      BeautifulSoup(requests.get(url).content, """html.parser""")
     # The image URL is in the content field of the first meta tag with property og:image
     _SCREAMING_SNAKE_CASE 		=      soup.find("""meta""", {"""property""": """og:image"""})["""content"""]
     _SCREAMING_SNAKE_CASE 		=      requests.get(image_url).content
     _SCREAMING_SNAKE_CASE 		=      F'''{datetime.now():%Y-%m-%d_%H:%M:%S}.jpg'''
     with open(file_name, """wb""") as fp:
          fp.write(image_data)
     print(F'''Done. Image saved to disk as {file_name}.''')
