Coder Social home page Coder Social logo

plexondeckcache's Introduction

TLDR: Move the media currently On Deck on Plex from the array to the cache (unraid).

This is a script in Python made to help me saving some energy by reducing the need to spin up the array/disk(s) when watching recurrent media, such as a TV series. The script moves not only the media (Movies and Shows) that is "On Deck" but also the next 51 episodes of each TV Series (and/or Anime) to the cache (SSD) drive, which is faster and more power-efficient than the regular disk. Additionally, it will also move the subtitles to prevent the need to spin up the entire drive for a small amount of data. This script is designed to work with Unraid, but can be adapted for use with other systems.

While I am still new to Python and the code may not be the most efficient, it has been working seamlessly for several days (and counting).

To use the script there are different ways but DO NOT forget to change the plex url and token2 variables accordingly.

A) Run it on Chronos3 (docker container, easily installable from the unraid app store):

  • Allocate another path to the default ones, point it at "/mnt" in both the host and the container.
  • Once you are in the Chronos web interface:
    1. Add a new script
    2. Configure how to trigger (personally using cron) the script;
    3. List the two requirements (plexapi and psutil) in the Pip requirements box;
    4. Save;
    5. Press "Install pip requirements";
    6. Past the content of the plexondeckcache.py in the Python script box.
    7. Save.
    8. Execute (or wait for the script to be triggered);
    9. Enjoy.

B) Install python directly on Unraid (probably using NerdTools4 plugin) but you will need to manually install the two dependency the script requires (plexapi and psutil); and run it by cron (or User Scripts plugin5). I don't advise this method but it works.

Thank you to brimur/preCachePlexOnDeckEpiosodes.py Your script is what helped and inspired me.

Footnotes

  1. If you want to fetch more episodes, change this variable at the beginning of the script "number_episodes".

  2. Official guide on how to fetch the token.

  3. Chronos on Github

  4. Nerd Tools Plugin official topic on the unraid forum

  5. User Scripts Plugin official topic on the unraid forum

plexondeckcache's People

Contributors

bexem avatar extrobe avatar dsaunier-sunlight 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.