├── Dockerfile ├── README.md ├── config.yml ├── minidlna.conf ├── startup.sh └── templates └── html.template /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM centos:7 2 | RUN yum update -y && \ 3 | yum install -y wget epel-release && \ 4 | wget http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm && \ 5 | yum update -y && \ 6 | rpm -ivh nux-dextop-release-0-5.el7.nux.noarch.rpm && \ 7 | yum -y install minidlna deluge-web && \ 8 | yum -y install python-pip && \ 9 | pip install --upgrade pip --no-cache-dir && \ 10 | pip install setuptools --upgrade --no-cache-dir && \ 11 | yum clean all && \ 12 | mkdir -p /home/Videos && \ 13 | pip install flexget && \ 14 | rm -rfv nux-dextop-release-0-5.el7.nux.noarch.rpm && \ 15 | mkdir -p /home/Videos/Movies && \ 16 | mkdir -p /home/Videos/TV_Shows 17 | 18 | COPY ["config.yml", "templates/", "/root/.flexget/"] 19 | COPY ["startup.sh", "/root/"] 20 | COPY ["minidlna.conf", "/etc/"] 21 | 22 | VOLUME ["/home/"] 23 | EXPOSE 8112 8200 1900/udp 24 | 25 | ENTRYPOINT ["/root/startup.sh"] 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DLNA-TorrentBox 2 | Docker container for DLNA (minidlna) and TorrentBox (Deluge-WebUI) with RSS (flexget). 3 | 4 | ## Main Features 5 | 6 | ### Deluge Web UI 7 | Deluge Web User Interface with awesome features: 8 | * Password protection (default password is ``deluge`` and you'll be asked if you want to change it) 9 | * Auto load torrents from any location 10 | * Stop seeding torrents after [number] ratio is reached 11 | * And many more! 12 | 13 | ### Flexget 14 | Flexget has advanced configuration and is capable of reading torrent site RSS and auto adding TV Shows to the queue as soon as new episode is being released. It can also scan RSS for released movies and compare them to IMDB for ratings, vote numbers, release year, genres to make a decision if it's worth being added to the download queue. 15 | 16 | ### Minidlna 17 | Minidlna is a very lightweight and very fast DLNA server that servers content instantly when they arrive without any media scan. 18 | 19 | # Docker run 20 | 21 | Below are a few examples of how to get running this container. 22 | 23 | To run this container with random exposed ports, use ``-P`` flag. Please note, that Web UI will be port assigned to container's 8112 port. 24 | 25 | docker run --net=host --name torrent-box -P -d edgaras/dlna-torrentbox:latest 26 | 27 | You can mount data volume (container's /home/) to your filesystem location (i.e. /home/dlna/) try the following command: 28 | 29 | docker run --net=host --name torrent-box -P -v /home/dlna:/home -d edgaras/dlna-torrentbox:latest 30 | 31 | Assign 80 port to Deluge Web UI with the following: 32 | 33 | docker run --net=host --name torrent-box -p 80:8112 -P -d edgaras/dlna-torrentbox:latest 34 | 35 | # Configuration 36 | To configure Flexget RSS, run the following command: 37 | 38 | docker exec -ti torrent-box vi /root/.flexget/config.yml 39 | 40 | * ``rss:`` - change this to your RSS feed URL. 41 | * ``series`` - change to your preferred TV Shows. 42 | * ``imdb`` - change to your preferences what kind of movies will be automatically downloaded compared to these IMDB settings. 43 | 44 | ## RSS 45 | 46 | As ``crontab`` is not working inside container, you have to setup on the host Operating System your cron schedule. This simply can be done by entering ``crontab -e`` command and adding the following line: 47 | 48 | @hourly docker exec torrent-box flexget execute 49 | 50 | 51 | -------------------------------------------------------------------------------- /config.yml: -------------------------------------------------------------------------------- 1 | templates: 2 | global: 3 | notify: 4 | task: 5 | title: '[TorrentBox] New Download' 6 | template: html 7 | via: 8 | - email: 9 | from: torrentbox@gmail.com 10 | to: reiceiver@email.com 11 | smtp_host: smtp.gmail.com 12 | smtp_port: 587 13 | smtp_username: torrentbox 14 | smtp_password: password 15 | smtp_tls: yes 16 | html: yes 17 | regexp: 18 | reject: 19 | - WEB 20 | - WEB-DL 21 | 22 | deluge_server: 23 | deluge: 24 | host: "localhost" 25 | port: 58846 26 | username: username_goes_here 27 | password: password_goes_here 28 | 29 | movies: 30 | exists_movie: /home/Videos/Movies 31 | seen_movies: strict 32 | quality: 1080p 33 | regexp: 34 | reject: 35 | - WEB 36 | - WEB-DL 37 | - KORSUB 38 | 39 | notification: 40 | email: 41 | active: True 42 | from: torrentbox@gmail.com 43 | to: reiceiver@email.com 44 | smtp_host: smtp.gmail.com 45 | smtp_port: 587 46 | smtp_username: torrentbox 47 | smtp_password: password 48 | smtp_tls: yes 49 | subject: '[TorrentBox] New Download' 50 | template: html.template 51 | 52 | schedules: 53 | # Run every task once an hour 54 | - tasks: '*' 55 | interval: 56 | hours: 1 57 | 58 | tasks: 59 | 60 | Watchlist task: 61 | trakt_list: 62 | username: edgaras 63 | list: watchlist 64 | type: movies 65 | quality: 1080p 720p 66 | accept_all: yes 67 | template: 68 | - deluge_server 69 | - movies 70 | 71 | Series task: 72 | rss: http://www.linkomanija.net/rss.php?feed=dl&cat[]=60&cat[]=62&cat[]=46&passkey= 73 | series: 74 | - Mr Robot 75 | - The Big Bang Theory 76 | - Grand Tour 77 | - Game of Thrones 78 | - House of cards 79 | - Suits 80 | - Shameless 81 | - UEFA Champions League Highlights 82 | - Vikings 83 | - Westworld 84 | - Narcos: 85 | quality: 720p 1080p 86 | template: 87 | - deluge_server 88 | download: /home/Videos/TV_Shows 89 | 90 | Movies task: 91 | rss: https://www.linkomanija.net/rss.php?feed=dl&cat[]=52&passkey= 92 | template: 93 | - movies 94 | - deluge_server 95 | imdb: 96 | min_score: 7.5 97 | min_votes: 4000 98 | min_year: 2009 99 | reject_genres: 100 | - musical 101 | download: /home/Videos/Movies 102 | -------------------------------------------------------------------------------- /minidlna.conf: -------------------------------------------------------------------------------- 1 | # port for HTTP (descriptions, SOAP, media transfer) traffic 2 | port=8200 3 | 4 | # network interfaces to serve, comma delimited 5 | #network_interface=eth0 6 | 7 | # specify the user account name or uid to run as 8 | #user=jmaggard 9 | 10 | # set this to the directory you want scanned. 11 | # * if you want multiple directories, you can have multiple media_dir= lines 12 | # * if you want to restrict a media_dir to specific content types, you 13 | # can prepend the types, followed by a comma, to the directory: 14 | # + "A" for audio (eg. media_dir=A,/home/jmaggard/Music) 15 | # + "V" for video (eg. media_dir=V,/home/jmaggard/Videos) 16 | # + "P" for images (eg. media_dir=P,/home/jmaggard/Pictures) 17 | # + "PV" for pictures and video (eg. media_dir=PV,/home/jmaggard/digital_camera) 18 | media_dir=V,/home/Videos 19 | 20 | # set this to merge all media_dir base contents into the root container 21 | # note: the default is no 22 | #merge_media_dirs=no 23 | 24 | # set this if you want to customize the name that shows up on your clients 25 | friendly_name=DLNA Server 26 | 27 | # set this if you would like to specify the directory where you want MiniDLNA to store its database and album art cache 28 | #db_dir=/var/cache/minidlna 29 | 30 | # set this if you would like to specify the directory where you want MiniDLNA to store its log file 31 | #log_dir=/var/log/minidlna 32 | 33 | # set this to change the verbosity of the information that is logged 34 | # each section can use a different level: off, fatal, error, warn, info, or debug 35 | #log_level=general,artwork,database,inotify,scanner,metadata,http,ssdp,tivo=warn 36 | 37 | # this should be a list of file names to check for when searching for album art 38 | # note: names should be delimited with a forward slash ("/") 39 | album_art_names=Cover.jpg/cover.jpg/AlbumArtSmall.jpg/albumartsmall.jpg/AlbumArt.jpg/albumart.jpg/Album.jpg/album.jpg/Folder.jpg/folder.jpg/Thumb.jpg/thumb.jpg 40 | 41 | # set this to no to disable inotify monitoring to automatically discover new files 42 | # note: the default is yes 43 | inotify=yes 44 | 45 | # set this to yes to enable support for streaming .jpg and .mp3 files to a TiVo supporting HMO 46 | enable_tivo=no 47 | 48 | # set this to strictly adhere to DLNA standards. 49 | # * This will allow server-side downscaling of very large JPEG images, 50 | # which may hurt JPEG serving performance on (at least) Sony DLNA products. 51 | strict_dlna=no 52 | 53 | # default presentation url is http address on port 80 54 | #presentation_url=http://www.mylan/index.php 55 | 56 | # notify interval in seconds. default is 895 seconds. 57 | notify_interval=900 58 | 59 | # serial and model number the daemon will report to clients 60 | # in its XML description 61 | serial=12345678 62 | model_number=1 63 | 64 | # specify the path to the MiniSSDPd socket 65 | #minissdpdsocket=/var/run/minissdpd.sock 66 | 67 | # use different container as root of the tree 68 | # possible values: 69 | # + "." - use standard container (this is the default) 70 | # + "B" - "Browse Directory" 71 | # + "M" - "Music" 72 | # + "V" - "Video" 73 | # + "P" - "Pictures" 74 | # + Or, you can specify the ObjectID of your desired root container (eg. 1$F for Music/Playlists) 75 | # if you specify "B" and client device is audio-only then "Music/Folders" will be used as root 76 | #root_container=. 77 | 78 | # always force SortCriteria to this value, regardless of the SortCriteria passed by the client 79 | #force_sort_criteria=+upnp:class,+upnp:originalTrackNumber,+dc:title 80 | 81 | # maximum number of simultaneous connections 82 | # note: many clients open several simultaneous connections while streaming 83 | #max_connections=50 84 | -------------------------------------------------------------------------------- /startup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | mkdir -p /home/Videos/TV_Shows 3 | mkdir -p /home/Videos/Movies 4 | 5 | /usr/bin/deluged 6 | sleep 2 7 | PASSWORD=$(cat /root/.config/deluge/auth | awk -F: '{print $2}') 8 | USERNAME=$(cat /root/.config/deluge/auth | awk -F: '{print $1}') 9 | 10 | /usr/sbin/minidlnad && sleep 3 11 | 12 | sed "s@username_goes_here@$USERNAME@g" -i /root/.flexget/config.yml 13 | sed "s@password_goes_here@$PASSWORD@g" -i /root/.flexget/config.yml 14 | 15 | # Unexpected shutdowns causes .config-lock file to hang there and flexget daemon is unable to start 16 | rm -rfv /root/.flexget/.config-lock 17 | 18 | flexget daemon start & 19 | 20 | /usr/bin/deluge-web 21 | 22 | -------------------------------------------------------------------------------- /templates/html.template: -------------------------------------------------------------------------------- 1 | {% if task.accepted -%} 2 | 3 | {# Global variables #} 4 | {% set unique_list = [] %} 5 | {% set tv_shows = [] %} 6 | {% set movies = [] %} 7 | {% set dates = [] %} 8 | {% set ratings = {0: '', 1: '★', 2: '★★', 3: '★★★', 4: '★★★★', 5: '★★★★★'} %} 9 | 10 | {% for entry in task.accepted %} 11 | {% if entry.series_name|d(false) %} 12 | {% set unique_id = '%s %s'|format( entry.series_name|re_replace("'|\.|\"", '')|lower, entry.series_id ) %} 13 | {% if unique_id not in unique_list %} 14 | {% if unique_list.append(unique_id) or tv_shows.append(entry) or dates.append(entry.rss_pubdate|d(now())) %}{% endif %} 15 | {% endif %} 16 | {% else %} 17 | {% set unique_id = entry.imdb_name|d('Undefined') %} 18 | {% if unique_id not in unique_list %} 19 | {% if unique_list.append(unique_id) or movies.append(entry) or dates.append(entry.rss_pubdate|d(now())) %}{% endif %} 20 | {% endif %} 21 | {% endif %} 22 | {% endfor %} 23 | 24 | {% set tv_shows = tv_shows|sort(attribute='series_name') %} 25 | {% set movies = movies|sort(attribute='imdb_name') %} 26 | 27 | {% set show_colors = { 'archer': '#47dc25', 'boardwalk empire': '#dca328', 'breaking bad': '#06954c', 'game of thrones': '#faa912', 'homeland': '#f8b411', "it's always sunny in philadelphia": '#fcdc00', 'louie': '#f7020b', 'mad men': '#ed2c23', 'sherlock': '#63758b', 'suits': '#f05253', 'the league': '#f2ce09', 'the walking dead': '#b0a07e' } %} 28 | 29 | 30 | 31 |
32 | 33 |{% if ep.tvdb_ep_overview|d(false) %} 224 | {{ep.tvdb_ep_overview}} 225 | {% endif %} 226 |
227 |278 | {% if movie.imdb_plot_outline|d(false) %} 279 | {{movie.imdb_plot_outline}} 280 | {% endif %} 281 |
282 |