Code Monkey home page Code Monkey logo

pysnapstories's Introduction

Notice

Snapchat is constantly changing how their backend returns information (for the worse). The script may stop working at any time and no updates are guaranteed.

PySnapStories

A Python script to download public Snapchat user stories from verified accounts, subjects and Map events.

How to use

Go to https://story.snapchat.com/ and search for Snapchat stories you wish to download.

PySnapStories supports the following input formats:

loren (Username story)
c:LCfi6UdStalK_e-T5_WEK3jtBlY8js6KCOiJu_psBtsyHdrvG1KzpxvL8GG094H6ceU (Subject story)
m:q4_OINadScux6p1c6OgxRwAAEQtp2S0W_3UVaAWXqb9GaAWXqb838AAFRgA/ (Single Map Event story)
p:219c05b1bb1c710f (Map Event story)

You can obtain the above IDs through the Share function in the Snapchat web client: https://map.snapchat.com/

Be aware that with usernames, only officially verified Snapchat accounts are publicly visible and available for download. You will not be able to download any stories from regular accounts.

Folder structure is as following:

pysnapstories.py
└───snapchat
    └───StoryId_StoryTitle
        └───embedded
        └───overlay

For each user or other type of story a new folder will be created with the appropriate name.
Inside this folder the stories will be downloaded with visual overlays removed when possible.
The embedded folder contains the same stories but with the overlays untouched, just as you would see them on Snapchat.
When downloading usernames, an overlay folder will be created containing saved overlays whenever they are detected on Snapchat stories.

Example

> python3 pysnapstories.py loren
-----------------------------------------------------------------------------------------------
[I] PYSNAPSTORIES (SCRIPT V2.0 - PYTHON V3.7.3) - 07:15:11 PM
-----------------------------------------------------------------------------------------------
[I] Treating input as username. (no ID was detected)
[I] Starting download for user: loren
-----------------------------------------------------------------------------------------------
[I] Story Id     : loren
[I] Story Title  : Loren Gray
[I] Story amount : 8
-----------------------------------------------------------------------------------------------
[I] Grabbed video: iqGdye5oT8ylxcSlAVW3BwAAgVEPGUQK2HA6eAWxZR_PWAWxY7GSo_____w_media.mp4 (1/8)
[I] Grabbed video: iqGdye5oT8ylxcSlAVW3BwAAg9V5xSA3j4u4wAWxZqP-dAWxZqPkT_____w_media.mp4 (2/8)
[I] Grabbed image: iqGdye5oT8ylxcSlAVW3BwAAg9XpmNpYLjEecAWxapW7-AWxZwjTI_____w_media.jpg (3/8)
[I] Grabbed image: iqGdye5oT8ylxcSlAVW3BwAAgSmP4GN5-QRFhAWxZ6KzWAWxZwo47_____w_media.jpg (4/8)
[I] Grabbed video: iqGdye5oT8ylxcSlAVW3BwAAgCWU7JUt7_EycAWxZyBzrAWxZwxq7_____w_media.mp4 (5/8)
[I] Grabbed image: iqGdye5oT8ylxcSlAVW3BwAAgVg2Qt-KWzso9AWxdLbueAWxdLboX_____w_media.jpg (6/8)
[I] Grabbed video: iqGdye5oT8ylxcSlAVW3BwAAgRxcJG9KB8fvuAWxd5IQAAWxd5IBO_____w_media.mp4 (7/8)
[I] Grabbed video: iqGdye5oT8ylxcSlAVW3BwAAg6zi1f6iU5Lv5AWxeA74VAWxeA7rn_____w_media.mp4 (8/8)
-----------------------------------------------------------------------------------------------
[I] Finished downloading 3 image(s) and 5 video(s). (Excluding embedded files)
-----------------------------------------------------------------------------------------------

pysnapstories's People

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

pysnapstories's Issues

[Bug] SSL: CERTIFICATE_VERIFY_FAILED

So the script stopped working, looks like the api broke.
Here's my log from the script:

D:\PySnapStories-master>python pysnapstories.py elsiehewitt
-----------------------------------------------------------------------------------------------
PYSNAPSTORIES (SCRIPT V2.1 - PYTHON V3.7.4) - 04:21:25 AM
-----------------------------------------------------------------------------------------------
Treating input as username. (no ID was detected)
Starting download for user: elsiehewitt
Something went wrong: HTTPSConnectionPool(host='storysharing.snapchat.com', port=443): Max retries exceeded with url: /v1/fetch/elsiehewitt (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1076)')))
The script cannot continue, exiting.

D:\PySnapStories-master>python pysnapstories.py sommerray
-----------------------------------------------------------------------------------------------
PYSNAPSTORIES (SCRIPT V2.1 - PYTHON V3.7.4) - 04:21:26 AM
-----------------------------------------------------------------------------------------------
Treating input as username. (no ID was detected)
Starting download for user: sommerray
Something went wrong: HTTPSConnectionPool(host='storysharing.snapchat.com', port=443): Max retries exceeded with url: /v1/fetch/sommerray (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1076)')))
The script cannot continue, exiting.```

Script overwriting stories with similar names

Hi Dirk,
It seems that the script overwrites any stories from a certain user that has the same name, for some reason the stories filenames aren't unique, like if you download a story and try to download another story a week later ( from the same user ), there's a high chance that they would have the same filenames and the script would overwrite the old files.
Also, lets say I'm scraping "sommerray" stories, the script would make a folder by the name "sommerray_NoTitle" , if you create folders inside that folder , the script would delete them also.
I'm not sure on how to reproduce this bug.

Something went wrong: Expecting value: line 1 column 1 (char 0)

python3 pysnapstories.py loren
-----------------------------------------------------------------------------------------------
[I] PYSNAPSTORIES (SCRIPT V2.1 - PYTHON V3.6.0) - 06:52:12 AM
-----------------------------------------------------------------------------------------------
[I] Treating input as username. (no ID was detected)
[I] Starting download for user: loren
[E] Something went wrong: Expecting value: line 1 column 1 (char 0)
[E] The script cannot continue, exiting.

Any ideas?

[bug] Something went wrong: download_story() got an unexpected keyword argument 'is_overlay'

I started getting this error on multiple users:

D:\PySnapStories-master>python pysnapstories.py sommerray

PYSNAPSTORIES (SCRIPT V2.1 - PYTHON V3.7.4) - 12:56:27 AM

Treating input as username. (no ID was detected)
Starting download for user: sommerray

Story Id : sommerray
Story Title : Sommer-Ray
Story amount : 6

Something went wrong: download_story() got an unexpected keyword argument 'is_overlay'
The script cannot continue, exiting.

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.