Git Product home page Git Product logo

Comments (6)

kensanata avatar kensanata commented on August 12, 2024 2

Maybe? πŸ˜„

Actually, if you're comfortable with the command line, you could get the URLs of the url and the preview_url attributes of all the media in mentions (I think! Lightly tested…) by using this jq command:

jq '.mentions[].media_attachments[]|.url,.preview_url' octodon.social.user.kensanata.json

With a little sed you can extract all the path's you need:

jq '.mentions[].media_attachments[]|.url,.preview_url' octodon.social.user.kensanata.json \
| sed -n -e 's/[^\/]*\/\/[^\/]*\/\([^"]*\)"$/\1/p'

So perhaps this is enough to wrap around a loop to rm? Something like the following, untested?

rm $(jq '.mentions[].media_attachments[]|.url,.preview_url' octodon.social.user.kensanata.json \
| sed -n -e 's/[^\/]*\/\/[^\/]*\/\([^"]*\)"$/\1/p')

from mastodon-archive.

kensanata avatar kensanata commented on August 12, 2024 1

I'd say such a feature would have to be added to the file media.py, in other words, some option for the media command.

from mastodon-archive.

kensanata avatar kensanata commented on August 12, 2024

Not with the tool itself, unfortunately.

from mastodon-archive.

lapineige avatar lapineige commented on August 12, 2024

Ok, so as well as #40 that's something I should try to add, I guess ? :)

from mastodon-archive.

lapineige avatar lapineige commented on August 12, 2024

Well, it's not that I don't want to do it, but I don't have the time right know but those media files takes some storage space πŸ˜…

So thanks a lot for your command, I'll investigate.
And maybe add some PRΒ :)

(the best would be not to download them, with an option)

from mastodon-archive.

kensanata avatar kensanata commented on August 12, 2024

Yeah, to be honest I never download media...

from mastodon-archive.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.