Skip to content
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

[Deviantart] Extended Metadata #5175

Closed
vandervast opened this issue Feb 8, 2024 · 10 comments
Closed

[Deviantart] Extended Metadata #5175

vandervast opened this issue Feb 8, 2024 · 10 comments

Comments

@vandervast
Copy link

Looking for a way to extract number of views of each deviation.

There's no mention of "views" or "view count" for DeviantArt in the docs, so I can only assume it's not supported. This would be a very useful metric to have access to, so I hope it'll included in the "stats" group along with favorites and comment count!

@rautamiekka
Copy link
Contributor

Doesn't seem like DA exposes that info in either the -K output or the JSON, even the website doesn't offer it in any precision once 1k is reached, so either you'll have to scrape it off the website or forget about it.

@mikf mikf closed this as not planned Won't fix, can't repro, duplicate, stale Feb 14, 2024
@mikf mikf reopened this Feb 14, 2024
@mikf mikf removed the wont-fix label Feb 14, 2024
@mikf
Copy link
Owner

mikf commented Feb 14, 2024

DA's private API seems to expose the exact view count as deviation -> stats -> views (https://www.deviantart.com/_puppy/dadeviation/init?deviationid=...), but gallery-dl currently uses DA's public API and that, as rautamiekka said, does not provide this information.

@vandervast
Copy link
Author

vandervast commented Feb 15, 2024

Thank you for looking into this and explaining the nature of the problem!
It's unfortunate that there's no easy solution, but at least the answers are here for anyone else wondering about this.

@mdashlw
Copy link

mdashlw commented Feb 17, 2024

DA's private API seems to expose the exact view count as deviation -> stats -> views (https://www.deviantart.com/_puppy/dadeviation/init?deviationid=...), but gallery-dl currently uses DA's public API and that, as rautamiekka said, does not provide this information.

This endpoint seems to provide exact views
https://www.deviantart.com/developers/console/deviation/deviation_metadata/7824fc14d6fba6acbacca1cf38c24158

@mikf
Copy link
Owner

mikf commented Feb 17, 2024

But only when explicitly requesting them with ext_stats=1, which does not happen at the moment (current parameters). Time to extend DA's metadata option ...

@mikf mikf reopened this Feb 17, 2024
@Twi-Hard
Copy link

Is there any other metadata that's currently left out that you can include now?

@mikf
Copy link
Owner

mikf commented Feb 17, 2024

Quite a lot, it seems. All the ext_... parameters for /deviation/metadata are currently not enabled.

@mikf mikf changed the title [Deviantart] View count? [Deviantart] Extended Metadata Feb 17, 2024
@Twi-Hard
Copy link

Twi-Hard commented Feb 17, 2024

Adding all of that extra metadata sounds really nice. :)

Edit: is it possible to make gallery-dl exit if the refresh token expires?

@mikf
Copy link
Owner

mikf commented Feb 17, 2024

This time I'm not going to wait several months before starting to work on this, don't worry.

Exiting when a refresh token is expired should be possible with the undocumented actions option.

    "actions": {
        "error:The refresh_token is invalid": "exit"
    }

mikf added a commit that referenced this issue Feb 18, 2024
alloe fetching extended metadata in addition to the usual
'description', 'tags', etc by setting 'metadata' to a list of
'camera', 'stats', 'submission', 'collection', and 'gallery'

for example "metadata": "stats,submission"
@mikf
Copy link
Owner

mikf commented Feb 18, 2024

741fd00.

Should be fully functional, but I'm currently limiting the number of requested deviation objects to 10 when extended metadata is requested to make things easier. (DA allows fetching extended metadata of only 10 deviations at a time)

Regarding this issue's initial request: "metadata": "stats"

mikf added a commit that referenced this issue Feb 25, 2024
use multiple metadata API calls per chunk of deviations if necessary
@mikf mikf closed this as completed Feb 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants