Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
__pycache__
config.conf*
misc
logs/*
.fuse_hidden*
.vscode
*.log
*.code-workspace
228 changes: 0 additions & 228 deletions ChaturbateRecorder.py

This file was deleted.

17 changes: 7 additions & 10 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
# ChaturbateRecorder

All credits to @beaston02 and @ahsand97
All credits to @beaston02, @ahsand97 and @Damianonymous

This is script to automate the recording of public webcam shows from chaturbate.com.
This is a script to automate the recording of public webcam shows from chaturbate.com.


I have tested this on debian(7+8), ubuntu 14, freenas10 (inside a jail), and Mac OS X (10.10.4), but it should run on other OSs
I do not have a windows machine to test on, but I had another user test it on windows and has reported the 6/21/17 update as working on windows 10 using python3.6.2 (may also work on python3.5+)
## Requirements

Requires python3.5 or newer. You can grab python3.5.2 from https://www.python.org/downloads/release/python-352/
Requires python3.5 or newer.

to install required modules, run:
to install the required modules, run:
```
python3.5 -m pip install streamlink bs4 lxml gevent
python3 -m pip install streamlink bs4 lxml gevent
```


Edit the config file (config.conf) to point to the directory you want to record to, where your "wanted" file is located, which genders, and the interval between checks (in seconds)
Copy the config file `config.conf.dist` to `config.conf` and edit to point to the directory you want to record to, where your "wishlist" file is located, which genders, and the interval between checks (in seconds)

Add models to the "wanted.txt" file (only one model per line). The model should match the models name in their chatrooms URL (https://chaturbate.com/{modelname}/). T clarify this, it should only be the "modelname" portion, not the entire url.
Add models to the "wishlist.txt" file (only one model per line). The model should match the model's name in their chatrooms URL (https://chaturbate.com/{modelname}/). To clarify this, it should only be the "modelname" portion, not the entire url.
45 changes: 24 additions & 21 deletions config.conf → config.conf.dist
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[paths]
wishlist = ./wanted.txt
save_directory = ./captures
wishlist = wishlist.txt
save_directory = .

# set the directory structure - default is "{path}/{model}/{st}_{model}.mp4"
# {path} = save_directory set above. (your directory structure should start with this)
Expand All @@ -11,19 +11,23 @@ save_directory = ./captures
# example using a madeup "hannah" who is female: {path}/{gender}/{model}/{year}/{year}.{month}.{day}_{hour}.{minutes}.{seconds}_{model}.mp4 = "/Users/Joe/chaturbate/Female/hannah/2017/{year}.07.26_19.34.47_hannah.mp4"
# This will also be the "Download directory" if you set a "completed_directory"

directory_structure = {path}/{model}/{year}.{month}.{day}_{hour}.{minutes}.{seconds}_{model}.mp4
directory_structure = {path}/{model}/{model}_{year}{month}{day}_{hour}{minutes}{seconds}.mp4


# (OPTIONAL) - leave blank if you dont want files moved after completed
# The files will be moved here once the stream has ended. The same naming structure will be used as above
# if this is left empty, the videos wll remain in the same directory they were originally saved to
# This path should be to a directory, not a filename! so do not include the filename portion, only the directory.

completed_directory =
completed_directory =


[settings]
checkInterval = 20
check_online_interval = 300

# Specify the maximum duration of recordings in minutes. Shows longer than this are split into separate files

max_duration_mins = 60

# Specify the genders you would like to monitor to record. Separate multiple genders with a comma
# acceptable genders are female, male, trans, and couple
Expand All @@ -34,25 +38,24 @@ genders = female, couple
# You can set a command to be ran on the file once it is completed. This can be any sort of a script you would like.
# You can create a script to convert the video via ffmpeg to make it compatible for certain devices, create a contact sheet of the video
# upload the video to a cloud storage drive via rclone, or whatever else you see fit.
# set the string to be the same as you you would type into terminal to call the script manually.
# The peramaters which will be passed to the script are as follows:
# 1 = full file path (ie: /Users/Joe/chaturbate/Female/hannah/2017/2017.07.26_19.34.47_hannah.mp4)
# 2 = filename (ie : 2017.07.26_19.34.47_hannah.mp4)
# 3 = directory (ie : /Users/Joe/chaturbate/Female/hannah/2017/)
# 4 = models name (ie: hannah)
# 5 = gender (ie: Female)
# to call a bash script called "MoveToGoogleDrive.sh" and located in the user Joes home directory, you would use:
# Set the string to be the same as you would type into the terminal to call the script manually.
# The variables that can be substituted as part of the script command are as follows:
# {path} = full file path (ie. /Users/Joe/chaturbate/Female/hannah/2017/2017.07.26_19.34.47_hannah.mp4)
# {filename} = filename (ie. 2017.07.26_19.34.47_hannah.mp4)
# {directory} = directory (ie. /Users/Joe/chaturbate/Female/hannah/2017/)
# {file} = The base filename, without extension (ie. 2017.07.26_19.34.47_hannah)
# {model} = models name (ie. hannah)
# For example to re-encode the file with ffmpeg, you can use
# postProcessingCommand = "ffmpeg -i {path} {directory}{file}_encoded.mp4"
#
# To call a bash script called "MoveToGoogleDrive.sh" and located in the user Joes home directory, you would use:
# postProcessingCommand = "bash /Users/Joe/home/MoveToGoogleDrive.sh"
# this script will be ran on the files "download location" prior to it being moved to its "completed location".
# The moving of the file will not take place if a post processing script is ran, so if you want to move it once it is completed, do so through commands in the script.
# This script will be ran on the files in the "save_directory" prior to it being moved to its "completed_directory".
# The moving of the files will not take place if a post processing script is ran, so if you want to move it once it is completed, do so through commands in the script.

postProcessingCommand =
postProcessingCommand =

# Because depending on what the post processing script does, it may be demanding on the system.
# Set the maximum number of concurrent post processing scripts you would like to be ran at one time.

postProcessingThreads =

[login]
username =
password =
postProcessingThreads = 2
27 changes: 27 additions & 0 deletions config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import configparser
import os
import sys

mainDir = sys.path[0]

def readConfig():
config = configparser.ConfigParser()
config.read(mainDir + '/config.conf')
settings = {
'save_directory': config.get('paths', 'save_directory'),
'directory_structure': config.get('paths', 'directory_structure').lower(),
'wishlist': config.get('paths', 'wishlist'),
'interval': int(config.get('settings', 'check_online_interval')),
'max_duration': int(config.get('settings', 'max_duration_mins')),
'postProcessingCommand': config.get('settings', 'postProcessingCommand'),
}
try:
settings['postProcessingThreads'] = int(config.get('settings', 'postProcessingThreads'))
except ValueError:
if settings['postProcessingCommand'] and not settings['postProcessingThreads']:
settings['postProcessingThreads'] = 1

if not os.path.exists(f'{settings["save_directory"]}'):
os.makedirs(f'{settings["save_directory"]}')

return settings
Loading