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 :).
Click to expand!
- python - 3.10 or higher (latest should be fine, add to PATH).
- ffmpeg - adding to path on windows*.
- rclone
- python-rclone
- mt - thumbnail sheet generator (the script uses prebuilt binaries from the repo, download and place in the same folder as the script.)
*Alternatively on windows, you can install chocolatey to install some of the required programs.
-
Install required python modules for the script:
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 editfansly-recorder.py
and add the following:- The rclone config
cat $HOME/.config/rclone/rclone.conf
for the host you want to push the files to - The remote path to
rcloneRemotePath
- The rclone config
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 forAuthorization:
and copy the value
The script will continue to loop and check for the model to be live every 5 minutes 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}
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:
bash start.sh {username}
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:
async with aiohttp.ClientSession(connector=connector, headers=config.headers) as session:
to the following:
async with aiohttp.ClientSession(headers=config.headers) as session:
"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 👺.