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

Feature Request: Archive Media #60

Open
InvestigateXM opened this issue Jul 25, 2024 · 1 comment
Open

Feature Request: Archive Media #60

InvestigateXM opened this issue Jul 25, 2024 · 1 comment
Labels
feature enhancement tag for additions or enhancements of existing feature mediagress affects the mediagress part of the website

Comments

@InvestigateXM
Copy link
Collaborator

Once new Media is added to the database, automatically archive the Media image and the Media content (assuming the content is hosted on a Niantic server) in case that they are deleted

Run archiver once for Media already added to database

@InvestigateXM InvestigateXM added feature enhancement tag for additions or enhancements of existing feature mediagress affects the mediagress part of the website labels Jul 25, 2024
@ninjaburger
Copy link
Contributor

I'm no Bash proficient but this is how I managed to archive the restored Media

#!/bin/bash
json_file="media.json"

curl -s -o $json_file "https://ingress.plus/api/collections/medias/records?page=1&perPage=500000&sort=-released_at&fields=id,content_url,original_data.imageByUrl.imageUrl,original_data.storyItem.shortDescription"

mkdir -p content thumbnails

jq -c '.items[]' "$json_file" | while read item; do
    id=$(echo "$item" | jq -r '.id')
    content_url=$(echo "$item" | jq -r '.content_url')
    image_url=$(echo "$item" | jq -r '.original_data.imageByUrl.imageUrl')

    curl -s -o "content/$id" "$content_url"
    curl -s -o "thumbnails/$id" "$image_url"

    echo "Downloaded content and thumbnail for ID: $id"
done

guess something like that could be done from the backend

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature enhancement tag for additions or enhancements of existing feature mediagress affects the mediagress part of the website
Projects
None yet
Development

No branches or pull requests

2 participants