Giter Site home page Giter Site logo

axiver / reddits-nightmare Goto Github PK

View Code? Open in Web Editor NEW
30.0 8.0 4.0 373 KB

Every Redditor's worst nightmare. This bot will automatically repost from reddit to Instagram.

Home Page: https://axiver.github.io/reddits-nightmare

License: GNU General Public License v3.0

JavaScript 100.00%
reddit instagram bot nightmare reposting experiment repost javascript js nodejs

reddits-nightmare's Introduction

reddits-nightmare

Don't you ever want to become the enemy of the people? reddits-nightmare is a bot that downloads any post from any subreddit, along with the post's title, and reuploads it to Instagram, causing massive havoc and ruins relationships once your close friends or families find out.

The reddit scraping module is currently broken

After reddit's API changes, the reddit-snooper package that the bot depends on is currently broken. As that package is no longer maintained by its original author, I will need to fork it and work on a fix, which would take a long time. Until then, you will have to manually download the posts from reddit and place them in /assets/images/approved. The bot will then upload the images to Instagram as usual.

Getting started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See Installing for notes on how to deploy the project on a live system.

Prerequisites

You need Node.js and npm (which comes with Node.js) to use this bot.

Download Node.js and npm

Installing

The bot

Download the bot by going to the releases page and download the zip of the latest release.

Node packages

After downloading Nodejs, npm and the bot, cd into the directory you installed the bot to and run npm i. It should automatically install all the needed modules for this bot to work.

Setup

Automated

This is the method I recommend as there isn't a reason for you to be performing the installation manually at all.

Run npm run start and the bot will perform first time setup. When the bot asks you if you want to use automated setup, type y or yes.

It will then ask you several questions. To find out what these questions mean and their significance, as well as how to answer them correctly (The bot is almost fool-proof, but that doesn't mean it can't be broken), please go to the config explanation page

Manual

Setting up manually is highly discouraged as human error will likely occur. But maybe you're adventurous. Head on over to the manual installation guide for instructions on how to setup this bot by yourself, without the help of modern technology.

Modification of files

To add in your custom captions, open up /configs/customcaption.txt (or create the file, if it doesn't already exist,) and save your custom caption into the contents of the file.

config.json and subreddits.txt is open for modification in case you entered any info wrongly. To fix either of the files, simply delete it and follow the steps shown above here, for the file again.

It is not recommended for you to manually modify the aforementioned files.

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the GNU GENERAL PUBLIC LICENSE - see the LICENSE file for details

If you like what I do, please consider keeping me alive

Donate

reddits-nightmare's People

Contributors

ananthvivekanand avatar axiver avatar skorotkiewicz avatar wuzado 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

reddits-nightmare's Issues

Adapting bot for use with other subreddits?

Hey Garlicvideos, long time no see!

Just a quick question, how easy would it be to adapt this bot to other subreddits.

I'm assuming it's just replacing the argument in the snoopReddit function

function snoopReddit(options) {
	snooper.watcher.getListingWatcher('all', options).on('item', function(item) {
	    if (item.kind = "t3" && isImage(item.data.url)) {
		  	let postUrl = item.data.url;
		  	let postTitle = item.data.title;
		  	let postID = item.data.id;
		  	let nsfw = item.data.over18;
			download(postUrl, postTitle, nsfw);
	    }
	}).on('error', console.error);
}

Human verification received from Instagram! Solving challenge...

Hello im new and very bad in coding can u explain me what i have to do ?
{ step_name: 'verify_code',
step_data:
{ security_code: 'None',
sms_resend_delay: 60,
phone_number_preview: '6 30',
resend_delay: 60,
contact_point: '6 30',
form_type: 'phone_number',
phone_number_formatted: '+33 * ** ** ** **',
phone_number: '+33 * ** ** ** **' },
user_id: 25521456322,
nonce_code: 'JVhDTBkdHu',
status: 'ok' }

Ty in advance

Downloading broken files

The bot will download a collection of images, most being okay.
I however have notice that it has downloaded an empty file with no file extension.

Trying to delete this file is not possible, unless opening the command prompt and force deleting the approved folder.

I have attached images of the resulting empty folder.

This is the file and its error message when trying to delete it for windows gui
image

This is the bot when trying to upload the file
image

After deleting this file successfully and running the bot again, the file is re-downloaded, and still broken, leading me to believe that it is in fact downloading an empty file

EDIT: The img URL that keeps braking is;
https://i.redd.it/hglmdbr5cie41.jpg

Issue running installer

Hello,
I am new to all of this so sorry if my questions seem really obvious.
When running the installer (after running npm i) I get an error message telling me that there is something wrong. I attached a screenshot I'd appreciate if someone could help me solve this. The file in question is in the directory so I don't understand why the installer can't find it. I tried this on both mac and windows, and got the same error.
Thanks, Leo
Capture

Will not progress after it has downloaded Images

I'm not sure if it is getting stuck downloading the images, or if it has completed the download.

But with options.limit set to 4 and in accounts, "top" is equal to 3, I do not get passed the download phase. Even though the program successfully downloads 2 photos.

Edit: After setting options.limit to 15, I'm stuck on downloading the 10th image
It's always getting stuck, just at a value lower than the set snoop amount
Another thing to note, this is after we have successfully signed into Instagram

Image "..." is bad

I have the Problem that around 70% of the posts do not get uploadet. Im new to programming.

Missing important files

Hello,

You have some important files in the .gitignore file which are necessary for the bot to function.

"self._addDefaultMeta is not a function" Can you help me with this error

C:\Users\kkarmegams\Desktop\Bot\Axiver\reddits-nightmare-3.0.0\bot>npm run start

[email protected] start
node beepboop.js

[3/9/2024, 4:08:41 PM] [Setup] Info: Prerequisites present, booting!
[3/9/2024, 4:08:52 PM] [Instagram] Info: Successfully logged in to Instagram!
[3/9/2024, 4:08:52 PM] [Instagram] Info: Uploading with a frequency of every 43200000ms
https://reddit.com/r/ProgrammerHumor/hot.json
C:\Users\kkarmegams\Desktop\Bot\Axiver\reddits-nightmare-3.0.0\bot\node_modules\winston\lib\winston\create-logger.js:80
self._addDefaultMeta(info);
^

TypeError: self._addDefaultMeta is not a function
at DerivedLogger. (C:\Users\kkarmegams\Desktop\Bot\Axiver\reddits-nightmare-3.0.0\bot\node_modules\winston\lib\winston\create-logger.js:80:14)
at RedditListingWatcher.emit (node:events:513:28)
at C:\Users\kkarmegams\Desktop\Bot\Axiver\reddits-nightmare-3.0.0\bot\node_modules\reddit-snooper\watcher.js:137:42
at Request._callback (C:\Users\kkarmegams\Desktop\Bot\Axiver\reddits-nightmare-3.0.0\bot\node_modules\reddit-snooper\watcher.js:65:21)
at self.callback (C:\Users\kkarmegams\Desktop\Bot\Axiver\reddits-nightmare-3.0.0\bot\node_modules\request\request.js:185:22)
at Request.emit (node:events:513:28)
at Request.onRequestError (C:\Users\kkarmegams\Desktop\Bot\Axiver\reddits-nightmare-3.0.0\bot\node_modules\request\request.js:877:8)
at ClientRequest.emit (node:events:513:28)
at TLSSocket.socketErrorListener (node:_http_client:502:9)
at TLSSocket.emit (node:events:513:28)
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

Getting syntax error while running beepboop

Line:2
Char:1
Error:Syntax error
Code:800A03EA

Here's the first few lines from when I open beepboop on notepad

//Initialise required libraries
const { IgApiClient, IgCheckpointError, IgLoginBadPasswordError, IgChallengeWrongCodeError } = require("instagram-private-api");
const ig = new IgApiClient();
const Bluebird = require("bluebird");
const fs = require("fs");
const request = require('request');

A stupid question about the bot

Hello,

I managed to get the script working but after the configuration I can't launch it again without doing the customization again.

Is there a way to launch the bot with the previous config ?

I want to be able to use cron @reboot

Thanks

Amount of posts per day or a time zone when the bot posts

First @Garlicvideos I love your Project

But I want that the bot posts only one or two pictures a day.
I trieded to use the function: "setInterval(chooseInstaPhoto, 1.5e+6);" and used a time of 12h --> 4.32e+7 but since I changed the line the bot wasn't posting at all.

Do you know what the Problem is or how i coud fix my Problem (maybe that isn't a good way and you know a better way to solve the Problem)

LG

Bot crashes everytime it tries to upload a post

Bot version: 1.2.2
Crash log:

(node:6092) UnhandledPromiseRejectionWarning: ParseError: Not possible to parse
API response
at Request.parseMiddleware (D:\Coding\Projects\nodejs\Unfinished\reddits-nig
htmare\bot\node_modules\instagram-private-api\dist\core\request.js:225:19)
at Request.errorMiddleware (D:\Coding\Projects\nodejs\Unfinished\reddits-nig
htmare\bot\node_modules\instagram-private-api\dist\core\request.js:229:25)
at Bluebird.try.catch.err (D:\Coding\Projects\nodejs\Unfinished\reddits-nigh
tmare\bot\node_modules\instagram-private-api\dist\core\request.js:281:22)
at tryCatcher (D:\Coding\Projects\nodejs\Unfinished\reddits-nightmare\bot\no
de_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (D:\Coding\Projects\nodejs\Unfinished\r
eddits-nightmare\bot\node_modules\bluebird\js\release\promise.js:512:31)
at Promise._settlePromise (D:\Coding\Projects\nodejs\Unfinished\reddits-nigh
tmare\bot\node_modules\bluebird\js\release\promise.js:569:18)
at Promise._settlePromise0 (D:\Coding\Projects\nodejs\Unfinished\reddits-nig
htmare\bot\node_modules\bluebird\js\release\promise.js:614:10)
at Promise._settlePromises (D:\Coding\Projects\nodejs\Unfinished\reddits-nig
htmare\bot\node_modules\bluebird\js\release\promise.js:690:18)
at _drainQueueStep (D:\Coding\Projects\nodejs\Unfinished\reddits-nightmare\b
ot\node_modules\bluebird\js\release\async.js:138:12)
at _drainQueue (D:\Coding\Projects\nodejs\Unfinished\reddits-nightmare\bot\n
ode_modules\bluebird\js\release\async.js:131:9)
at Async._drainQueues (D:\Coding\Projects\nodejs\Unfinished\reddits-nightmar
e\bot\node_modules\bluebird\js\release\async.js:147:5)
at Immediate.Async.drainQueues [as _onImmediate] (D:\Coding\Projects\nodejs
Unfinished\reddits-nightmare\bot\node_modules\bluebird\js\release\async.js:17:14
)
at runCallback (timers.js:705:18)
at tryOnImmediate (timers.js:676:5)
at processImmediate (timers.js:658:5)
(node:6092) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This
error originated either by throwing inside of an async function without a catch
block, or by rejecting a promise which was not handled with .catch(). (rejection
id: 1)
(node:6092) [DEP0018] DeprecationWarning: Unhandled promise rejections are depre
cated. In the future, promise rejections that are not handled will terminate the
Node.js process with a non-zero exit code.

custom caption issue

I've added hashtags in the custom caption file in the below format
<#hastag1 #hastag2 #hastag3>

But when the post gets published, it writes undefined.

How do you think I could fix this?

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.