Metadata-Version: 2.1
Name: lapsepy
Version: 0.2.0
Summary: A Python API wrapper for the social media app Lapse.
Home-page: https://github.com/quintindunn/lapsepy
Author: Quintin Dunn
Author-email: dunnquintin07@gmail.com
License: MIT License
        
        Copyright (c) 2023 Quintin Dunn
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Keywords: social media,lapsepy,api,api wrapper
Classifier: Development Status :: 5 - Production/Stable
Classifier: Operating System :: Microsoft :: Windows :: Windows 10
Classifier: Programming Language :: Python :: 3
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: certifi==2023.7.22
Requires-Dist: charset-normalizer==3.3.0
Requires-Dist: idna==3.4
Requires-Dist: Pillow==10.1.0
Requires-Dist: requests==2.31.0
Requires-Dist: urllib3==2.0.7

![LapsePy](./icon.png)
<div align = "center">
	<img src = "https://img.shields.io/pypi/v/lapsepy?label=PYPI%20Version">
	<img src = "https://img.shields.io/pypi/l/lapsepy">
	<img src = "https://img.shields.io/github/stars/quintindunn/lapsepy?label=GitHub%20Stars">
</div>

## Install
```pip install lapsepy```

## Features:
* Modify your bio, display name, date of birth, emojis, and username. Many past what's allowed on the app!
* Upload any image to your darkroom and make it develop at any time!
* Get your friends feed, and download images.

## Getting your refresh token:
One of the most challenging parts of this project is authentication, it uses Apple's App Attest in place of a captcha. As far as I'm aware there's no work around without jailbreaking your phone / using a modified version of the app. I'm planning on waiting for Lapse's Android version to try to reverse engineer it there.

### How to get your refresh token (Windows-Iphone):
* Log out of the app
* Install [MitMProxy](https://mitmproxy.org/) **Make sure to install all certificates required. [Certificates](https://docs.mitmproxy.org/stable/concepts-certificates/)**
* Start MitMWeb ignoring the host `register.appattest.apple.com` using `mitmweb --ignore-hosts register.appattest.apple.com`
* Get your computer's ip address. Open your terminal and write `ipconfig`
* On your phone go to Settings -> Network -> <Your network> -> info -> proxy -> manual and enter the proxy information.
* Open the Lapse app and sign in.
* Watch your proxies API calls for the second call to `https://auth.production.journal-api.lapse.app/verify` and inspect it.
* Go to the Response tab, and set `view` to `json`
* Copy the refresh token from the response.


## How to use examples:
1. Clone the repository `git clone https://github.com/quintindunn/lapsepy.git`
2. OPTION 1: Set your refresh token in your environment variable as `REFRESH_TOKEN`<br>
OPTION 2: In the examples replace the `os.getenv("REFRESH_TOKEN")` with `"YOUR_REFRESH_TOKEN"`
3. Run the file.
