This script allows you to record fansly streams live to a .mp4 file and allows automatically uploading the VOD to a cloud service using rclone, and uses discord webhooks to keep you updated on the status(stream start/file conversion/upload).
⚠ This is currently under development, everything is still being planned out and tested. Feel free to use and create any issues to help with the development of it.
Thanks to the guys working on Fansly downloader for the new headers used here :).
Table of Contents
Click to expand!
*Alternatively on windows, you can install chocolatey to install some of the required programs.
pip install -r requirements.txt
# Or use a virtual environment for all the requirements.
# You will have to run the source command everytime you go to the directory in a new terminal to be able to run it
python3 - m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
Edit config.py
to add your fansly account token and configure what you want enabled.
Install and create a rclone remote (rclone config
) if you don't already have one and then edit fansly-recorder.py
and add the following:
cat $HOME/.config/rclone/rclone.conf
for the host you want to push the files torcloneRemotePath
Example:
rcloneConfig = """
[remote]
type = drive
scope = drive
token = {"access_token":"......."...}
"""
rcloneRemotePath = "remote:path/to/FanslyVods/"
go to fansly and login and open devtools.
In network request, type method:GET api
and refresh and click on one of the request
Look under Request Headers
and look for Authorization:
and copy the value
Alternatively:
Instead of clicking Network tab, go to Storage -> Local Storage -> https://fansly.com -> session_active_session and copy your token from there.
# Running
The script will continue to loop and check for the model to be live every 2 minutes and 10 seconds and then start to record, once finished it will push the file to the remote and go back to checking for the model to be live again.
Run the script:
```
python3 fansly-recorder.py {username}
```
Recommended to run the script in tmux to be able to close the terminal session.
Create a new tmux session:
```
tmux new -s Fansly
```
Again run the script:
```
python fansly-recorder.py {username}
```
Or edit the mprocs.yaml file with the models you want to monitor and simply run:
```
mprocs
```
⚠ Some processes may not startup correctly, so you may need to press `s` over the processes that say down several times until they go up.
press `ctrl + b` then `d` to detach from the session.
Alternatively, you can use the `start.sh` script to create the tmux instances and run the script:
*I didn't update this to work with the mprocs tool at this time*
```
bash start.sh {username}
```
[more on tmux](https://www.hamvocke.com/blog/a-quick-and-easy-guide-to-tmux/)
# Troubleshoot
### Hanging on start
If running locally, you may expierince hanging of the script. To get around this you'll need to edit `fansly-recorder.py` a bit. Under the `getAccountData` and `getStreamData` functions, you'll want to change the following line:
```python
async with aiohttp.ClientSession(connector=connector, headers=config.headers) as session:
```
to the following:
```python
async with aiohttp.ClientSession(headers=config.headers) as session:
```
# Super Serious And Needed Disclaimer
> "Fansly" is operated by Select Media LLC 👺.
>
> This repository and the provided content in it isn't in any way affiliated with, sponsored by, or endorsed by Select Media LLC or "Fansly" 👺.
>
> The developer of this script is not responsible for the end users' actions 👺.