gallery-dl icon indicating copy to clipboard operation
gallery-dl copied to clipboard

[Feature Request] Extractor for Deviantart gallery search

Open KonoVitoDa opened this issue 3 years ago • 13 comments

Although a extractor for user galleries is already present, it doesn't works if you try to download the results of a search did in a given gallery. Example: gallery-dl https://www.deviantart.com/otakurenders-service/gallery?q=isuzu [gallery-dl][error] No suitable extractor found for 'https://www.deviantart.com/otakurenders-service/gallery?q=isuzu'

KonoVitoDa avatar Jul 14 '21 21:07 KonoVitoDa

Can't promise I fixed it, but I tried, 0135am no less.

rautamiekka avatar Jul 14 '21 22:07 rautamiekka

Can't promise I fixed it, but I tried, 0135am no less.

Still not working, I got same error :( I already upgraded gallery-dl to the latest version (1.18.1).

KonoVitoDa avatar Jul 14 '21 22:07 KonoVitoDa

gallery-dl, like youtube-dl, is manually published, and evidently mikf has to manually approve a PR before the code starts compiling, so you need to wait for that.

Once he approves (and preferably wait for the compilation to succeed) you need to download the whole source code and that way test it by running the __main__.py with your params and flags.

rautamiekka avatar Jul 14 '21 23:07 rautamiekka

Got it, I'll wait. How long does it usually take?

KonoVitoDa avatar Jul 14 '21 23:07 KonoVitoDa

With https://github.com/mikf/gallery-dl/pull/1696 it would accept those gallery search URLs, but it wouldn't do the requested search and just download the same as /gallery/all.

Actually implementing this feature is also more or less impossible as long as gallery-dl uses the official OAuth API, simply because it doesn't provide that functionality. gallery-dl could theoretically go through all possible results and try to manually apply a search filter, or we start using the Eclipse API (https://github.com/mikf/gallery-dl/tree/deviantart-rewrite)

Me approving the PR wouldn't compile anything, by the way. It'd only run the tests from https://github.com/mikf/gallery-dl/blob/master/.github/workflows/tests.yml

mikf avatar Jul 15 '21 14:07 mikf

With #1696 it would accept those gallery search URLs, but it wouldn't do the requested search and just download the same as /gallery/all.

Ya, I figured that's the price to pay since DA's search facility is 99% useless since Eclipse.

Actually implementing this feature is also more or less impossible as long as gallery-dl uses the official OAuth API, simply because it doesn't provide that functionality. gallery-dl could theoretically go through all possible results and try to manually apply a search filter, or we start using the Eclipse API (https://github.com/mikf/gallery-dl/tree/deviantart-rewrite)

Huh. Didn't know there was another API.

Me approving the PR wouldn't compile anything, by the way. It'd only run the tests from https://github.com/mikf/gallery-dl/blob/master/.github/workflows/tests.yml

Ah ok. Well, as far as seeing whether the PR even works, the result is the same.

rautamiekka avatar Jul 15 '21 15:07 rautamiekka

Committed a fix for the tests, I haven't quite learnt how to use GitHub to show that here, but it's visible in the PR.

I linked to a regex101 piece where all the tests succeed fine, and I tried to DL using OP's link, which worked perfectly fine too.

rautamiekka avatar Jul 15 '21 16:07 rautamiekka

I'm just gonna admit defeat so that someone with better Git understanding (and the motivation) can get it through. I think you can see why I had a strong dislike for Git from the maintaining standpoint.

rautamiekka avatar Aug 10 '21 21:08 rautamiekka

There are some other fringe dA cases I'm curious about, like what about outside of users just exploring tags?

left1000 avatar Sep 23 '21 20:09 left1000

Still no solution? :(

KonoVitoDa avatar Mar 04 '22 21:03 KonoVitoDa

There is actually a bit of a loophole. In the search box at the very top of the page, enter the following (replacing the search text and username, of course): insert search text here username:insertusernamehere

This means that for the example in the first post, the correct URL to pass to gallery-dl would be: https://www.deviantart.com/search?q=isuzu+username%3Aotakurenders

The only problem is that it fails to work with users with a - in their username. With the example in the original post, stripping everything that comes after the - (leaving only "otakurenders") is still precise enough to return the appropriate results. Unfortunately, this is not always realistic: for example, a search for hypothetical user "the-artist" would return everything with the search text by all accounts with either "the" or "artist" in the username.

hyzchip avatar May 21 '22 07:05 hyzchip

There is actually a bit of a loophole. In the search box at the very top of the page, enter the following (replacing the search text and username, of course): insert search text here username:insertusernamehere

This means that for the example in the first post, the correct URL to pass to gallery-dl would be: https://www.deviantart.com/search?q=isuzu+username%3Aotakurenders

The only problem is that it fails to work with users with a - in their username. With the example in the original post, stripping everything that comes after the - (leaving only "otakurenders") is still precise enough to return the appropriate results. Unfortunately, this is not always realistic: for example, a search for hypothetical user "the-artist" would return everything with the search text by all accounts with either "the" or "artist" in the username.

This works great!~ only problem is that the folder structure becomes popular all-time keyword username_[username] rather than just [username] like it would be with a normal rip command.... anyway to alter that? (atm I'm moving the files over afterwards manually but that prevent rerips from noticing a file already exists and skipping that download)

left1000 avatar Jul 09 '22 16:07 left1000

This works great!~ only problem is that the folder structure becomes popular all-time keyword username_[username] rather than just [username] like it would be with a normal rip command.... anyway to alter that? (atm I'm moving the files over afterwards manually but that prevent rerips from noticing a file already exists and skipping that download)

The first option for this would be to use symbolic links so that the "popular" folders all point to just [username], which is what I have been doing. Alternatively, perhaps the option extractor.*.directory might help (I haven't tried this myself though): https://github.com/mikf/gallery-dl/blob/master/docs/configuration.rst

hyzchip avatar Jul 31 '22 20:07 hyzchip