• Stars
    star
    134
  • Rank 270,967 (Top 6 %)
  • Language
    Python
  • License
    MIT License
  • Created over 4 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Snapchat Story Downloader

This program can search Snapchat's public Snap Map at multiple locations and download all stories for later investigation and categorization. A lot is unknown about how Snapchat decides which videos show up at which "point" on the map, so the scraper can also randomize the geolocation where it scrapes from by a few hundred meters to hopefully convince the API to give you a few more relevant videos.

This has been tested on Linux, but should work on Windows/Mac as well with a video viewer installed.

Install Instructions

git clone https://github.com/nemec/snapchat-map-scraper.git
cd snapchat-map-scraper/
python3 -m venv env  # create virtual environment
source env/bin/activate  # activate virtual environment
pip3 install -r requirements.txt

Usage

Follow each step in order. Also, ensure you have activated your virtual environment, otherwise the packages will be missing.

Create Database

This database holds data related to one group of search queries. Since SQLite produces database files with little overhead, you should create a new database each time you want to sample data.

python3 story_downloader.py create snap.db

Add locations

The add command will add a new location to the database. The program will later scrape and log snaps from all of the added locations so that you can track multiple spots at once. Find the latitude and longitude of your point of interest (this can easily be found on Snap Map, as seen below) and replace them in the command below. The label makes it easier to remember where a point is.

python3 story_downloader.py add --database snap.db --label "downtown dallas" 32.783038 -96.796388
# Added downtown dallas to database

snap map

Scraping media

The scrape command iterates through all of the added locations and downloads snaps at that location. Previews, videos, and overlays are all downloaded but the review command can only deal with video at the moment.

Optional arguments:

  • --randomize will randomize the geo location within 500m, intended to prompt Snapchat's API to send new videos that it hasn't yet served. I have no idea why Snapchat only sends a subset of the total videos for a single point, probably to make the service more scalable.
  • --repeat will cause the application to loop infinitely looking for new videos. Leave it running overnight to collect as much as possible.
  • --sleep will modify how long the application sleeps before repeating. Defaults to 120 seconds and only takes effect if --repeat is included.
  • A label can also be added as a positional argument to only scrape one location. Example: python3 story_downloader.py scrape "downtown dallas"
python3 story_downloader.py scrape --database snap.db --randomize --repeat
# Scraped 16 media from location downtown dallas
# Sleeping for 120 seconds...

Review media

The review command looks through all unreviewed videos and opens each one in a video player for review. Once you have closed the video player process, the CLI will prompt you for a "classification". This can be any text describing the situation in the video or a tag, etc. If the video is irrelevant, leave the classification blank and just hit "Enter". Once all remaining videos are classified, the application will exit. Depending on your operating system,

python3 story_downloader.py review --database snap.db
# Classify or leave blank: police protesters
# 15 remaining
# Classify or leave blank:
# 14 remaining
# Classify or leave blank: fire
# 13 remaining
# ...

Export media

The export command will copy all videos which are "classified" to a new folder for further review/editing/publishing.

python3 story_downloader.py export --database snap.db export/
# 3 video(s) exported
ls export/
# 2020-05-29-04:26:30-fire.mp4
# 2020-05-30-12:26:57-crowd.mp4
# '2020-05-30-21:16:22-line of people.mp4'

More Repositories

1

clipr

Command Line Interface ParseR for .Net
C#
89
star
2

pathlib

Path manipulation library for .Net
C#
60
star
3

porter2-stemmer

An implementation of the Porter2 stemming algorithm in C#
C#
29
star
4

JDHttpAPI

JDownloader2 plugin with a local HTTP API to add new files for download
Java
27
star
5

gedit-git-plugin

Gedit plugin that provides a simple interface to Git
Python
14
star
6

smartconf

Smart Configuration Management for C#
C#
13
star
7

gedit-smart-highlight-plugin

Highlight text elsewhere in a document that matches the currently selected text. Great for seeing where else you have used a word/variable.
Python
11
star
8

reddit-giveaway-bot

Reddit bot written in Python to automatically manage giveaways (such as for product codes and app licenses)
Python
10
star
9

Automaton

Automaton allows two-way communication with a computer through a variety of scriptable interfaces.
Python
8
star
10

elasticslurp

identify and investigate open ElasticSearch servers
Python
6
star
11

BlueNet

Bluetooth Mesh Network for Android
Java
6
star
12

ig-osint

Python
5
star
13

gedit-markdown-preview

Provides a keybinding to display an HTML rendering of a Markdown page in the user's web browser.
Python
5
star
14

omegle-cleverbot-connector

Connect omegle to cleverbot
Python
4
star
15

python-fusker

Useful tool to grab data from a range of urls (eg. www.example.com/photos/pic[1-9].jpg)
Python
4
star
16

git-ignore-command

A custom command for git to manage the gitignore file (with help from gitignore.io)
Python
4
star
17

gnome-shell-desktop-action-jump-list

Provides simple support in Gnome Shell for jump lists based on Desktop Actions in the Freedesktop Standard
JavaScript
3
star
18

django-nemec-skeleton

My skeleton for new django projects
Python
3
star
19

Reddit-Tools

Collection of tools/scripts I've developed to interact with Reddit's API
Python
3
star
20

Ire

Folder watcher. It's got it's eye'r something on your files.
Python
3
star
21

reddit-notify

Gnome Indicator Applet hook for your Reddit inbox
Python
3
star
22

cloudflare-tools

Tools that interact with Cloudflare
Shell
3
star
23

get-sans

Retrieve Subject Alternative Names from a server
Python
3
star
24

youtube-hovercard

Chrome plugin that lets you hover over a Youtube link and preview the video that's linked.
JavaScript
2
star
25

nemec.github.io

My Blog
HTML
2
star
26

GPSHeartbeat

Android app that POSTs GPS location to a (configurable) server at a specified interval.
Java
2
star
27

Textecute

Execute commands / retrieve information on your computer via SMS
Python
2
star
28

Better.Net

Convenience extensions for improving string manipulation in C#
C#
2
star
29

input_header

Parses the linux.h file (and other similar header files with many useful constants #defined) and makes the values easily available to a Python program.
Python
2
star
30

apples-android

An Android/Bluetooth implementation of the game
Java
2
star
31

generator

Enhanced Enumerators for C#
C#
2
star
32

nautilus-tineye-plugin

Nautilus plugin that allows searching an image on Tineye by right-click menu.
Python
2
star
33

clonermon

Poke Clone
Python
1
star
34

deck.lazyload.js

Load deck.js slides lazily using Ajax.
CSS
1
star
35

Automaton.Net

.Net port of Automaton
JavaScript
1
star
36

smartconf.sources

My custom smartconf sources.
C#
1
star
37

twitter_osint

Python
1
star
38

django-mpd-partymix

Allows to add songs to an mpd playlist
Python
1
star
39

dawkins-weasel

Implementation of Dawkins' Weasel thought experiment, with stats.
Python
1
star
40

mboxreader

Simple program to display the raw html in an mbox file specified at the command line.
C++
1
star
41

django-autocomplete

Autocompletion App for Django With Custom CSS
Python
1
star
42

markov-generator

Markov Chain Sentence Generator
Python
1
star
43

euler

My Project Euler Solutions
Python
1
star
44

dotnet-pluralizer

Pluralize words
1
star
45

4Realms

XNA game built for my Game Development class.
C#
1
star
46

ApplesToApples

Networks based Apples To ApplesGame
Java
1
star
47

regex-dictionary

Search a dictionary of words from the terminal using regular expressions
Python
1
star
48

ExtendedRandom

Provides extensions to the built in .Net System.Random class
C#
1
star
49

deck.annotate.js

Allows you to annotate deck.js presentation slides
JavaScript
1
star
50

Blossom

A Fabric-like deployment framework built in C# and tailored toward deployment on Windows machines.
C#
1
star
51

AnsiSharp

Print ANSI color-coded strings to System.Console.
C#
1
star
52

thumbsheet

A Python script for generating a sheet of thumbnails from a video.
Python
1
star
53

fun-with-smartconf

Interesting SmartConf samples
C#
1
star