Mirror Instagram accounts on Pixelfed https://pixel.nogafam.es/mirrors
Go to file
Bofh de5715824f Added step to patch pixelfed files 2021-02-09 22:55:59 +01:00
files Add basic support for videos (not tested) 2021-02-08 20:28:12 +01:00
scripts User creation automated + server port configurable 2021-02-07 02:56:08 +01:00
.gitignore Implemented login + bio/website setting + profile pic setting 2021-02-07 14:55:02 +01:00
README.md Added step to patch pixelfed files 2021-02-09 22:55:59 +01:00
config.json.example Make timeout_btw_accounts configurable 2021-02-09 12:08:37 +01:00
headers.example initial commit 2021-02-06 21:12:19 +01:00
igmirror.py Shuffle accounts when updating all of them 2021-02-09 12:13:05 +01:00
server.py Added API function to force login of account 2021-02-08 21:22:00 +01:00

README.md

Instagram -> Pixelfed Mirror in Python (3+)

This Python scripts with a simple HTTP API to use it, can mirror multiple accounts from Instagram to your Pixelfed instance.

Disclaimer

Mirroring Instagram accounts will copy (clone) the images and videos from Instagram to your server, thus moving the data sovereignty to you as an Admin.

Always make sure you mirror accounts whos content is not strictly copyrighted (or branded) and keep the tagging system of the source code that marks accounts on Pixelfed as Mirrors.

Users of your Pixelfed instance have to know this accounts are not real accounts as someone on Instagram could create a real Pixelfed account in the future.

Pre-requisites

  • You need an Instagram account to make this bot work.
  • A Pixelfed instance you own. It must be hosted or managed by you (you need shell access for php artisan commands)
  • Python 3+ installed on the same machine as the Pixelfed instance (this is easy, mostly all standard Debian based Linux systems have python3)
  • A bit more disk space for Pixelfed media storage. (It depends on how many accounts you mirror and how often that accounts post on IG)
  • Patch 1 file on Pixelfed deployed code (being on docker or not)

What can you mirror?

  • Posts with images (multiple images support).
  • Posts with videos (only 1 video).
  • Each posts captions (post description) is represented as splitted comments.

What can't you mirror (yet) ?

  • Stories. (will support that soon)

Installation

As i said on the Pre-requisites, you will need to patch the following files on Pixelfed running code:

This patch is needed to disable Pixelfed API rate limiting completely as it might pop-up when using your mirror bot. We asume your Pixelfed installation is at /var/www (if it isn't, just change the steps to match your installation)

/var/www/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php

Add return 99999999; after the line where it checks if the user is authenticated.

    /**
     * Resolve the number of attempts if the user is authenticated or not.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  int|string  $maxAttempts
     * @return int
     */
    protected function resolveMaxAttempts($request, $maxAttempts)
    {
        if (Str::contains($maxAttempts, '|')) {
            $maxAttempts = explode('|', $maxAttempts, 2)[$request->user() ? 1 : 0];
        }

        if (! is_numeric($maxAttempts) && $request->user()) {
            return 99999999;
            $maxAttempts = $request->user()->{$maxAttempts};
        }

        return (int) $maxAttempts;
    }