Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Support for Instagram photos #9337
Comments
|
Photos is out of scope of youtube-dl. |
|
Why? While it downloads Instagram videos it can download photos as well. |
|
Unlike other websites, right-click on images of instagram does not give a save-to option. There's no easy way to get the image without HTML or network sniffing knowledge. Maybe the policy can be changed. |
|
Supporting static images will also introduce semantic clash with thumbnails. |
|
For static pictures, |
|
So in general you are suggesting duplicating |
|
Yeah. |
|
You still can do this: (Run against Instagram post page, i.e. https://www.instagram.com/p/XXXXXXXXXXX/) Their source is an awful mess of nested div elements infused with React garbage, boy that is ugly.. But I think that RipMe still works with Instagram: (Java based program) |
|
That line works perfectly in the console, but it would be useful to have support for it in youtube-dl so all solution would be gathered in one place. |
|
Hmm, you can still automate this further. The post IDs are inside some JSON on the profile page, they can be extracted, then you can construct the URLs to the single post pages, fetch the HTML documents from each post page, and then query again. I just tested some images there, and maybe it is just me, but the picture quality is horrible. Total potato quality. I guess you never notice this when browsing Instagram normally (Web or Mobile), because the user agent always scales down the images and displays them this way... |
|
All that needs to be done is to get value of content for the meta image This contains the URL to the highest quality version of the image. |
|
Any progress on if this will be implemented or not? |
|
There's currently no consensus on whether youtube-dl should support non-audio/video files or not. It's a change to the essence of youtube-dl, so I guess it's better to get a common conclusion among developers before moving on. My personal idea is that supporting static pictures on existing websites is OK, for example Facebook, Tumblr and Instagram, but not adding new website with static pictures only. |
|
@yan12125 I agree. Would this be a big change, requiring much new/changed code? |
|
Nope. Just a single line for Instagram. |
|
I use Jdownloader for Image download on Social Networks. Most Social Networks make it a pain to download full resolution image and the implementation changes very often. Lots of Pic Hunters have troubles to download a good quality image. Mostly they distribute/share low resolution pics. I would love if the best open source tool supports images. |
|
So there are different resolutions, or formats, in youtube-dl parlance, to deal with. |
|
@Hrxn Sorry not getting it. What does it mean by "The API might return something different.."? |
|
https://www.instagram.com/developer/ Like this I am currently testing this, will see if I get another image, Because I don't know if anyone else noticed, but the image quality on Instagram seems horrible. You don't realize this normally, when using it on mobile, because the images get scaled downed and the mobile displays have a higher resolution (dpi). |
|
I see. Usually youtube-dl tries to parse the web page instead using APIs. Parsing user pages should be possible. |
|
On user pages it is possible to get different image resolutions the same way that we do it now for videos. |
Can you please elaborate? I don't see what you mean right now. API access looks like a dead end. Apparently, all registered API clients run in some sandbox mode in default, which limits the access to what is otherwise considered public data on Instagram. Full access is only available for 'production' clients, which have to get through a review process first, it seems. Whatever, I doubt that this would've helped with the crappy image quality of Instagram ;) |
|
@Hrxn
|
|
Oh, okay. Guess I misunderstood. With 'user pages', I thought you maybe meant the normal web URL, i.e. I feared that I've failed to see some kind of menu button or something ;) Okay, but My initial plan was to try to find if the original upload would still be available somewhere. Because Instagram keeps that, AFAIK. At least I heard that somewhere. I don't know about their format list, but there is some more I suspect. One Instagram post I chose for my test is a JPEG with 1080 x 1349, for example. But quality is still not that good. Ridiculous, if compared to Flickr or 500px, for example. |
The method works for all users I've tested so far (not many). It is also the current method we use in the Instagram extractor only for videos. But because it is an API endpoint, as you mentioned, Instagram may treat us differently. The best way would be to mimic the browser: Using the |
|
From pages that I've checked the photo with the highest quality is the one in the But if you're trying to get all the photos of a user then it'll be a more complicated task. I came to this conclusion by comparing the highest quality version of a photo from There is however one solution to getting the highest quality version of the photo, but it's a bit annoying. |
If InstagramIE extracts the high-quality image from |
|
youtube-dl will NEVER use any API that requires a key. Please discuss API usages privately but not here. |
|
This was never my intention. I'm aware that's not feasible, in addition, not even possible. I said that earlier. The point was only to find out if Instagram stores higher res images at all, or rather the original resolution, i.e. the uploaded file. Because cell phone cameras may be crap, but they're not that bad as what Instagram is serving as pictures. |
|
Should there be a vote between you developers whether or not youtube-dl will support static images? |
|
I guess we can have a simple vote: Click +1 on @EnginePod's original post if you like this idea, and -1 if you don't. |
|
It has been some time now. Any development on the issue? |
|
There are not so many +1's. Maybe people don't know this debate on expanding youtube-dl's coverage. |
|
Is anyone against implementing this? If not, why not implement it? |
|
See #9337 (comment) |
|
Don't know if I should make a new issue for this, but I already found a comment about Tumblr in #9337 (comment). For so, extracting (best) images from Tumblr is also not straight forward. Take e.g. http://programmerryangosling.tumblr.com/post/76642406919. This site links directly to the image, but not in the best quality. To get the best quality you also have to parse http://programmerryangosling.tumblr.com/image/76642406919 (and the browser shows the image only with enabled js). |
|
? Tumblr? But this issue is about Instagram? |
|
@Tratoschek, this was about Instagram, but the In other words, you just need to view the source for the page with the specific post and extract |
|
@Hrxn I know, but this issue has evolved to the central "Support images in youtube-dl"-issue. To the generic discussion here. What I get so far, the current facts are:
Maybe some of this can be solved with some rules, what a "good" picture site is, to suggest some:
(This rules would include sites such as instagram, tumblr, imgur, ...) |
|
"The main content of the site has to be an (only one) image." As you sort of mentioned, it would be easy to implement by just adding the image as a format, example: To keep images and videos separated on sites that provide both (like FB, IG, etc.) you would have the image support only as a fallback. So if there was no video on the page then it'd fallback to extracting the image (unless there's a 404). The problem doesn't seem to be the technical implementation, but rather that photos shouldn't be supported by youtube-dl (see @dstftw's reply) even though it'd make life easier for everyone. |
|
+1 for Twitter and Instagram photo downloads. especially with gifs nowadays the distinction is somewhat baseless youtube-dl doesn't just work on YouTube anymore, and it doesn't have to just work for video either |
|
With 14 +1 votes, I consider this a valid request. Implementation still require discussions. |
|
I'd like this feature, how can I help? |
|
I realize this is an old issue with a lot of historical discussion on the topic already, so adding my own flavor of "+1" probably isn't going to do much good. Nonetheless, as a long-time user of youtube-dl I'd like to emphasize just how usable the internet is with youtube-dl existing. Without youtube-dl I would basically be unable to use any video site currently in existence - and it's simply staggering the amount of logic youtube-dl has for nearly every media hoster in use, to the point where youtube-dl even supports crap like dropbox - as long as what's pointed to by it is a video file. In fact, if somebody sends me, say, a dropbox link that isn't a video file, I'm unable to open it. This restriction has always seemed sort of artificial to me. By limiting the scope of youtube-dl you're essentially saying that we need to create a second tool that replicates all of the site-specific logic that youtube-dl has but with the intention of allowing non-videos from being downloaded as well. This seems sort of silly to me. Massive amounts of work clearly go into youtube-dl and it seems to me it would be much easier and more logical to extend youtube-dl than it would be to recreate it from scratch. Add to this the fact that images are sort of a gray area in between videos and general files and it makes my opinion even stronger that youtube-dl should be able to handle them, since images are just more media files. It doesn't matter whether the tool at the other end (e.g. mpv) is opening one type of media file or another, it will still open. Now, normally I don't really care much about the image use case because browsers are normally able to display images. But then you have complete garbage like imgur which these days simply doesn't display anything at all, and I find myself wishing youtube-dl could help me every single time it happens. At some point I may try ripping out the imgur-specific logic from youtube-dl and wrapping it into my own command line tool to grab them, simply so I can view imgur links again. But it still seems like it would be a waste for youtube-dl not to add support directly. Anyway, since I don't commit to youtube-dl my words are cheap so take them for what they are. Just a frustrated user who's tired of having to ask people to re-upload imgur links to other websites simply so he can view them.. |
I'll skip the formality as there already is support for Instagram videos, but not photos.
Here is an example photo: https://www.instagram.com/p/BEvqLm5mcSK/?tagged=test