I searched a lot for a way to download the snaps from snapchat app using python the snaps that apear when you click of user photo and disapears after 24 hours
All what I found is downloading stories and managed to do that with this code
import requests
import re
import shutil
def download_file(download_url):
with requests.get(download_url, stream=True) as r:
with open(fr'video.png', 'wb') as f:
shutil.copyfileobj(r.raw, f)
url = 'https://story.snapchat.com/p/4cf3899b-690c-4872-a8a0-1c2f91db6563/2619293115389952'
headers = {
'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36',
}
response = requests.get(url, headers=headers)
download_url = re.search(
r'"snapUrls":{"mediaUrl":"([^"]+)', response.text).group(1)
download_file(download_url)
so If anyone have a way to download snaps, that it will be great