question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Images are being downloaded as .webp instead of .jpg

See original GitHub issue

Describe 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:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:14 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
tndgppcommented, Feb 20, 2022

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.

2reactions
aandergrcommented, Mar 4, 2022

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.

Expected behavior Save the image as a .jpg instead of .webp

I agree, if the image is a JPEG, it should be saved as a .jpg.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does Google Chrome save a JPG image to WEBP instead?
Webp is a image format developed by Google for web graphics, you can rename the file using file.jpeg naming ...
Read more >
How to Stop Chrome Saving Images in WebP Format on ...
1. Use Save Image as Type Extension · Download the Save image as Type extension from the Chrome web store. · Once added,...
Read more >
How to avoid saving images in webp format in Google Chrome
The first option is the Chrome extension Save Image As Png. It adds an option to the browser's right-click context menu to save...
Read more >
How to Save .WEBP Images as JPG and PNG (6 Ways)
Right-click on the WEBP image and select Copy image address from the menu · Now paste this address in a new tab and...
Read more >
Why is Chrome suddenly saving images as .webp - Reddit
The Website server is detecting that you are using chrome and sends Webp even if you request a jpg file. So when you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found