xchwarze / samsung-tv-ws-api

Samsung Smart TV WS API wrapper
GNU Lesser General Public License v3.0
255 stars 42 forks source link

How to download a thumbnail of artwork? #113

Closed photonforge closed 2 years ago

photonforge commented 2 years ago

Hi, i would like to save the thumbnail of artwork so that i can display on home assistant.

# Retrieve a thumbnail for a specific piece of art. Returns a JPEG.
thumbnail = tv.art().get_thumbnail('SAM-F0206')

using the above line i am able to get a bitarray file, i am not able to save that as a jpeg. how do i convert it into a jpeg?

Thanks in advance.

photonforge commented 2 years ago

Figured it out..

  img = tv.art().get_thumbnail(SAM-F0201)
  image = Image.open(io.BytesIO(img))
  image.save("thumbnail.jpg")