snapchat_dl package

Submodules

snapchat_dl.cli module

Console script for snapchat_dl.

snapchat_dl.cli.main()[source]

Console script for snapchat_dl.

snapchat_dl.snapchat_dl module

The Main Snapchat Downloader Class.

class snapchat_dl.snapchat_dl.SnapchatDL(directory_prefix='.', max_workers=2, limit_story=-1, no_progress=False, quiet=False)[source]

Bases: object

download(username, tqdm_position=0)[source]

Download Snapchat Story for username.

Args:
username (str): Snapchat username
Returns:
[bool]: story downloader
download_url(url: str, dest: str)[source]

Download URL to destionation path.

Args:
url (str): url to download dest (str): absolute path to destination
Raises:
response.raise_for_status: if response is 4** or 50* FileExistsError: if file is already downloaded
endpoint = None

?request_origin=ORIGIN_WEB_PLAYER

get_stories(username)[source]

Download user stories.

Also check if username has stories available for download.

Args:
username (str): Snapchat username

Returns: [dict]: { “stories_available”: True, “data”: data, }

log(msg: str)[source]

Log message to console.

Args:
msg (str): message to log
media_type(media_type)[source]

Return file extension for Media Type.

Args:
media_type (str): Snapchat Snap Media Type
Returns:
str: File Extension to use for media_name
strf_time(timestamp, format_str)[source]

Format unix timestamp to custom format.

Args:
timestamp (int): unixtimestamp format_str (str): valid python date time format
Returns:
str: timestamp formatted to custom format.
valid_username(username)[source]

Validate Username.

Args:
username (str): Snapchat Username
Returns:
[bool]: True if username is valid.

Module contents

Top-level package for Snapchat Downloader.

class snapchat_dl.SnapchatDL(directory_prefix='.', max_workers=2, limit_story=-1, no_progress=False, quiet=False)[source]

Bases: object

download(username, tqdm_position=0)[source]

Download Snapchat Story for username.

Args:
username (str): Snapchat username
Returns:
[bool]: story downloader
download_url(url: str, dest: str)[source]

Download URL to destionation path.

Args:
url (str): url to download dest (str): absolute path to destination
Raises:
response.raise_for_status: if response is 4** or 50* FileExistsError: if file is already downloaded
endpoint = None

?request_origin=ORIGIN_WEB_PLAYER

get_stories(username)[source]

Download user stories.

Also check if username has stories available for download.

Args:
username (str): Snapchat username

Returns: [dict]: { “stories_available”: True, “data”: data, }

log(msg: str)[source]

Log message to console.

Args:
msg (str): message to log
media_type(media_type)[source]

Return file extension for Media Type.

Args:
media_type (str): Snapchat Snap Media Type
Returns:
str: File Extension to use for media_name
strf_time(timestamp, format_str)[source]

Format unix timestamp to custom format.

Args:
timestamp (int): unixtimestamp format_str (str): valid python date time format
Returns:
str: timestamp formatted to custom format.
valid_username(username)[source]

Validate Username.

Args:
username (str): Snapchat Username
Returns:
[bool]: True if username is valid.