Git Product home page Git Product logo

avnsh1111 / instagram-reels-scraper-auto-poster Goto Github PK

View Code? Open in Web Editor NEW
155.0 7.0 41.0 428 KB

Reels-AutoPilot: Reels-AutoPilot is a powerful GitHub repository that scrapes reels from specified Instagram accounts and automatically posts them to your account. Keep up with the latest content from your favorite creators and effortlessly share it with your followers. Enhance your Instagram presence and grow your account with Reels-AutoPilot!

License: GNU General Public License v3.0

Python 100.00%
auto-poster instagram instagram-reels-downloader instagram-repost python3 reels scraper sqlite

instagram-reels-scraper-auto-poster's Introduction

Cover Image

Reels-AutoPilot

Reels-AutoPilot is a powerful GitHub repository that scrapes reels from specified Instagram accounts and shorts from YouTube channels, and automatically posts them to your Instagram account. Keep up with the latest content from your favorite creators and effortlessly share it with your followers. Enhance your Instagram presence and grow your account with Reels-AutoPilot!

Active Sponsors

APeter

Looking For Sponsors

Buy Me A Coffee    Donate using Liberapay

Table of Contents

Getting Started

Before using Reels-AutoPilot, set your configuration variables in the config.py file.

Prerequisites

  • Python 3.x
  • A valid Instagram account
  • A Google Developers Console project with the YouTube Data API enabled and an API key

Installation

  1. Clone the repository:
git clone https://github.com/avnsh1111/Instagram-Reels-Scraper-Auto-Poster.git
cd Instagram-Reels-Scraper-Auto-Poster
  1. Install the required dependencies:
pip install -r requirements.txt

Initial Configuration

Navigate to src directory:

cd src

To set up your initial configuration:

  1. Run start.py:
python start.py
  1. Follow the prompts to set up your Instagram credentials, YouTube API key, and other configuration settings.

After completing the setup process, the src/app.py script will run automatically based on your configuration settings.

Generate a YouTube API Key

  1. Set up a Google Developers Console project and enable the YouTube Data API:

    a. Go to the Google Developers Console.

    b. Create a new project by clicking the project drop-down menu, then click "New Project" and fill in the required fields, or select an existing project from the list.

    c. In the Dashboard, click on "Enable APIs and Services" and search for the "YouTube Data API v3". Click on it and then click the "Enable" button.

    d. Create an API key by going to "Credentials" in the left-hand menu, then click on "Create credentials" > "API key".

  2. During the initial configuration process, you'll be prompted to input your YouTube API key. Enter the key when prompted.

Usage

Scraping Reels, YouTube Shorts, and Posting

Run the app.py script to start the configured tasks (scraping reels, scraping shorts, and posting):

python app.py

Depending on the selected configuration options, this will scrape reels and shorts, store them in the downloads folder, and post them to your Instagram account at the specified interval.

Dashboard

To see real-time updates, open a new terminal and run:

python dashboard.py

Contributing

To contribute to this project, submit pull requests or open issues with your suggestions and ideas.

License

Reels-AutoPilot is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.

Acknowledgements

  • Thanks to all developers who contributed to the libraries used in this project.

Additional Features

  1. Reels and shorts scheduling: Schedule specific reels and shorts to be posted at certain times or dates.
  2. Custom captions: Add custom captions to each reel or short when posting.
  3. Multiple Instagram accounts: Support for posting reels and shorts to multiple Instagram accounts.
  4. Auto-hashtag generation: Automatically generate relevant hashtags based on the content of a reel or short.
  5. Analytics and insights: Collect data on the performance of your posted reels and shorts, such as views, likes, and comments.

Frequently Asked Questions

Q: Can I run Reels-AutoPilot on a Raspberry Pi or similar devices?

A: Yes, Reels-AutoPilot can be run on a Raspberry Pi or any other device that supports Python 3.x and the required dependencies. However, you may need to adjust the configuration and installation steps to match the specific requirements of your device.

Q: Can I use Reels-AutoPilot for commercial purposes?

A: Reels-AutoPilot is released under the GNU General Public License v3.0, which allows you to use, modify, and distribute the software for both personal and commercial purposes. However, you must comply with the terms of the license, which includes providing the source code for any modifications you make and preserving the original copyright notices.

Q: Is it safe to use my Instagram account credentials with Reels-AutoPilot?

A: Reels-AutoPilot stores your Instagram account credentials in the config.py file, and they are used only for authenticating and posting reels andshorts to your account. However, make sure to keep your credentials secure and not share them with unauthorized parties. It is also recommended to use a secondary Instagram account for testing purposes before using your main account.

Q: Can I post reels and shorts from private Instagram accounts or YouTube channels?

A: Reels-AutoPilot can only scrape reels from public Instagram accounts and shorts from public YouTube channels. If you want to post content from private accounts or channels, you will need to obtain the necessary permissions and access to the content.

Q: Can I get banned from Instagram for using Reels-AutoPilot?

A: Reels-AutoPilot automates the process of posting reels and shorts to your Instagram account. While automation can potentially violate Instagram's terms of service, Reels-AutoPilot is designed to minimize the risk of getting banned by posting at regular intervals and not spamming your account. However, it is still recommended to use Reels-AutoPilot responsibly and at your own risk.

Troubleshooting

  1. Issue: Reels-AutoPilot is not scraping reels or shorts correctly.

    Solution: Ensure that the Instagram account usernames and YouTube channel links in config.py are correct and publicly accessible. Also, make sure that your YouTube API key is valid and has not exceeded the quota limits.

  2. Issue: Reels-AutoPilot is not posting reels and shorts to my Instagram account.

    Solution: Verify that your Instagram account credentials in config.py are correct and that your account has not been banned or restricted. Additionally, check the POSTING_INTERVAL_IN_MIN and SCRAPER_INTERVAL_IN_MIN settings to ensure they are set to appropriate values.

  3. Issue: I am receiving an error when running Reels-AutoPilot with Docker.

    Solution: Make sure you have properly installed and configured Docker on your system. Double-check the Docker build and run commands to ensure they are executed correctly. If the issue persists, consider running Reels-AutoPilot without Docker.

If you continue to face issues or need further assistance, please open an issue on the GitHub repository or reach out to the community for support.

Changelog

  • v1.0.0 - Initial release with basic scraping and posting features.
  • v1.1.0 - Added support for scraping YouTube shorts and improved error handling.
  • v1.2.0 - Implemented Docker configuration and enhanced documentation.
  • v2.0.0 - Implemented added live dashboard, post-to-story feature, removed docker support and optimized login flow.

instagram-reels-scraper-auto-poster's People

Contributors

avnsh1111 avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

instagram-reels-scraper-auto-poster's Issues

don't know the problem but i have given correct link of the youtube channel

Describe the bug
Traceback (most recent call last):
File "C:\Users\anime\OneDrive\Desktop\Instagram-Reels-Scraper-Auto-Poster-master\src\app.py", line 50, in
shorts.main()
File "C:\Users\anime\OneDrive\Desktop\Instagram-Reels-Scraper-Auto-Poster-master\src\shorts.py", line 114, in main
channel_id = extract_channel_id(channel_link)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\anime\OneDrive\Desktop\Instagram-Reels-Scraper-Auto-Poster-master\src\shorts.py", line 56, in extract_channel_id
raise ValueError("Unable to extract channel ID from channel link")
ValueError: Unable to extract channel ID from channel link

CHANNEL_LINKS = [
"https://www.youtube.com/@heymattpeterson"
"https://www.youtube.com/@zachchoi"
"https://www.youtube.com/@BlatantReviews_"
"https://www.youtube.com/@SenyaiGrubs"
"https://www.youtube.com/@japaneat"

]these are the links of the channel

anonymous_gaming97

Describe the bug
A clear and concise description of what the bug is.
Instead of posting the content on my account, it posts the content on one account named "anonymous_gaming97", happens to everyone since the current newest version. No clue where this came from.

To Reproduce
Steps to reproduce the behavior:
Just start start.py and try to post

Expected behavior
That it would post the content on my account

Additional context
This also seems to happen to everyone since the current version as there are other content uploaded on that profile with one of the hashtags "Reels-Autopilot"

Add facebook reels support

Are you able to add facebook reels as an option as well? I would like to be able to post reels to a facebook account that is separate from my instagram account.

Instagram stories support

Could you add the ability for a selected reel to also be posted to the accounts instagram story?

I would like to simultaneously post at the set interval to reels + story

Session.json failure

Hello, I'm having issues while using start.py at first run

Error: [WinError 2] The system cannot find the file specified: 'session.json'
    Initializing login...
    Logging with username and password...
Traceback (most recent call last):
  File "C:\Users\EMRE\AppData\Local\Programs\Python\Python311\Lib\site-packages\instagrapi\mixins\private.py", line 360, in _send_private_request
    response.raise_for_status()
  File "C:\Users\EMRE\AppData\Local\Programs\Python\Python311\Lib\site-packages\requests\models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://i.instagram.com/api/v1/feed/reels_tray/

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\EMRE\AppData\Local\Programs\Python\Python311\Lib\site-packages\instagrapi\mixins\private.py", line 527, in private_request
    self._send_private_request(endpoint, **kwargs)
  File "C:\Users\EMRE\AppData\Local\Programs\Python\Python311\Lib\site-packages\instagrapi\mixins\private.py", line 393, in _send_private_request
    raise ChallengeRequired(**last_json)
instagrapi.exceptions.ChallengeRequired: challenge_required

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\EMRE\AppData\Local\Programs\Python\Python311\Lib\site-packages\instagrapi\mixins\private.py", line 360, in _send_private_request
    response.raise_for_status()
  File "C:\Users\EMRE\AppData\Local\Programs\Python\Python311\Lib\site-packages\requests\models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://i.instagram.com/api/v1/feed/reels_tray/

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\TokDep\Instagram-Reels-Scraper-Auto-Poster\src\start.py", line 184, in <module>
    auth.login()
  File "C:\TokDep\Instagram-Reels-Scraper-Auto-Poster\src\auth.py", line 29, in login
    api.login(config.USERNAME, config.PASSWORD)
  File "C:\Users\EMRE\AppData\Local\Programs\Python\Python311\Lib\site-packages\instagrapi\mixins\auth.py", line 472, in login
    self.login_flow()
  File "C:\Users\EMRE\AppData\Local\Programs\Python\Python311\Lib\site-packages\instagrapi\mixins\auth.py", line 186, in login_flow
    check_flow.append(self.get_reels_tray_feed("cold_start"))
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\EMRE\AppData\Local\Programs\Python\Python311\Lib\site-packages\instagrapi\mixins\auth.py", line 277, in get_reels_tray_feed
    return self.private_request("feed/reels_tray/", data)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\EMRE\AppData\Local\Programs\Python\Python311\Lib\site-packages\instagrapi\mixins\private.py", line 546, in private_request
    return self._send_private_request(endpoint, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\EMRE\AppData\Local\Programs\Python\Python311\Lib\site-packages\instagrapi\mixins\private.py", line 393, in _send_private_request
    raise ChallengeRequired(**last_json)
instagrapi.exceptions.ChallengeRequired: challenge_required

Error on install and first run

a) Installation error
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
gemnine 0.1.2 requires pydantic<3.0.0,>=2.6.1, but you have pydantic 1.10.9 which is incompatible.

b) start.py produces this error:
Error: [WinError 2] The system cannot find the file specified: 'session.json'

Doesn't seem to stopped the script posting - didn't try Youtube

Running this on Windows 10 via cmd window. Python 3.12.3

Dashboard configuration table incorrect

Describe the bug
The IS_REMOVE_FILES, IS_ENABLED_AUTO_POSTER, FETCH_LIMIT, LIKE_AND_VIEW_COUNTS_DISABLED, and DISABLE_COMMENTS is incorrect from the config.py file values.

To Reproduce
Steps to reproduce the behavior:

  1. Run "python3 app.py" in terminal
  2. Run "python3 dashboard.py" in a separate terminal

Screenshots
image

Desktop:

  • OS: Ubuntu 22.04

Docker not posting to instagram reels

Describe the bug
When using docker with the latest update, downloading reels from my chosen accounts works but the logs indicate that it hangs when attempting to post a reel to my selected account.

Here are the outputs of my docker logs, note* I have removed the usernames from the logs

'graphql'
2023-05-23 08:43:16 Traceback (most recent call last):
2023-05-23 08:43:16 File "/usr/local/lib/python3.11/site-packages/instagrapi/mixins/user.py", line 192, in user_info_by_username
2023-05-23 08:43:16 user = self.user_info_by_username_gql(username)
2023-05-23 08:43:16 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-05-23 08:43:16 File "/usr/local/lib/python3.11/site-packages/instagrapi/mixins/user.py", line 145, in user_info_by_username_gql
2023-05-23 08:43:16 return extract_user_gql(self.public_a1_request(f"/{username!s}/")["user"])
2023-05-23 08:43:16 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-05-23 08:43:16 File "/usr/local/lib/python3.11/site-packages/instagrapi/mixins/public.py", line 220, in public_a1_request
2023-05-23 08:43:16 raise e
2023-05-23 08:43:16 File "/usr/local/lib/python3.11/site-packages/instagrapi/mixins/public.py", line 212, in public_a1_request
2023-05-23 08:43:16 return response["graphql"]
2023-05-23 08:43:16 ~~~~~~~~^^^^^^^^^^^
2023-05-23 08:43:25 ------------------------------------------------------------------------------------
2023-05-23 08:43:25 Checking if reel : Cskbj7uJe9e already downloaded
2023-05-23 08:43:25 ------------------------------------------------------------------------------------
2023-05-23 08:43:25 Checking if reel : CskAK2dpjjY already downloaded
2023-05-23 08:43:25 ------------------------------------------------------------------------------------
2023-05-23 08:43:25 Checking if reel : CsjiJBwp-g9 already downloaded
2023-05-23 08:43:25 ------------------------------------------------------------------------------------
2023-05-23 08:43:25 Checking if reel : Csh60XfyrKa already downloaded
2023-05-23 08:43:25 ------------------------------------------------------------------------------------
2023-05-23 08:43:25 Checking if reel : CshO89KMW7X already downloaded
2023-05-23 08:43:25 ------------------------------------------------------------------------------------
2023-05-23 08:43:25 Checking if reel : Cse6izjpRi_ already downloaded
2023-05-23 08:43:25 ------------------------------------------------------------------------------------
2023-05-23 08:43:25 Checking if reel : CseVp4CJn8d already downloaded
2023-05-23 08:43:25 ------------------------------------------------------------------------------------
2023-05-23 08:43:25 Checking if reel : CscUjm4PMnT already downloaded
2023-05-23 08:43:25 ------------------------------------------------------------------------------------
2023-05-23 08:43:25 Checking if reel : Csb2qGruVwY already downloaded
2023-05-23 08:43:25 ------------------------------------------------------------------------------------
2023-05-23 08:43:25 Checking if reel : CsaGqzXvn8y already downloaded
2023-05-23 08:43:25 ------------------------------------------------------------------------------------
2023-05-23 08:43:25 Checking if reel : CsZvNhqrqXl already downloaded
2023-05-23 08:43:25 Downloading Reel From : ######| Code : CsZvNhqrqXl
2023-05-23 08:43:25 Downloaded Reel Code : CsZvNhqrqXl | Path : /app/downloads/346855937_949430492917028_3026319371463321531_n.mp4
2023-05-23 08:43:25 <---------Database Insert Start--------->
2023-05-23 08:43:25 Inserting Record...
2023-05-23 08:43:25 <---------Database Insert End--------->
2023-05-23 08:43:25 ------------------------------------------------------------------------------------
2023-05-23 08:43:25 Checking if reel : CsXPlbBv0lJ already downloaded
2023-05-23 08:43:25 Downloading Reel From : ######| Code : CsXPlbBv0lJ
2023-05-23 08:43:25 Downloaded Reel Code : CsXPlbBv0lJ | Path : /app/downloads/347232618_796613071823795_6243094293573088586_n.mp4
2023-05-23 08:43:25 <---------Database Insert Start--------->
2023-05-23 08:43:25 Inserting Record...
2023-05-23 08:43:25 <---------Database Insert End--------->
2023-05-23 08:43:25 ------------------------------------------------------------------------------------
2023-05-23 08:43:25 Checking if reel : CsW4Ufasj5p already downloaded
2023-05-23 08:43:25 Downloading Reel From : ######| Code : CsW4Ufasj5p
2023-05-23 08:43:25 Downloaded Reel Code : CsW4Ufasj5p | Path : /app/downloads/347409108_1438697513332660_2253003636426130563_n.mp4
2023-05-23 08:43:25 <---------Database Insert Start--------->
2023-05-23 08:43:25 Inserting Record...
2023-05-23 08:43:25 <---------Database Insert End--------->
2023-05-23 08:43:25 ------------------------------------------------------------------------------------
2023-05-23 08:43:25 Checking if reel : CsUf9yUvAMP already downloaded
2023-05-23 08:43:25 Downloading Reel From : ######| Code : CsUf9yUvAMP
2023-05-23 08:43:25 Downloaded Reel Code : CsUf9yUvAMP | Path : /app/downloads/347586709_3087019651443651_690258819643649350_n.mp4
2023-05-23 08:43:25 <---------Database Insert Start--------->
2023-05-23 08:43:25 Inserting Record...
2023-05-23 08:43:16 KeyError: 'graphql'
2023-05-23 08:43:25 <---------Database Insert End--------->
2023-05-23 08:43:25 ------------------------------------------------------------------------------------
2023-05-23 08:43:25 Checking if reel : CsUIiNBrH-- already downloaded
2023-05-23 08:43:25 Downloading Reel From : #######| Code : CsUIiNBrH--
2023-05-23 08:43:25 Downloaded Reel Code : CsUIiNBrH-- | Path : /app/downloads/347300932_3434602830147495_6707128549909630610_n.mp4
2023-05-23 08:43:25 <---------Database Insert Start--------->
2023-05-23 08:43:25 Inserting Record...
2023-05-23 08:43:25 <---------Database Insert End--------->
2023-05-23 08:43:25 ------------------------------------------------------------------------------------
2023-05-23 08:43:25 Checking if reel : CsSQTLXyiiy already downloaded
2023-05-23 08:43:25 Downloading Reel From : ######| Code : CsSQTLXyiiy
2023-05-23 08:43:25 Downloaded Reel Code : CsSQTLXyiiy | Path : /app/downloads/347509324_1031174991183217_3685043910534271076_n.mp4
2023-05-23 08:43:25 <---------Database Insert Start--------->
2023-05-23 08:43:25 Inserting Record...
2023-05-23 08:43:25 <---------Database Insert End--------->
2023-05-23 08:43:25 ------------------------------------------------------------------------------------
2023-05-23 08:43:25 Checking if reel : CsRyKv2PvEj already downloaded
2023-05-23 08:43:25 Downloading Reel From : #######| Code : CsRyKv2PvEj
2023-05-23 08:43:25 Downloaded Reel Code : CsRyKv2PvEj | Path : /app/downloads/347409913_760363252137240_9087785328888580782_n.mp4
2023-05-23 08:43:25 <---------Database Insert Start--------->
2023-05-23 08:43:25 Inserting Record...
2023-05-23 08:43:25 <---------Database Insert End--------->
2023-05-23 08:43:25 ------------------------------------------------------------------------------------
2023-05-23 08:43:25 Checking if reel : CsPpQbUJKIv already downloaded
2023-05-23 08:43:25 Downloading Reel From : #####| Code : CsPpQbUJKIv
2023-05-23 08:43:25 Downloaded Reel Code : CsPpQbUJKIv | Path : /app/downloads/347219660_625695806095852_4763557185968894839_n.mp4
2023-05-23 08:43:25 <---------Database Insert Start--------->
2023-05-23 08:43:25 Inserting Record...
2023-05-23 08:43:25 <---------Database Insert End--------->
2023-05-23 08:43:25 ------------------------------------------------------------------------------------
2023-05-23 08:43:25 Checking if reel : CsO2o3iJhU0 already downloaded
2023-05-23 08:43:25 Downloading Reel From : #####| Code : CsO2o3iJhU0
2023-05-23 08:43:25 Downloaded Reel Code : CsO2o3iJhU0 | Path : /app/downloads/347421415_597748752368267_5234383176623002043_n.mp4
2023-05-23 08:43:25 <---------Database Insert Start--------->
2023-05-23 08:43:25 Inserting Record...
2023-05-23 08:43:25 <---------Database Insert End--------->
2023-05-23 08:43:25 ------------------------------------------------------------------------------------
2023-05-23 08:43:25 Checking if reel : CsNDT9QxN2Z already downloaded
2023-05-23 08:43:25 Downloading Reel From : ######| Code : CsNDT9QxN2Z
2023-05-23 08:43:25 Downloaded Reel Code : CsNDT9QxN2Z | Path : /app/downloads/346482109_762780062191353_2046608268295852514_n.mp4
2023-05-23 08:43:25 <---------Database Insert Start--------->
2023-05-23 08:43:25 Inserting Record...
2023-05-23 08:43:25 <---------Database Insert End--------->
2023-05-23 08:43:25 ------------------------------------------------------------------------------------
2023-05-23 08:43:25 Checking if reel : CsMQc6DgUdI already downloaded
2023-05-23 08:43:25 Downloading Reel From : #######| Code : CsMQc6DgUdI
2023-05-23 08:43:25 Downloaded Reel Code : CsMQc6DgUdI | Path : /app/downloads/347069771_794502908692983_7837390553945540407_n.mp4
2023-05-23 08:43:25 <---------Database Insert Start--------->
2023-05-23 08:43:25 Inserting Record...
2023-05-23 08:43:25 <---------Database Insert End--------->
2023-05-23 08:43:25 ------------------------------------------------------------------------------------
2023-05-23 08:43:25 Checking if reel : CsJniLAO_qf already downloaded
2023-05-23 08:43:25 Downloading Reel From : ######| Code : CsJniLAO_qf
2023-05-23 08:43:25 Downloaded Reel Code : CsJniLAO_qf | Path : /app/downloads/345448445_196407313279066_1540270276426300064_n.mp4
2023-05-23 08:43:25 <---------Database Insert Start--------->
2023-05-23 08:43:25 Inserting Record...
2023-05-23 08:43:25 <---------Database Insert End--------->
2023-05-23 08:43:25 ------------------------------------------------------------------------------------
2023-05-23 08:43:25 Checking if reel : CsHnVt9v_ye already downloaded
2023-05-23 08:43:25 Downloading Reel From : #######| Code : CsHnVt9v_ye
2023-05-23 08:43:25 Downloaded Reel Code : CsHnVt9v_ye | Path : /app/downloads/346339525_229035853093341_7828860962402467640_n.mp4
2023-05-23 08:43:25 <---------Database Insert Start--------->
2023-05-23 08:43:25 Inserting Record...
2023-05-23 08:43:25 <---------Database Insert End--------->
2023-05-23 08:43:25 ------------------------------------------------------------------------------------
2023-05-23 08:43:25 Checking if reel : CsHPQ0YPqU5 already downloaded
2023-05-23 08:43:25 Downloading Reel From : ########| Code : CsHPQ0YPqU5
2023-05-23 08:43:25 Downloaded Reel Code : CsHPQ0YPqU5 | Path : /app/downloads/346278436_1314562846082607_5102268896962844247_n.mp4
2023-05-23 08:43:25 <---------Database Insert Start--------->
2023-05-23 08:43:25 Inserting Record...
2023-05-23 08:43:25 <---------Database Insert End--------->
2023-05-23 08:43:25 ------------------------------------------------------------------------------------
2023-05-23 08:43:25 Checking if reel : CsFGkw1vPzQ already downloaded
2023-05-23 08:43:25 Downloading Reel From : ########| Code : CsFGkw1vPzQ
2023-05-23 08:43:25 Downloaded Reel Code : CsFGkw1vPzQ | Path : /app/downloads/346236196_783121733202427_8040398843527019567_n.mp4
2023-05-23 08:43:25 <---------Database Insert Start--------->
2023-05-23 08:43:25 Inserting Record...
2023-05-23 08:43:25 <---------Database Insert End--------->
2023-05-23 08:43:25 ------------------------------------------------------------------------------------
2023-05-23 08:43:25 Checking if reel : CsEuqV4M4q6 already downloaded
2023-05-23 08:43:25 Downloading Reel From : #######| Code : CsEuqV4M4q6
2023-05-23 08:43:25 Downloaded Reel Code : CsEuqV4M4q6 | Path : /app/downloads/345062473_1645866029220471_2371710895507025402_n.mp4
2023-05-23 08:43:25 <---------Database Insert Start--------->
2023-05-23 08:43:25 Inserting Record...
2023-05-23 08:43:25 <---------Database Insert End--------->
2023-05-23 08:43:25 ------------------------------------------------------------------------------------
2023-05-23 08:43:25 Checking if reel : CsCShYGLcVc already downloaded
2023-05-23 08:43:25 Downloading Reel From : #######| Code : CsCShYGLcVc
2023-05-23 08:43:25 Downloaded Reel Code : CsCShYGLcVc | Path : /app/downloads/346250458_2196712077204652_3111672043346103779_n.mp4
2023-05-23 08:43:25 <---------Database Insert Start--------->
2023-05-23 08:49:21 'graphql'
2023-05-23 08:49:21 Traceback (most recent call last):
2023-05-23 08:49:21 File "/usr/local/lib/python3.11/site-packages/instagrapi/mixins/user.py", line 192, in user_info_by_username
2023-05-23 08:49:21 user = self.user_info_by_username_gql(username)
2023-05-23 08:49:21 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-05-23 08:49:21 File "/usr/local/lib/python3.11/site-packages/instagrapi/mixins/user.py", line 145, in user_info_by_username_gql
2023-05-23 08:49:21 return extract_user_gql(self.public_a1_request(f"/{username!s}/")["user"])
2023-05-23 08:49:21 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-05-23 08:49:21 File "/usr/local/lib/python3.11/site-packages/instagrapi/mixins/public.py", line 220, in public_a1_request
2023-05-23 08:49:21 raise e
2023-05-23 08:49:21 File "/usr/local/lib/python3.11/site-packages/instagrapi/mixins/public.py", line 212, in public_a1_request
2023-05-23 08:49:21 return response["graphql"]
2023-05-23 08:49:21 ~~~~~~~~^^^^^^^^^^^
2023-05-23 08:49:21 KeyError: 'graphql'

additionally here is my config file with the usernames and PW info removed, I am updating the config to post only every 4 hours and removing the hashtags, additionally I alter the poster.py file to remove the text from the post, here is the block after my changes

Magic Starts Here

def main(api):
try:
reel = get_reel()
if os.path.exists(reel.file_path):
media = api.clip_upload(
reel.file_path,
reel.caption + " " + config.HASHTAGS,
extra_data={
# "custom_accessibility_caption": "alt text example",
"like_and_view_counts_disabled": config.LIKE_AND_VIEW_COUNTS_DISABLED,
"disable_comments": config.DISABLE_COMMENTS,
})

Config.py
import os

#Config Variables
CURRENT_DIR = os.getcwd() + os.sep

#SQLite DB path
DB_PATH = CURRENT_DIR + 'database' + os.sep + 'sqlite.db'

#Download Path
DOWNLOAD_DIR = CURRENT_DIR + 'downloads' + os.sep #Path of folder where files will be stored

Fetch LIMIT for scraper script

FETCH_LIMIT = 10

Posting interval in Minutes

POSTING_INTERVAL_IN_MIN = 240 # Every 4 hours

Scraper interval in Minutes

SCRAPER_INTERVAL_IN_MIN = 720 # Every 12 hours

Instagram Username & Password

USERNAME = "-------"
PASSWORD = "--------"

#YOUTUBE API KEY
YOUTUBE_API_KEY = "YOUR_API_KEY"

Account List for scraping

ACCOUNTS = [
"--------",
"-------"

]

YouTube Channel List short for scraping

CHANNEL_LINKS = [
"https://www.youtube.com/@exampleChannleName."
]

HASHTAGS to add while Posting

HASHTAGS = ""

instagrapi.exceptions.LoginRequired: login_required

The script worked the first few times but it seems to have stopped working somehow.
I get an error as soon as I run start.py or app.py

image

I don't think I have changed anything in my way to start the script between when it worked and now.

Filter posts plus new ideas and suggestions

Firstly, thank you for this amazing script and for taking time and bringing this to us.

Is your feature request related to a problem? Please describe.
Cannot filter the posts plus more suggestions and ideas

Describe the solution you'd like

1) It would be amazing if one could filter out the posts based on likes, view counts and comments.

A filter to specify how old a reel should be
post reels older than (in days): 5
post reels not older than (in weeks): 5

Filter based on likes, views and comments (only these reels will be reposted)
minimun number of like: 1000
minimum no. of views: 20000
minimum no. of comments: 35

2) Caption

  1. Copy the original caption from the post
  2. Copy username and post it in caption to mention the OC
  3. Have a prefix caption: "DM for credits or removal"

3) Post at "irregular intervals" to mimick human behaviour

Additional context
If this could post images, it will become the ULTIMATE tool for instagram reposting.

Thank you

add a two factor auth login

Can you make a two factor auth login please. If you can, reply to this with your discord, tele, twitter, etc. I will pay you via Crypto. Thanks

It stopped working

Describe the bug
Everything was fine when running start.py but after 5 posts posting every 4 hours each it start.py stopped somehow, it logs in and just does nothing. I thought that this may have something to do with the session so I deleted session.json and tried running it again, this time it logged in but didn't do anything even though I kept running start.py for like an hour. As you can see on the screenshot it just stays like this

Expected behavior
Log in and start posting with the interval given as always.

Screenshots
![Ekran görüntüsü 2023-06-25 144014](https://github.com/Avnsh1111/Instagram-Reels-Scraper-Auto-Poster/assets/70358147/643bbfa4-0a3b-413e-8b5c-6c78

Version
Newest one

Additional context
Thank you for reviewing the problem

Posting Issue

When running app.py, the scraper runs for the specified targeted accounts, however the poster does not run automatically after the scraping is finished.

Even when I turn off the scraper (put a 0 by scraper variables) the poster still does not run. Please help with this.

It does not mark the shared reels as shared in the database.

It does not mark the shared reels as shared in the database. So it uploads the same reels over and over again.
And sometimes it does not share on the page and story section, although it appears shared on the console screen.
How can i fix or what's wrong?
Thank you in advance!

When using Docker, poster.py exits without running

I have configured docker following the setup steps, the logs show that reels.py is able to run and download videos, however poster.py will run for a seconds before saying poster (exit status 0; expected)

I am able to run this locally on my machine with the same settings as expected, but in docker I am unable to get posting to work.

Thanks in advanced for making this amazing script and any assistance you can provide! <3

help me pls

Hello, I want to download only posts from a certain user and upload them to my own account, but it does not work, it is constantly scanning but does not download screenshot =
image

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.