Coder Social home page Coder Social logo

docker-filebot's Introduction

docker-filebot

This is a Docker container for running FileBot, a media file organizer. The container has both a user interface as well as a fully automated mode. The GUI is exposed via RDP and HTTP. For the automated version, you just drop files into the input directory, and they'll be cleaned up and moved to the output directory.

This docker image is available on Docker Hub.

Usage

Interactive Method

To use this container for a user interface to FileBot:

docker run --name=FileBotUI -e WIDTH=1280 -e HEIGHT=720 -p 3389:3389 -p 8080:8080 -v /media/dir/path:/media:rw -v /config/dir/path:/config:rw coppit/filebot

In this mode, point the UI at the /media folder, which is shared with the host.

There are two ways to use the interactive user interface. One is to connect to the UI in your web browser with the URL http://host:8080/#/client/c/HandBrake. The second is to connect with a remote desktop client using port 3389. There are RDP clients for multiple platforms:

The second method is to point your web browser to http://:8080/. This will launch a web browser-based user interface.

Of course, if you change the host ports, then when you connect you'll have to specify the server as <host ip>:<host port>. Feel free to drop the 3389 mapping if you don't plan to use RDP, or the 8080 mapping if you don't plan to use the web browser.

Non-Interactive Method

If you want to run the container without a UI:

docker run --name=FileBot -d -v /input/dir/path:/input:rw -v /output/dir/path:/output:rw -v /config/dir/path:/config:rw coppit/filebot

With the default configuration, files written to the input directory will be renamed and copied to the output directory. It is recommended that you do not overlap your input and output directories. FileBot will end up re-processing files that it already processed, and generally make a mess of things.

Note that the /input path is writable above. This is because subtitles are first downloaded into the input directory before being moved to the output directory. Some people also prefer to move instead of renaming files. If you are paranoid about FileBot messing with your input files, and don't care about downloading subtitles, you can make /input read-only by removing ":rw".

When the container detects a change to the input directory, it will wait up to 60 seconds for changes to stop for 5 seconds. FileBot will be run if the directory stabilizes for 5 seconds, or if the 60 second maximum wait time elapses.

To check the status of the container, run:

docker logs FileBot

Both Methods

You can also combine all of the flags into one big command, to support both the UI as well as the automated conversion.

docker run --name=FileBot -e WIDTH=1280 -e HEIGHT=720 -p 3389:3389 -p 8080:8080 -v /media/dir/path:/media:rw -v /input/dir/path:/input:rw -v /output/dir/path:/output:rw -v /config/dir/path:/config:rw coppit/filebot

Just be careful not to use the /input directory with the UI. Otherwise you'll be triggering the automated update.

Configuration

When run for the first time, a config file named filebot.conf will be created in the config dir. (If you are upgrading from an old version, compare your existing filebot.conf against filebot.conf.new instead.) If you wish to download subtitles, edit the config file to set the username and password, as well as the language.

When run for the first time, a script named filebot.sh will be created in the config dir, and the container will exit. Edit this file, customizing how you want FileBot to run. For example, you might want to change the file rename formatting. Then restart the container.

While editing and testing your filebot.sh, keep in mind that FileBot (actually AMC) will not re-process files. Delete amc-exclude-list.txt in your config directory, then write a file into the input directory to get FileBot to re-process your files.

After you gain confidence in how the container is running, you may want to change the action from "copy" to "move". FileBot will move the files from the input to the output directory, then clean up any "leftover junk" in the input directory. If you're going to do this, then it's also probably a good idea to store temporary files and incomplete downloads in a different directory than the input directory, just in case FileBot decides to move them.

By default, FileBot will create files using user ID 0 (typically root) and group ID 0 (typically root), and with a umask of 0022. If you wish to change this, set the USER_ID, GROUP_ID, and UMASK environment variables to the right values from your host system. You can find the IDs using the "id" command. For example, for the user "nobody", it would be id -u nobody and id -g nobody. You can get the umask for a user like "nobody" by running su -l nobody -c umask.

The ALLOW_REPROCESSING setting controls whether FileBot can reprocess a file if it is created again in the input directory. You should delete amc-exclude-list.txt in your config directory if you enable this for the first time. Note that filebot will refuse to reprocess an input file if the output file already exists.

The USE_UI setting controls whether the user interface features are enabled. Set this to "yes" to enable the UI, which uses approximately 460MB of RAM, as opposed to 20MB of RAM. On my machine it uses .33% CPU instead of .03% CPU.

Updates to filebot.sh

Later, when you update the container, it may exit with this message in the log:

ERROR: The container's filebot.sh is newer than the one in /config. Copying the new script to /config/filebot.sh.new. Compare your filebot.sh and filebot.sh.new, being sure to copy over the VERSION line. Then restart the container.

This happens because some bugfix or something went into filebot.sh. Rather than deleting your filebot.sh (and losing any hard work you put into it), the container will write filebot.sh.new. It's your job to merge the two files. You can delete filebot.sh.new when you're done. NOTE: You must increase the VERSION even if you make no other changes. This will let the container know that you performed the merge. It will then start normally.

Advanced Configuration when Moving Files in FileBot

When using the non-interactive method, combined with FileBot's option to move instead of copy files, the moves can be slow if the container is configured with separate /input and /output directories. In this case, you can configure the container to operate on a single mounted volume. First, mount only the /media path:

docker run --name=FileBot -d -v /media/dir/path:/media:rw -v /config/dir/path:/config:rw coppit/filebot

Then, specify the INPUT_DIR and OUTPUT_DIR variables in your filebot.conf as subfolders of /media. Make sure that your output is not a subfolder of your input, or you'll confuse the change monitor.

Known Limitations

This container uses the inotify interface for watching for file system changes. This only works for kernel-supported file systems. It won't work for network shares.

docker-filebot's People

Contributors

coppit avatar johnbuluba avatar kmlucy avatar starbix avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-filebot's Issues

Web UI not working

I cannot get the web UI to work at http://:8080 as documented. Is there something broken?

ERROR: Found user "" with the proper user ID but incorrect group ID

Hello,

I ran into an issue when I try to run filebot for the first time

[Aug 31 02:01:24 PM] Running FileBot GUI
[2017-08-31 14:01:24] ERROR: Found user "" with the proper user ID but incorrect group ID. Refusing to modify the group ID. Exiting...

My docker-compose file does not specify a particular user (user id 0 like default dockerfile config) :

version: '2.1'

services:
filebot:
image: coppit/filebot
container_name: filebot
hostname: filebot
environment:
- USER_ID = 0
- GROUP_ID = 0
volumes:
- /mnt/docker/filebot/config:/config
- /mnt/docker/filebot/media:/media

Crashes and no console since QNAP Update

Hi,

iam using your Filebot with the Container Station in QNAP. Since the new Update 4.3 filebot crashes after some days. The console output is also not displayed anymore, its still working without the console display but will crash sooner or later. Any Ideas on that? With the QNAP Update 64bit was forced, could that be the problem?

Not processing my files unless I run touch on them

Hi, firstly many thanks for this docker, it is a great help.
I am running on a UNRAID 6.1 server
When my torrent client completes a download, the file is moved to a filebot folder to be processed. But it never seem to pick it up for days, I have to run touch on them to trigger filebot.
Any idea if it is my config?

Unrar and Large file copies fail randomly

I will occasionally have issues where filebot will extract a file and fail halfway but it doesn't know so it renames and moves the partial file. This only seems to happen on large files. I am not totally sure yet if it is just rar files or rar and large files. Either way it will partially copy the file to the destination but rename it so I don't know it is broken until I try to use it.

Problems with JRE

After updating UnRaid, im getting the following output in my log on every try trigering the script. Do someone has a clue what's that about?

---------------------------------- README-----------------------------------

Use excludes: /config/amc-exclude-list.txt (1)

A fatal error has been detected by the Java Runtime Environment:

SIGSEGV (0xb) at pc=0x0000154f72d43a72, pid=146, tid=0x0000154fee607700

JRE version: Java(TM) SE Runtime Environment (8.0_161-b12) (build 1.8.0_161-b12)

Java VM: Java HotSpot(TM) 64-Bit Server VM (25.161-b12 mixed mode linux-amd64 compressed oops)
Problematic frame:
C [libmediainfo.so.0+0x3c3a72]

Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again

An error report file with more information is saved as:

/tmp/hs_err_pid146.log

If you would like to submit a bug report, please visit:
http://bugreport.java.com/bugreport/crash.jsp
The crash happened outside the Java Virtual Machine in native code.
See problematic frame for where to report the bug.

Aborted

Java Prefs

Hi,

great work with the latest Update!
Its working fine but Iam getting the error below, any Ideas? I even set the permissions to 7777 but no change. It seems like java ignores the UID iam starting the container with, the folder got 100, 99 permissions.

Exception in thread "Thread-5" java.lang.SecurityException: Could not lock User prefs. Lock file access denied.                        
        at java.util.prefs.FileSystemPreferences.checkLockFile0ErrorCode(FileSystemPreferences.java:937)                               
        at java.util.prefs.FileSystemPreferences.lockFile(FileSystemPreferences.java:925)                                              
        at java.util.prefs.FileSystemPreferences.sync(FileSystemPreferences.java:729)                                                  
        at java.util.prefs.FileSystemPreferences.flush(FileSystemPreferences.java:824)                                                 
        at java.util.prefs.FileSystemPreferences.syncWorld(FileSystemPreferences.java:464)                                             
        at java.util.prefs.FileSystemPreferences.access$1200(FileSystemPreferences.java:50)                                            
        at java.util.prefs.FileSystemPreferences$4$1.run(FileSystemPreferences.java:442)

Can't get UMASK working

Hi,

just upgraded to the latest coppit/docker-filebot version and it seems something has changed in the handling of umask.

I start the container with docker-compose with the following config:

  filebot:
    image: coppit/filebot
    container_name: filebot
    environment:
      - GROUP_ID=1000
      - USER_ID=1000
      - UMASK=0022
    volumes:
      - /data/app-data/filebot:/config:rw
      - /data/ffffff:/input:rw
      - /data/gggg:/output:rw
    restart: unless-stopped

I've also added this to the end of my filebot.conf:

UMASK=0022
USER_ID=1000
GROUP_ID=1000

But when starting I see in the logs:

[2017-12-18 13:27:48] FileBot: CONFIGURATION:
[2017-12-18 13:27:48] FileBot:       WATCH_DIR=/input
[2017-12-18 13:27:48] FileBot: SETTLE_DURATION=10
[2017-12-18 13:27:48] FileBot:   MAX_WAIT_TIME=60
[2017-12-18 13:27:48] FileBot:      MIN_PERIOD=120
[2017-12-18 13:27:48] FileBot:         COMMAND=bash /files/filebot.sh
[2017-12-18 13:27:48] FileBot:         USER_ID=1000
[2017-12-18 13:27:48] FileBot:        GROUP_ID=1000
[2017-12-18 13:27:48] FileBot:           UMASK=0000
[2017-12-18 13:27:48] FileBot:           DEBUG=False
[2017-12-18 13:27:48] FileBot: IGNORE_EVENTS_WHILE_COMMAND_IS_RUNNING=False
[2017-12-18 13:27:48] FileBot: Starting monitor for FileBot
[2017-12-18 13:27:48] FileBot: Waiting for new change

It is a bit annoying because folder permissions are now 777 and files are 666. Anyone know how to fix this?

No permission on moved files

Hi Coppit,
Thanks for your amazing work.
I followed - I guess - carefully your readme, and got it working for my personal use. Still, moved files get their permissions set to "---------- 1 myuser mygroup" while every other moved file by my old not-dockerized filebot version were like "drwxrwxrwx+ 2 myuser mygroup".
Any idea about what I've could been doing wrong ?

IF it can help, here is my customized filebot.sh:

export GROUP_ID=100
export USER_ID=1026
export UMASK=022

debug purpose

filebot -script fn:sysenv --log all >> '/log/filebot.log' 2>&1

See http://www.filebot.net/forums/viewtopic.php?t=215 for details on amc

filebot -script fn:amc -no-xattr --output /output --log-file /log/amc.log --lang en --encoding utf8 --action keeplink --conflict skip
-non-strict --def ut_dir=/input ut_kind=multi music=y deleteAfterExtract=y clean=y
excludeList=/config/amc-exclude-list.txt $SUBTITLE_OPTION
movieFormat="$MOVIE_FORMAT" musicFormat="$MUSIC_FORMAT" seriesFormat="$SERIES_FORMAT" --log all

Cheers,
rwaesely

Problem with the container

Hello !

I used an another container (bytesized who are a semi-fork to yours) and i had to reinstall all my filebot so i tested your docker but i have a problem.

When a change is done in a directory,it run the command but i have no news,see this screen : https://puu.sh/v9ZHd/6285ab0ed2.png

It stay here and doesn't do anything. Any help ?
Thanks !

JRE Crashing

I am attempting to process files through the docker container and the initial rename operation goes smoothly with no errors and then upon starting the next job, no matter what it is, crashes the JRE. I have enabled debug in the configuration files of the container and these are the errors I am receiving.

CTRL+ F "JRE" to find where exactly the are.
filebot.pdf

slow file move

with the setup of /input and /output folder the move process is really slow even when the real /input and /output folder are on the same drive. it would be way faster to have only one folder for everything and just define the watchfolder as an offset of /input

Authentication

Is there a way to add some authentication to this? I'm running this container with an nginx reverse proxy container + letsencrypt companion container with its own subdomain on the public internet. It works great but anyone can use it while the container is running.

Great work though, this is very functional.

OpenSubtitles user name & passwd not stored

When requesting subtitles, it comes back with a challenge to configure user/password on Opensubtitles.

Get [English] subtitles for 1 files
CmdlineException: OpenSubtitles: Please enter your login details by calling `filebot -script fn:configure`

Calling this script works, however filebot still fails on the same error as before. It looks like those credentials are not stored or ignored

Filebot running on file's before copy is completed.

Hi, I am copying files from another computer and filbert is starting to process the files before the other computer has fully copied the whole file to the filbert's input folder, thus leading to the file being corrupt.

I have the following settings...
SETTLE_DURATION=02:00
MAX_WAIT_TIME=59:00
MIN_PERIOD=05:00

[ERROR] Refusing to modify the group ID. Exiting...

Hi,

I am getting this error and don't know how to fix

[2018-01-23 21:50:18] ERROR: Found user "" with the proper user ID but incorrect group ID. Refusing to modify the group ID. Exiting...

I've looked and it appears that my USER_ID=0, GROUP_ID=0, and UMASK=0022

What am i doing wrong?

Please forgive me as I am pretty new to using Docker. Thanks!

Can we get support for the latest version?

I've been using this program for free for a while now and now that the paid version has some good changes (quite a bit ahead now) I want to be able to use them.

Do you mind adding support for the latest version and licensing?

I tried the other Filebot container but they do not have automatic processing which is a must for me.

Thanks for your awesome containers :)
~Skylar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.