Skip to content

Commit

Permalink
Update album.py
Browse files Browse the repository at this point in the history
Downloading images from an album post may have an original file format of webp and can cause an AlbumUnknownFormat exception when attempting to upload an album with it included. 

Including "webp" fixes this. 

Tested on this album post: 
https://www.instagram.com/p/C1u-lMpOFbx/ 

It includes a webp image.

Download folder content after cl.album_download:

['nationhood_3273829132873110682.mp4.jpg', 'nationhood_3273829058499604913.mp4', 'nationhood_3273829132873110682.mp4', 'nationhood_3273829058499604913.mp4.jpg', 'nationhood_3273829210753019095.webp']

I've also encountered ".heic" image file formats when attempting to download image posts, I haven't included it in the commit.
  • Loading branch information
tajbowness authored Jan 15, 2024
1 parent 211f2af commit e46c7b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion instagrapi/mixins/album.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def album_upload(
children = []
for path in paths:
path = Path(path)
if path.suffix.lower() in (".jpg", ".jpeg"):
if path.suffix.lower() in (".jpg", ".jpeg", ".webp"):
upload_id, width, height = self.photo_rupload(path, to_album=True)
children.append(
{
Expand Down

0 comments on commit e46c7b6

Please sign in to comment.