Images are being downloaded as .webp instead of .jpg
See original GitHub issueDescribe the bug
Images are being downloaded as .webp
files instead of the usual .jpg
files.
To Reproduce
Steps to reproduce the behavior:
I’m using the Python module.
L = instaloader.Instaloader(download_geotags=False, compress_json=False, filename_pattern='{mediaid}')
I first saved thousands of shortcodes from a particular hashtag by iterating through:
post_iterator = instaloader.NodeIterator(
L.context, "9b498c08113f1e09617a1703c22b2f32",
lambda d: d['data']['hashtag']['edge_hashtag_to_media'],
lambda n: instaloader.Post(L.context, n),
{'tag_name': hashtagname},
f"https://www.instagram.com/explore/tags/{hashtagname}/"
)
Then I downloaded the post using:
post = instaloader.Post.from_shortcode(L.context, 'shortcode')
L.download_post(post, target='target')
This is one of the posts that saved as .webp
:
'CZbzQ5vL0tB'
Expected behavior
Save the image as a .jpg
instead of .webp
Error messages and tracebacks N/A
Instaloader version 4.8.4
Additional context
I had not tried scraping posts since about two weeks ago so it seems like this is something new. I’m only getting .webp
files for posts from this year (although not all). I downloaded 417 posts from this month (February) and the image files I got were 638 jpgs and 106 webps.
I’m not expecting this to be fixed if this is considered an non-issue but I thought I should bring it up
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:14 (1 by maintainers)
The same happens here. Actually, it isn’t strange that the .webp files are exactly the same size of the respective .jpg files. If you inspect them with a hex editor, it turns out that they are in fact regular .jpg files: they were simply given the wrong extension.
Thanks for reporting. Indeed, Instaloader extracts the file extension from the URL and thus saves some of the downloaded JPEG files with a
.webp
extension.I agree, if the image is a JPEG, it should be saved as a
.jpg
.