-
-
Notifications
You must be signed in to change notification settings - Fork 991
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[flickr] Complete extractor support #16
Comments
There are even more things to add to the list:
They might not be as important as the two missing variants you listed, but still necessary to call it "complete". Supporting these shouldn't be much of a problem, as there is an API method for all of them (API Method List). The biggest issue might be support for NSFW and private images, which sometimes requires User Authentication.
|
Yes, it is. Like many APIs, Flickr uses OAuth for authentication purposes. It was usually enough to just authenticate the application itself and send requests on the application's behalf (e,g, DeviantArt). In this case, the user has to grant the application permission to send requests on his behalf, which gets a bit more complicated. To compare the two: Application Auth:
User Auth:
|
Okay, got that. Looks a bit over the top, with unnecessary complexity, but they are probably doing it for "security" reasons. Silly me, thinking that just providing your credentials, just the way you would in a browser, should be enough. |
[This was an offtopic question] |
Call '$ gallery-dl oauth:flickr' to get an access_token and access_token_secret for your account.
User authentication has (finally) been implemented. It is on the surface the same as for reddit:
Please test this to see if everything works on your end as well. To answer your question: The underlying software for Danbooru and Gelbooru is quite different, and so are their search capabilities. |
Glad to hear, I will test Flickr Auth when I'm home again.
User extractor is this "Photostream", right? I update the checklist in the initial post. This means Flickr support is now almost complete, right? With the exception of search results.. Oh, and that other question: My bad, this is the wrong issue, I'm sorry. This was supposed to be in the General Questions etc., #11 |
Yes, it is. I've just named this one "user" to be consistent with all the other extractors which do the same general thing - getting images from the users own list. What might not work and could even break the extraction process at the moment are videos. I haven't found an example, so who knows what will happen if you stumble over one. edit: found some videos. The publicly available ones seem to work, the r18 ones give a 404 error when trying to download them, which is the same behavior as when using a browser. You seem to only be allowed to download r18 videos when being logged in, but there aren't any cookies or HTTP headers when using OAuth, so I don't really know how to handle this with gallery-dl. |
Okay, was a bit short on time unfortunately, but here are some results:
But okay, that's not the point, and it works as is right now. Clicked Accept in the Browser, got the key data, saved it into Downloaded some images, just as expected. My plan to make a bigger test run had to be postponed, because hot damn your average Flickr profile with a couple MP per picture is easily a couple of GB. Need to make some space first 😄 This could be a good idea to make some optional changes, eventually. I didn't read the source yet, and I'm definitely not proficient in Python, but I assume the default setting is to get the 'original' size of the pictures, right? Normally I'm a staunch advocate of always (and only) getting the highest resolution possible, or the "original" resolution, but Flickr might be overkill, at least to some users, who don't really want ~ 5000*4000 px per image (for some profiles only, though). So this could eventually be an option to set.. What I don't understand right now, is that 'r18' videos don't work apparently, but 'r18' pictures do work? Seems strange to me that the API handles this stuff so differently. Maybe like this: http://docs.python-requests.org/en/master/user/advanced/#request-and-response-objects Edit: |
Thank you for your detailed feedback. I was quite surprised to learn that Ctrl+c doesn't work in that particular instance, because it works just fine in all other situations on Windows. It seems that Python on Windows ignores all external input during blocking socket operations. I built some sort of workaround by adding a timeout, which seems to work (d60781d). There is also no way for gallery-dl to know about what your browser is doing, which would make this a lot easier. It can only sit there and wait until you click "Accept" and your browser gets redirected to localhost:6414. gallery-dl is just going to wait indefinitely If this never happens, which is why the "Ctrl+c to cancel" notice is there.
The one time I tried this, I minded it quite a bit, especially compared to how intuitive this is on a terminal emulator on linux (at least for me): click+drag to select, ctrl+shift+c to copy.
Same here, and I agree that there should be an option to select different formats than the original, at least for flickr. It would be nice to have a format-selection-option like youtube-dl does, but this might be a bit too much, given that almost all supported sites provide their images in only one size and format.
The issue with r18 videos is actually downloading them. R18 rated images don't require any authentication once you've got their URL: The last link is what the API provides as download URL for that video, but accessing it without being logged into Flickr just gives you a "This is not the page you're looking for." message. The thing is that gallery-dl doesn't need to log into Flickr to access its API as it is using OAuth to authenticate itself and the user. edit: I should mention that you cannot use any of the OAuth methods to authenticate an r18 video download. I tried. |
Okay, I see. These videos require a session cookie for the requests, but gallery-dl doesn't have it because OAuth doesn't deal with cookies.. Not sure if there is any elegant solution for this, I don't see it right now. The only workaround presumably is to add support for reading cookies in text form to gallery-dl from the command-line. This is not specific to Flickr, so this might be useful again in some other cases. On the other hand, I'd just say, Videos on Flickr? Meh.. I agree about the issue with |
This option allows for simple format selection by specifying a maximum image width.
Specify as |
Currently as Integer/Pixels. |
Uh, I don't really know. But pretty sure that this is not general knowledge in any way.. I've made a habit of actually reading the commits here, but I wasn't absolutely sure, to be honest. |
I've finally managed to implement a way to supply your own cookies ( Flickr only requires the The cookie jar files have the same restrictions as youtube-dl has for their --cookies option (
|
Great to hear, thanks a lot! Can't test it for myself right now, cause I'm out and about, can do it when I'm home again, oh well.. I think that's about it for this extractor, right? Maybe time to close and move on 😄 |
Good news from the commit log, flickr album extractor (93e5d8c), and image extractor (659c65d) are already there, apparently.
So I thought that adding complete support for Flickr now might be a good idea. 😄
Support for the Flickr API being part of the implementation already, at least that's what I got from reading the source code a bit, it should be relatively straightforward now, I would assume.
All Flickr variants, I think, are:
So what do you think?
Unless I'm wrong about the Flickr API, you already made the foundation, so it should not be too much work, I'd assume.
The text was updated successfully, but these errors were encountered: