GithubHelp home page GithubHelp logo

trawis / cleanarr Goto Github PK

View Code? Open in Web Editor NEW

This project forked from se1exin/cleanarr

0.0 0.0 0.0 1.86 MB

A simple UI to help find and delete duplicate and sample files from your Plex server

Home Page: https://hub.docker.com/r/selexin/cleanarr

License: MIT License

Python 40.32% TypeScript 55.31% CSS 0.65% HTML 2.29% Dockerfile 0.75% Makefile 0.69%

cleanarr's Introduction

Cleanarr

A simple UI to help find and delete duplicate and sample files from your Plex server.

Note: At this time only Plex Content Libraries (TV/Movies) are supported.

Plex Setup

You need to check Settings | Library | Allow media deletion within your plex server’s settings

You will need a Plex Token: How to find your Plex Token

Run with Docker

This project is available as a docker container on Docker Hub.

Docker Parameters

You will need to set the correct parameters for your setup:

Parameter Function
-v /some/path/on/your/computer:/config (required) Volume mount for config directory
-e PLEX_BASE_URL="plex_address" (required) Plex Server Address (e.g. http://192.169.1.100:32400)
-e PLEX_TOKEN="somerandomstring" (required) A valid Plex token for your Plex Server (How to find your Plex Token)
-e LIBRARY_NAMES="Movies" (optional) Name(s) of your Plex Libraries to search. Separate multiple library names with ";" character. E.g. "Movies 1;Movies 2". Default value is "Movies"
-e BYPASS_SSL_VERIFY=1 (optional) Disable SSL certificate verification. Use this if your Plex Server has "Secure Connections: Required" and you are having issues connecting to it. (Thanks @booksarestillbetter - #2)
-p 5000:80 (required) Expose the UI via the selected port (in this case 5000). Change 5000 to the port of your choosing, but don't change the number 80.
-e PAGE_SIZE=50 (optional) To avoid plex timeouts, results are loaded in pages (or chunks). If you recieve Plex Timeout errors, try setting this parameter to a lower value.
-e DEBUG=0 (optional) To enable debug logging set DEBUG to 1
-e PLEX_TIMEOUT=7200 (optional) modify the timeout for wrapper (Error : Failed to load content!)

Example running directly with docker (with make)

build
make build # this will create an .env file if it doesn't already exist
# edit .env file
run
# set CONFIG_MOUNT to a location on your machine where you wish to store the state from Cleanarr
CONFIG_MOUNT=/tmp/config make run

Example running directly with docker (manually)

# you can build and run manually
docker build -t=selexin/cleanarr:latest .
docker run \
	-e PLEX_BASE_URL="http://192.169.1.100:32400" \
	-e PLEX_TOKEN="somerandomstring" \
	-e LIBRARY_NAMES="Movies" \
	-p 5000:80 \
  -v /some/path/on/your/computer:/config \
	selexin/cleanarr:latest
	

Example using Docker Compose

(Thanks @JesseWebDotCom - #8)

Note that environment variables should not be quoted when using docker-compose.yml format

version: '3'

services:

  cleanarr:
    image: selexin/cleanarr:latest
    container_name: cleanarr
    hostname: cleanarr
    ports:
      - "5000:80"
    environment:
      - BYPASS_SSL_VERIFY=1
      - PLEX_TOKEN=somerandomstring
      - PLEX_BASE_URL=http://192.169.1.100:32400
      - LIBRARY_NAMES=Adult Movies;Kid Videos
    volumes:
      - /some/path/on/your/computer:/config
    restart: unless-stopped

You can then access the UI in your browser at http://localhost:5000/.

Run from Source / Setup Development Environment

To run from source you need to run two parts - the Python Backend and React Frontend.

First clone down this repo:

git clone https://github.com/se1exin/cleanarr

Backend

Requirements: python3

The backend is just a thin wrapper around the Python Plex API using Flask to serve requests. I recommend using a virtualenv to run.

You should change to the backend folder to get things running:

cd backend

Setup the python environment and dependencies:

python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Run the Backend:

PLEX_BASE_URL="plex_address" PLEX_TOKEN="somerandomstring" LIBRARY_NAMES="Movies" PLEX_TIMEOUT="7200" FLASK_APP=main python -m flask run

The backend will start and run from port 5000 on localhost (e.g. http:localhost:5000).

If you are running on a remote server :

PLEX_BASE_URL="http://plex_address:32400" PLEX_TOKEN="somerandomstring" LIBRARY_NAMES="Movies" FLASK_APP=main python -m flask run --host=IP.remote.server

See Flask's Docs for more run options (such as chaning the port).

Frontend

Requirements: node, yarn.

You should change to the frontend folder to get things running:

cd frontend

Setup the node environment and dependencies:

yarn install

Run the Frontend development server:

Note: change REACT_APP_BACKEND_URL to match where your backend is running at - make sure to include the trailing slash!

REACT_APP_BACKEND_URL="http://localhost:5000/" yarn start

The frontend will now be available in your browser at http:localhost:3000.

Screenshots

Demo of deleting duplicate movies

Credits

Thanks to the following projects:

License

MIT - see LICENSE.md

cleanarr's People

Contributors

alanoll avatar bassrock avatar dependabot[bot] avatar jzucker2 avatar peter-mcconnell avatar polzy avatar se1exin avatar suika avatar

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.