Code Monkey home page Code Monkey logo

scrape_discord's Introduction

Scrape Discord channels

Installation (of requirements):

   pip install -r requirements.txt

If you're on Ubuntu (example of how to install and run the scraper):

	sudo apt install python3 python3-pip
	pip3 install -r requirements.txt
	python3 scrape_channels.py --token [token] -sid [server id]

It's important to note the 3 at the end of both pip and python here.

Usage:

   python scrape_channels.py --token [token] -sid [server id]
   or
   python scrape_channels.py --token [token] -sid [server id] -c [channel_id_1] [channel_id_2]

How to get server/channel id's: https://support.discordapp.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID-

NOTE! Can be used with user/password or with selfbots, but remember that these methods are disallowed, and any such use may put your account in peril. The allowed way to scrape is to register a bot to your discord server and use the bot's token.

If you still want to use a selfbot, here's how to retrieve a selfbot token: https://github.com/TheRacingLion/Discord-SelfBot/wiki/Discord-Token-Tutorial

Requirements: discordy.py, asyncio, python3.4+

Saves reactions and "cleaned" messages to different files

Tested with: python 3.4.3 python 3.6.3 (Ubuntu) python 3.6.4

scrape_discord's People

Contributors

arvinja 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

Watchers

 avatar  avatar

scrape_discord's Issues

TypeError: 'LogsFromIterator' object is not iterable

hi, i'm getting this error when trying to scrape a channel

# python scrape_channels.py --server_id X --user X --password X --token X --channels X
Logged in as
bamtan
------
scraping logs for general
Ignoring exception in on_ready
Traceback (most recent call last):
  File "C:\Users\user\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\client.py", line 307, in _run_event
    yield from getattr(self, event)(*args, **kwargs)
  File "scrape_channels.py", line 35, in on_ready
    yield from scrape_logs_from(channel)
  File "scrape_channels.py", line 69, in scrape_logs_from
    gen = yield from client.logs_from(channel, limit=1)
TypeError: 'LogsFromIterator' object is not iterable

Unclosed client session

So I am trying to use the script with aiohttp-2.3.7 yarl-1.1.0 and client/password mode.

but keep getting:

Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7fa011ae6dd8>

Any idea why its happening?

not sure if token working anymore

hi trying with token pulled from developer toolbar, in auth section as token not present anymore. but in cli i get discord.errors.LoginFailure: Improper token has been passed.

not sure if just me or not working anymore, would be good if someone else can verify

Export chat history from a specific discord user

I was wondering if it would be possible to add an extra condition in your script to only fetch message history from a specific user on a discord server? (ie. scrape all messages by an arbitrary user_id , instead of channel_id. I am struggling to find a proper solution. I will be grateful for any help you can provide.

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.