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

[mastodon] allow downloading without access token #2782

Merged
merged 1 commit into from
Jul 27, 2022
Merged

Conversation

Dasug
Copy link
Contributor

@Dasug Dasug commented Jul 25, 2022

Most mastodon instances allow accessing /api/v1/accounts/XXXX/statuses and api/v1/statuses/XXXX without an API access token.
This pull request allows users to download at least some links from such a mastodon instance that does not already have access tokens hard-coded into the extractor.
User extractor only works on links that include the user id such as https://mastodon.tld/@id:12345. Status links work as-is.

Examples:
gallery-dl master:
gallery-dl "mastodon:https://mastodon.improved-madness.de/@id:108302476900301707"

[mastodon.improved-madness.de][error] Missing access token.
Run 'gallery-dl oauth:mastodon:mastodon.improved-madness.de' to obtain one.

using this pull request:
gallery-dl "mastodon:https://mastodon.improved-madness.de/@id:108302476900301707"

./gallery-dl/mastodon/mastodon.improved-madness.de/Dasug/mastodon.improved-madness.de_108708292589358183_108708247880326250.jpg
./gallery-dl/mastodon/mastodon.improved-madness.de/Dasug/mastodon.improved-madness.de_108708292589358183_108708251164132015.jpg
./gallery-dl/mastodon/mastodon.improved-madness.de/Dasug/mastodon.improved-madness.de_108708292589358183_108708265691857964.jpg
./gallery-dl/mastodon/mastodon.improved-madness.de/Dasug/mastodon.improved-madness.de_108708292589358183_108708268865615297.jpg

gallery-dl master:
gallery-dl "mastodon:https://mastodon.improved-madness.de/@Dasug/108708292589358183"

[mastodon.improved-madness.de][error] Missing access token.
Run 'gallery-dl oauth:mastodon:mastodon.improved-madness.de' to obtain one.

using this pull request:
gallery-dl "mastodon:https://mastodon.improved-madness.de/@Dasug/108708292589358183"

./gallery-dl/mastodon/mastodon.improved-madness.de/Dasug/mastodon.improved-madness.de_108708292589358183_108708247880326250.jpg
./gallery-dl/mastodon/mastodon.improved-madness.de/Dasug/mastodon.improved-madness.de_108708292589358183_108708251164132015.jpg
./gallery-dl/mastodon/mastodon.improved-madness.de/Dasug/mastodon.improved-madness.de_108708292589358183_108708265691857964.jpg
./gallery-dl/mastodon/mastodon.improved-madness.de/Dasug/mastodon.improved-madness.de_108708292589358183_108708268865615297.jpg

Most mastodon instances allow accessing /api/v1/accounts/XXXX/statuses and api/v1/statuses/XXXX without an API access token.
This commit allows users to download at least some links from such a mastodon instance that does not already have access tokens hard-coded into the extractor.
User extractor only works on links that include the user id such as https://mastodon.tld/@id:12345. Status links work as-is.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants