kensanata / mastodon-archive

Archive your statuses, favorites and media using the Mastodon API (i.e. login required)
https://alexschroeder.ch/software/Mastodon_Archive
GNU General Public License v3.0
358 stars 33 forks source link

fix Forbidden errors on media downloads #25

Closed mattieb closed 6 years ago

mattieb commented 6 years ago

mastodon.social's media infrastructure rejects the urllib user agent. This changes the user agent to the generic string "Mozilla", which makes media downloads work on mastodon.social.

kensanata commented 6 years ago

I don’t know. Do we really want to circumvent this block? I feel like this might be uncool...

mattieb commented 6 years ago

Maybe the right thing to do is to invent a user agent that isn’t python-urllib and communicate it with server admins so they can block it if they desire.

This tool is pretty narrowly wired specifically for the backup use case and is careful not to re-request media it already has. I don’t think most admins would be opposed to it in theory, but I do see the value in being honest about what user agent we actually are.

kensanata commented 6 years ago

Yeah, naming the tool as the user agent would make sense to me.

mattieb commented 6 years ago

Hey, sorry, I got a little busy, did you decide you didn't want that User-Agent changed?

kensanata commented 6 years ago

I merged your commit and in commit a2e19be I changed the UA as discussed to something specific to the application.