Giter VIP home page Giter VIP logo

pokeminer's Introduction

pokeminer+

A Pokémon Go scraper capable of scanning large areas for Pokémon spawns over long periods of time. Features spawnpoint scanning, Twitter and PushBullet notifications, accurate expiration times and estimates based on historical data, pokestop and gym collection, a CAPTCHA solving script, and more.

A demonstration of the Twitter notifications can be viewed here.

How does it work?

It uses a database table of spawnpoints and expiration times to visit points soon after Pokemon spawn. For each point it determines which eligible worker can reach the point with the lowest speed, or tries again if all workers would be over the configurable speed limit. This method scans very efficiently and finds Pokemon very soon after they spawn, and also leads to unpredictable worker movements that look less robotic. The spawnpoint database continually expands as Pokemon are discovered. If you don't have enough accounts to keep up with the number of spawns in your database, it will automatically skip points that are unreachable within the speed limit or points that it has already seen spawn that cycle from other nearby points.

If you don't have an existing database of spawn points it will spread your workers out over the area you specify in config and collect the locations of spawn points from GetMapObjects requests. It will then visit those points whenever it doesn't have a known spawn (with its expiration time) to visit soon. So it will gradually learn the expiration times of more and more spawn points as you use it.

There's also a simple interface that displays active Pokemon on a map, and can generate nice-looking reports.

Here it is in action:

in action

Since it uses Leaflet for mapping, the appearance and data source can easily be configured to match any of these with the MAP_PROVIDER_URL config option.

Features

  • accurate timestamp information whenever possible with historical data
  • Twitter and PushBullet notifications
    • references nearest landmark from your own list
  • IV/moves detection, storage, and notification
    • produces nice image of Pokémon with stats for Twitter
    • can configure to get IVs for all Pokémon or only those eligible for notification
  • stores Pokémon, gyms, and pokestops in database
  • spawnpoint scanning with or without an existing database of spawns
  • automatic account swapping for CAPTCHAs and other problems
  • pickle storage to improve speed and reduce database queries
  • manual CAPTCHA solving that instantly puts accounts back in rotation
  • closely emulates the client to reduce CAPTCHAs and bans
  • automatic device_info generation and retention
  • aims at being very stable for long-term runs
  • able to map entire city (or larger area) in real time
  • reports for gathered data
  • asyncio coroutines
  • support for Bossland's hashing server
    • displays key usage stats in real time

Setting up

  1. Install Python 3.5 or later (3.6 is recommended)
  2. git clone https://github.com/Noctem/pokeminer.git or download the zip
  3. Copy config.example.py to config.py and customize it with your accounts, location, database information, and any other relevant settings. The comments in the config example provide some information about the options.
  4. pip3 install -r requirements.txt
  • Optionally pip3 install additional packages listed in optional-requirements
    • pushbullet.py is required for pushbullet notifications
    • python-twitter is required for twitter notifications
    • stem is required for proxy circuit swapping
    • shapely is required for landmarks or spawnpoint scan boundaries
    • selenium (and ChromeDriver) are required for solving CAPTCHAs
    • uvloop provides better event loop performance
    • pycairo is required for generating IV/move images
  1. Run python3 from the command line
  2. Input import db
  3. then db.Base.metadata.create_all(db.get_engine())
  4. Run scan.py
  • Optionally run the live map interface and reporting system: web.py

Note: Pokeminer works with Python 3.5 or later only. Python 2.7 is not supported and is not compatible at all since I moved from threads to coroutines. Seriously, it's 2016, Python 2.7 hasn't been developed for 6 years, why don't you upgrade already?

Note that if you want more than 10 workers simultaneously running, SQLite is likely not the best choice. I personally use and recommend PostgreSQL, but MySQL and SQLite should also work.

Reports

There are three reports, all available as web pages on the same server as the live map:

  1. Overall report, available at /report
  2. Single species report, available at /report/<pokemon_id>
  3. Gym statistics page, available by running gyms.py

The workers' live locations and stats can be viewed from the main map by enabling the workers layer, or at /workers (communicates directly with the worker process and requires no DB queries).

Here's what the overall report looks like:

report

The gyms statistics server is in a separate file, because it's intended to be shared publicly as a webpage.

gyms

License

See LICENSE.

This project is based on the coroutines branch of (now discontinued) pokeminer. Pokeminer was originally based on an early version of PokemonGo-Map, but no longer shares any code with it. It currently uses my lightly modified fork of pgoapi.

pokeminer's People

Contributors

noctem avatar modrzew avatar 6iz avatar foodforarabbit avatar ahaaaaaaa avatar jz6 avatar sykhro avatar monkeyleet avatar marauder37 avatar aiyubi avatar pdong avatar medghaim avatar dintriglia avatar andrewbroberg avatar nyubis avatar scyntrus avatar xdtrammell avatar benemorius avatar melonsmasher avatar marbink avatar svenluijten avatar shinhan avatar rofrankel avatar h3adsho0ot avatar denia42 avatar zechrales avatar szabolcsdombi avatar popsul avatar w0lfschild avatar yondergod avatar

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.