diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..b003ae2 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 TeaCat + +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. diff --git a/README.md b/README.md index 4877a4c..d666eed 100644 --- a/README.md +++ b/README.md @@ -1,38 +1,142 @@ # Chaturbate DVR -The program watches a specified Chaturbate channel and save the stream in real-time when the channel goes online. +The program records Chaturbate stream, supports 32-bit/64-bit Windows, macOS, Linux (or ARM), comes with a Web UI. -**Warning**: The streaming content on Chaturbate is copyrighted, you should not copy, share, distribute the content. (for more information, check [DMCA](https://www.dmca.com/)) +※ **[DMCA WARNING](https://www.dmca.com/)**: Contents on Chaturbate are copyrighted, you should not copy, share, distribute the content. + +## Hello + +![image](./assets/image_1.png) +![image](./assets/image_2.png) + +``` +$ ./chaturbate-dvr -u emillybrowm start + + ██████╗██╗ ██╗ █████╗ ████████╗██╗ ██╗██████╗ ██████╗ █████╗ ████████╗███████╗ +██╔════╝██║ ██║██╔══██╗╚══██╔══╝██║ ██║██╔══██╗██╔══██╗██╔══██╗╚══██╔══╝██╔════╝ +██║ ███████║███████║ ██║ ██║ ██║██████╔╝██████╔╝███████║ ██║ █████╗ +██║ ██╔══██║██╔══██║ ██║ ██║ ██║██╔══██╗██╔══██╗██╔══██║ ██║ ██╔══╝ +╚██████╗██║ ██║██║ ██║ ██║ ╚██████╔╝██║ ██║██████╔╝██║ ██║ ██║ ███████╗ + ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚══════╝ +██████╗ ██╗ ██╗██████╗ +██╔══██╗██║ ██║██╔══██╗ +██║ ██║██║ ██║██████╔╝ +██║ ██║╚██╗ ██╔╝██╔══██╗ +██████╔╝ ╚████╔╝ ██║ ██║ +╚═════╝ ╚═══╝ ╚═╝ ╚═╝ +[2024-01-24 00:11:54] [INFO] [emillybrowm] channel created +[2024-01-24 00:11:55] [INFO] [emillybrowm] channel is online, start fetching... +[2024-01-24 00:11:55] [INFO] [emillybrowm] the stream will be saved as videos/emillybrowm_2024-01-24_00-11-55.ts +[2024-01-24 00:11:55] [INFO] [emillybrowm] resolution 1080p is used +[2024-01-24 00:11:55] [INFO] [emillybrowm] framerate 30fps is used +[2024-01-24 00:11:57] [INFO] [emillybrowm] segment #0 written +[2024-01-24 00:11:57] [INFO] [emillybrowm] segment #1 written +[2024-01-24 00:11:57] [INFO] [emillybrowm] segment #2 written +``` + +  ## Usage -The program works for 64-bit macOS, Linux, Windows (or ARM). Just get in the `/bin` folder and find your operating system then execute the program in terminal. +Start the program also enables the Web UI. Visit [`http://localhost:8080`](http://localhost:8080) to use the Web UI to manage channels. + +```yaml +# Windows +$ chaturbate-dvr.exe start + +# macOS or Linux +$ chaturbate-dvr start +``` + +  + +**💻 or... Run as a command-line tool** + +Run the program with a channel name (`-u CHANNEL_USERNAME`) records the channel immediately, and the Web UI will be disabled. + +```yaml +$ chaturbate-dvr -u CHANNEL_USERNAME start +``` + +  + +## Help + +```bash +$ chaturbate-dvr -h + +NAME: + chaturbate-dvr - Records your favorite Chaturbate stream 😎🫵 + +USAGE: + chaturbate-dvr [global options] command [command options] + +VERSION: + 1.0.0 + +COMMANDS: + start + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --username value, -u value channel username to record. + --framerate value, -f value preferred framerate. (default: 30) + --resolution value, -r value preferred resolution (default: 1080) + --resolution-fallback value, --rf value fallback to 'up' (larger) or 'down' (smaller) resolution if preferred resolution is not available (default: "down") + --filename-pattern value, --fp value filename pattern for videos (default: "videos/{{.Username}}_{{.Year}}-{{.Month}}-{{.Day}}_{{.Hour}}-{{.Minute}}-{{.Second}}{{if .Sequence}}_{{.Sequence}}{{end}}") + --split-duration value, --sd value minutes to split each video into segments ('0' to disable) (default: 0) + --split-filesize value, --sf value size in MB to split each video into segments ('0' to disable) (default: 0) + --log-level value log level, availables: 'DEBUG', 'INFO', 'WARN', 'ERROR' (default: "INFO") + --port value port to expose the web interface and API (default: "8080") + --help, -h show help + --version, -v print the version +``` + +**Examples**: + +```yaml +# Records in 720p/60fps +$ chaturbate-dvr -u yamiodymel -f 60 -r 720 start + +# Split the video every 30 minutes +$ chaturbate-dvr -u yamiodymel -sd 30 start + +# Split the video every 1024 MB +$ chaturbate-dvr -u yamiodymel -sf 1024 start + +# Change output filename pattern +$ chaturbate-dvr -u yamiodymel -fp video/{{.Username}}/{{.Year}}-{{.Month}}-{{.Day}}_{{.Hour}}-{{.Minute}}-{{.Second}}_{{.Sequence}} start +``` + +※ If the `-u CHANNEL_NAME` flag was not specified, the settings will be default settings for Web UI to create channels. + +  ## 📺 Framerate & Resolution / Fallback -A Fallback indicates what to do when there's no expected target resolution. +Fallback indicates what to do when there's no expected target resolution, imagine the situation: ``` Availables: 1080p, 720p, 240p -Resolution: 480p (Fallback: UP) +Resolution: 480p (fallback setted to: up) Result: 720p will be used + +Resolution: 480p (fallback setted to: down) + Result: 240p will be used ``` +  + ## 📄 Filename Pattern The format is based on [Go Template Syntax](https://pkg.go.dev/text/template), available variables are: `{{.Username}}`, `{{.Year}}`, `{{.Month}}`, `{{.Day}}`, `{{.Hour}}`, `{{.Minute}}`, `{{.Second}}`, `{{.Sequence}}` -Default: +  -``` -Pattern: video/{{.Username}}_{{.Year}}-{{.Month}}-{{.Day}}_{{.Hour}}-{{.Minute}}-{{.Second}}_{{.Sequence}} - Output: video/yamiodymel_2024-01-02_13-45-00_0.ts -``` - -👀 Hide sequence if it's zero, for better looking. +Default it hides the sequence if it's zero. ``` Pattern: {{.Username}}_{{.Year}}-{{.Month}}-{{.Day}}_{{.Hour}}-{{.Minute}}-{{.Second}}{{if .Sequence}}_{{.Sequence}}{{end}} @@ -40,11 +144,19 @@ Pattern: {{.Username}}_{{.Year}}-{{.Month}}-{{.Day}}_{{.Hour}}-{{.Minute}}-{{.Se Output: yamiodymel_2024-01-02_13-45-00_1.ts ``` -📁 Folders per each channel, non-exists folder will be created automatically. +**👀 or... The sequence can be shown even if it's zero.** + +``` +Pattern: {{.Username}}_{{.Year}}-{{.Month}}-{{.Day}}_{{.Hour}}-{{.Minute}}-{{.Second}}_{{.Sequence}} + Output: yamiodymel_2024-01-02_13-45-00_0.ts + Output: yamiodymel_2024-01-02_13-45-00_1.ts +``` + +**📁 or... Folder per each channel.** ``` Pattern: video/{{.Username}}/{{.Year}}-{{.Month}}-{{.Day}}_{{.Hour}}-{{.Minute}}-{{.Second}}_{{.Sequence}} Output: video/yamiodymel/2024-01-02_13-45-00_0.ts ``` -※ The file will be saved as `.ts` and it's not configurable. +※ The file will be saved as `.ts` format and it's not configurable. diff --git a/assets/image_1.png b/assets/image_1.png new file mode 100644 index 0000000..22d146e Binary files /dev/null and b/assets/image_1.png differ diff --git a/assets/image_2.png b/assets/image_2.png new file mode 100644 index 0000000..aabe675 Binary files /dev/null and b/assets/image_2.png differ