sim0n00ps / OF-DL

C# console app to download all of the media from Onlyfans accounts with DRM video downloading support
575 stars 55 forks source link

Add docker configuration #275

Closed whimsical-c4lic0 closed 4 months ago

whimsical-c4lic0 commented 5 months ago

This PR contains a Dockerfile and entrypoint script to allow users to run OF-DL in a docker container. This will allow users to run OF-DL on operating systems other than Windows without having to setup a .NET development environment.

To build an OF-DL docker image, simply execute: docker build -t of-dl . in the root of the repository

To run OF-DL in a docker container, then execute: docker run -it -v /{path to data directory}/:/data /{path to config directory}/:/config of-dl

{path to data directory} should be replaced with the path to the folder on your computer where the downloaded data should be saved. {path to config directory} should be replaced with the path to the folder on your computer where you want to store the config for OF-DL. If auth.json and config.json don't exist in the config directory, files with default values will be created when you run the docker container.

While it is not included in this PR, you can add a simple GitHub action to automatically publish new docker images when you create new releases.

sim0n00ps commented 5 months ago

Going to test this out on my Ubuntu machine, thanks for this

whimsical-c4lic0 commented 5 months ago

You're welcome! I've personally tested the branch natively on Ubuntu 20.04 as well as a WSL2 installation of Ubuntu 20.04 using Docker for Windows.

sim0n00ps commented 4 months ago

Sorry for the radio silence on this, I've been busy with other things. I did manage to get this working and completed a scrape fine. Only problem I found is that the ffmpeg logs appear in the terminal when downloading a DRM video, on Windows this doesn't happen, any reason why it might on Ubuntu etc?

whimsical-c4lic0 commented 4 months ago

Looking at the ProcessStartInfo object in the DownloadDrmMedia method, I'm not sure why the ffmpeg logs behave differently in Windows vs Linux. The default behavior for standard output redirection in dotnet processes must be different between operating systems.

No matter, my most recent commit that sets explicit values for UseShellExecute, RedirectStandardOutput, and RedirectStandardError seems to fix the issue.

sim0n00ps commented 4 months ago

Just done a scrape and ffmpeg logs no longer appear, thanks again for this