tootctl media lookup
doesn't work for local media
#33923
Labels
status/to triage
This issue needs to be triaged
tootctl media lookup
doesn't work for local media
#33923
Steps to reproduce the problem
tootctl media lookup
on the URL of a locally posted media fileExpected behaviour
Displays URL of post containing the given media file
Actual behaviour
Displays "Not a media URL"
Detailed description
Running the command:
RAILS_ENV=production bin/tootctl media lookup https://media.mastodon.sunny.garden/media_attachments/files/113/632/298/078/427/840/original/656aebb68bf18a19.jpg
Returns:
Not a media URL
And yet, it clearly is a media URL.
A brief inspection of the code at...
mastodon/lib/mastodon/cli/media.rb
Line 271 in 58a0293
If I pass in a modified URL to add a "/cache" path element - which the code will strip out - the number of path elements now matches and the command will successfully look up the post, even though the actual URL passed in is invalid.
Running:
RAILS_ENV=production bin/tootctl media lookup https://media.mastodon.sunny.garden/cache/media_attachments/files/113/632/298/078/427/840/original/656aebb68bf18a19.jpg
Returns:
https://sunny.garden/@brook/113632322942825152
Mastodon instance
sunny.garden
Mastodon version
v4.3.3
Technical details
If this is happening on your own Mastodon server, please fill out those:
The text was updated successfully, but these errors were encountered: