Coder Social home page Coder Social logo

plex_debrid's Introduction

Other peoples way better projects worth checking out:

Debrid Media Manager:

https://github.com/debridmediamanager

(also includes zurg, a way better alternative to rclone_rd)

plex_debrid

Plex/Emby/Jellyfin/Infuse torrent streaming through Debrid Services, using Plex Discover Watchlists, Trakt lists and Overseerr.

Using content services like plex discover, trakt and overseerr, your personal media server users can add movies/shows to their watchlist and they become available to stream in seconds.

In Action:

ezgif com-gif-maker

Description:

A plex_debrid setup consists of three parts.

  • The first part is rclone (or rclone_rd), a program that tricks your OS into thinking you have your debrid service files locally. In reality they are streamed when you open them, which is why content is available almost instantly and why you have unlimited storage (depending on your debrid service). Nothing is ever actually downloaded to your servers harddrive.
  • The second part is a personal media server like Plex, which allows you to watch these files from anywhere on any device.
  • The third part is the plex_debrid script, which ties both things together and provides an easy way to add media content to your debrid service/s.

The plex_debrid script monitors the plex watchlists, trakt watchlists and overseer-requests of specified users for newly added movies/shows and newly released episodes of watchlisted shows. Once new content is found, torrent indexers are scraped for the best, cached release on selected debrid services. The torrent is then added to a suitable debrid service and a library refresh is performed to make the newly added content available.

For any debrid-cached content (movies, one-season tv shows or even multi-season tv shows) the entire process from watchlisting content to watching it takes about 10-20 seconds.

This is a work in progress, and im not a professional programmer. shits not ready! Feel free to check it out though, I will continously improve the speed, reliability and user-friendlyness.  

Features:

Community

  • Feel free to ask any questions on github discussions
  • or create a new issue if you find a bug or have an idea for an improvement.

If github is not your cup of tea;

Setup:

📌 Step by Step and VPS Guides:

Aside from this general setup guide, here some step-by-step guides with specific examples for a few different operating systems. If you want to run plex_debrid on a VPS or Seedbox, please keep in mind that some debrid services block such IP addresses from accessing their servers.

Step by Step for your OS:
Help for a VPS/Seedbox Setup
  • I do not encourage you to disregard your debrid services code of conduct.
  • Debrid services like realdebrid block common VPS or Seedbox IP addresses. They do however have a list of whitelisted VPNs, behind which you can run your server. >For realdebrid you can find this list on https://real-debrid.com/vpn . You can also use this address to check wether or not your servers IP is blocked by running the >commands curl -4 https://real-debrid.com/vpn | grep blocked and curl -6 https://real-debrid.com/vpn | grep blocked. If you have the option, you can try to request >a different IP address from your VPS provider, preferably your own personal IPv4 address which will most likely not be blocked.

1) 📂 Mount your debrid services:

For this download automation to work, you need to mount at least one debrid service as a virtual drive. I highly recommend using RealDebrid, as this service will recieve updates and new features from plex_debrid first. Please keep in mind that most debrid services dont allow you to access their service from multiple IP addresses in parallel. This is not an issue if you have a Plex server running, since everything you stream through plex (from any location, no matter how many in parallel) is routed through your servers IP address. While you have your plex server running though, you should not download from your debrid service in any other way than through plex.

Mounting RealDebrid

Realdebrid has now implement support for WebDav, which makes it mountable with official rclone software.

I do still recomend using my forked version of rclone thats written explicitly for realdebrid, since realdebrids WebDav does not allow for torrent file deletion through rclone and they limit the amount of torrents displayed to 200. They do claim the torrent file deletion works with other webdav mount programs, but i have not been able to test this yet. It also seems that the official realdebrid webdav is still slower and more bandwidth heavy than my rclone fork, because mounting the webdav leads to frequent re-discovering of already downloaded content.

Mounting with my rclone fork:

  1. Install my rclone fork: https://github.com/itsToggle/rclone_rd
  2. configure rclone by running the command 'rclone config' (could be './rclone config' and depending on your os, the filename could be './rclone-linux' or similar. If you get a permission denied error (linux & macos), run 'sudo chmod u+x rclone-linux', adjusted to the filename.)
  3. create a new remote by typing 'n'
  4. give your remote a name (e.g. 'your-remote')
  5. choose '47) realdebrid' as your remote type
  6. follow the rest of the prompted instructions, choose 'no advaced configuration'
  7. You can mount your newly created remote by running the command 'rclone cmount your-remote: X: --dir-cache-time 10s' (replace 'your-remote' with your remote name, replace 'X' with a drive letter of your choice or replace 'X:' with a destination folder)
  8. If you are running my rclone fork on Linux, replace "cmount" with "mount" in the command above.
  9. You've successfuly created a virtual drive of your debrid service!

You can run rclone as a background service by adding the mounting tag '--no-console' (Windows) or '--deamon' (Linux, Mac, etc).

Mounting with official rclone software (WebDav)

  1. Install the official rclone software: https://github.com/rclone/rclone or my fork: https://github.com/itsToggle/rclone_rd
  2. configure rclone by running the command 'rclone config' (could be './rclone config' depending on your os)
  3. create a new remote by typing 'n'
  4. give your remote a name (e.g. 'your-remote')
  5. choose '45) WebDav' as your remote type
  6. enter 'https://dav.real-debrid.com/' as the server url
  7. choose option '5) (other)'
  8. enter your realdebrid user name as your user name
  9. choose option 'y) yes, enter in my own password'
  10. enter your webdav password (available in your account settings) as the password
  11. You can mount your newly created remote by running the command 'rclone mount your-remote:torrents X: --dir-cache-time 10s' (replace 'your-remote' with your remote name, replace X with a drive letter of your choice or replace 'X:' with a destination folder)
  12. You've successfuly created a virtual drive of your debrid service!

You can run rclone as a background service by adding the mounting tag '--no-console' (Windows) or '--deamon' (Linux, Mac, etc)

Mounting Premiumize
  1. Install the official rclone software: https://github.com/rclone/rclone or my fork: https://github.com/itsToggle/rclone_rd
  2. configure rclone by running the command 'rclone config' (could be './rclone config' depending on your os)
  3. create a new remote by typing 'n'
  4. give your remote a name (e.g. 'your-remote')
  5. choose '46) premiumize' as your remote type
  6. follow the rest of the prompted instructions, choose 'no advaced configuration'
  7. You can mount your newly created remote by running the command 'rclone mount your-remote: X: --dir-cache-time 10s' (replace 'your-remote' with your remote name, replace X with a drive letter of your choice or replace 'X:' with a destination folder)
  8. You've successfuly created a virtual drive of your debrid service!

You can run rclone as a background service by adding the mounting tag '--no-console' (Windows) or '--deamon' (Linux, Mac, etc)

Mounting AllDebrid
  1. Install the official rclone software: https://github.com/rclone/rclone or my fork: https://github.com/itsToggle/rclone_rd
  2. configure rclone by running the command 'rclone config' (could be './rclone config' depending on your os)
  3. create a new remote by typing 'n'
  4. give your remote a name (e.g. 'your-remote')
  5. choose '42) WebDav' as your remote type
  6. enter 'https://alldebrid.com/webdav/' as the server url
  7. choose option '5) (other)'
  8. enter an api key as your user name
  9. choose option 'y) yes, enter in my own password'
  10. enter 'eeeee' as the password
  11. You can mount your newly created remote by running the command 'rclone mount your-remote:links X: --dir-cache-time 10s' (replace 'your-remote' with your remote name, replace X with a drive letter of your choice or replace 'X:' with a destination folder)
  12. You've successfuly created a virtual drive of your debrid service!
  13. You will only be able to watch content from the "links" and "history" folder, not the "magnet" folder. The "links" folder is recommended and the one used in the mounting command above.

You can run rclone as a background service by adding the mounting tag '--no-console' (Windows) or '--deamon' (Linux, Mac, etc)

Mounting DebridLink
  1. Install the official rclone software: https://github.com/rclone/rclone or my fork: https://github.com/itsToggle/rclone_rd
  2. configure rclone by running the command 'rclone config' (could be './rclone config' depending on your os)
  3. create a new remote by typing 'n'
  4. give your remote a name (e.g. 'your-remote')
  5. choose '42) WebDav' as your remote type
  6. enter 'https://webdav.debrid.link' as the server url
  7. choose option '5) (other)'
  8. enter your debrid-link user name as your user name
  9. choose option 'y) yes, enter in my own password'
  10. enter your "passkey" (Available in your account) as the password
  11. You can mount your newly created remote by running the command 'rclone mount your-remote X: --dir-cache-time 10s' (replace 'your-remote' with your remote name, replace X with a drive letter of your choice or replace 'X:' with a destination folder)
  12. You've successfuly created a virtual drive of your debrid service!

You can run rclone as a background service by adding the mounting tag '--no-console' (Windows) or '--deamon' (Linux, Mac, etc)

Mounting PUT.io

Here is a nicely written article from the put.io team on how to mount put.io using rclone:

http://help.put.io/en/articles/3480094-plex-rclone

You can mount your newly created remote by running the command 'rclone mount your-remote X: --dir-cache-time 10s' (replace 'your-remote' with your remote name, replace X with a drive letter of your choice or replace 'X:' with a destination folder)

You can run rclone as a background service by adding the mounting tag '--no-console' (Windows) or '--deamon' (Linux, Mac, etc)

2) 📺 Setup your personal media server:

To stream content from your newly mounted virtual drive, its recommended to set up a personal media server like plex, emby or jellyfin. These services allow you to stream your content from outside your local network. You will have the best expirience when using plex, since you dont need any 3rd party website to download new content - you can simply add new movies/shows to your watchlist from inside any plex client app, wait a few seconds and then watch it (see the gif above). If you prefer emby or jellyfin as your personal media server, the only way to add new content is via trakt and jellyseerr. A different approach is to use media players like Infuse to access the mounted files, which too relies on trakt to add new content.

Setting up Plex:
  1. Create a plex 'movie' library of the mounted virtual drive or add the virtual drive to an existing 'movie' library.
  2. Create a plex 'shows' library of the mounted virtual drive or add the virtual drive to an existing 'shows' library.
  3. If you are running rclone on a Linux based OS and Plex cant find your mounted virtual drive, try adding the mounting tag '--allow-other'
  4. Recommendation: disable 'video preview thumbnails', disable the scheduled task 'perfom extensive media analysis' to reduce the download traffic. If you are planning on having a very large library, increase your libraries cache size from the default 40MB to 1GB.
  5. Disable the libary setting "Empty trash after every scan", to make sure that no content is removed accidentaly
  6. You and your home users can now stream cached torrents from your debrid service/s!

Please keep your libraries metadata agent as the default Plex metadata agent

3) 📄 Setup plex_debrid:

The plex_debrid script can be run as a docker container (dockerized version) or by simply executing it with python 3 (standard version).

Standard Version:
  1. Clone this repository with git or click on "code" (top right) and then "download zip"
  2. Open a terminal inside the downloaded plex_debrid-main folder. Run pip install -r requirements.txt - if you dont have pip yet, install it from https://pypi.org/project/pip/
  3. Start the script by running python ./main.py
  4. The script will guide you through the initial setup and the next steps. When setting up plex_debrid, you will be prompted to choose the 5 main services that this script connects:
  5. Pick and setup at least one content service which plex_debrid should monitor for new content
  6. Pick and setup a library collection service, which plex_debrid will use to determine your current media collection. If you intend to run a plex server, choose "Plex Libraries".
  7. Pick and setup a library update service, which plex_debrid will update/refresh after a successful download. If you intent to run a plex server, choose "Plex Libraries".
  8. Pick and setup a library ignore service, which plex_debrid will use to ignore content. If you intent to run a plex server, choose "Plex Discover Watch Status".
  9. Pick and setup at least one debrid service, which plex_debrid will use to download content.
  10. You're done!
  11. Choose option '1' to run the download automation. Choose option '2' to explore or edit the Settings or open the "settings.json" file the script creates after the first run.
  12. If you dont want the main menu to show when starting the script (for an auto-run setup), navigate to "/Settings/UI Settings/show menu on startup" and set the value to "false".
  13. Read the rest of the README!
Dockerized Version:
  1. Run docker pull itstoggle/plex_debridor visit https://hub.docker.com/repository/docker/itstoggle/plex_debrid.
  2. Run docker run -v /path/to/config:/config --net host -ti itstoggle/plex_debrid . Where /path/to/config is the directory path where you want to save your plex_debrid config data.
  3. The script will guide you through the initial setup and the next steps. When setting up plex_debrid, you will be prompted to choose the 5 main services that this script connects:
  4. Pick and setup at least one content service which plex_debrid should monitor for new content
  5. Pick and setup a library collection service, which plex_debrid will use to determine your current media collection. If you intend to run a plex server, choose "Plex Libraries".
  6. Pick and setup a library update service, which plex_debrid will update/refresh after a successful download. If you intent to run a plex server, choose "Plex Libraries".
  7. Pick and setup a library ignore service, which plex_debrid will use to ignore content. If you intent to run a plex server, choose "Plex Discover Watch Status".
  8. Pick and setup at least one debrid service, which plex_debrid will use to download content.
  9. You're done!
  10. Choose option '1' to run the download automation. Choose option '2' to explore or edit the Settings or open the "settings.json" file the script creates after the first run.
  11. If you dont want the main menu to show when starting the script (for an auto-run setup), navigate to "/Settings/UI Settings/show menu on startup" and set the value to "false".
  12. Read the rest of the README!

Usage:

plex_debrid can be setup in a bunch of different ways, which this readme wont be able to cover. Feel free to ask any questions in the "discussions" section of this respository or join our discord server.

☁️ Rclone Usage

Some advanced options for using rclone

4K & HD libraries:
  • Using rclone filtering, you can split your library into 4k and non-4k content.
  • start one instance of rclone by adding the flag --exclude **2160** to your mount command, mount to a folder named "HD"
  • start another instance of rclone by adding the flag --include **2160** to your mount command, mount to a folder named "4K"
Movie/Show sorting for WebDAV remotes:
  • Using rclone filtering, you can split your WebDAV remote into movie and show content.
  • start one instance of rclone by adding the flag --exclude "**{{(s|S)([0-9]+)( |.|e|E)}}**" to your mount command, mount to a folder named "movies"
  • start another instance of rclone by adding the flag --include "**{{(s|S)([0-9]+)( |.|e|E)}}**" to your mount command, mount to a folder named "shows"

📺 Content Services:

The services that plex_debrid can monitor for new content. You can pick any combination of services.

Plex watchlists:
  • The Plex Watchlist and the Discover feature are only available for accounts that are linked to an email address - so no managed accounts.
  • To allow content download from inside any plex client by yourself and other users, create a new user by navigation to '/Settings/Content Services/Plex/Plex users/Edit/Add user'.
  • You and the users you've added can now browse the Discover part of Plex and download content by adding it to the Plex Watchlist.
  • If you want to delete something from your Plex server, make sure that you've removed it from your Watchlist first. Otherwise the script will see that its in your watchlist and not on your server and will simply download it again.
  • By default, movies that you add to your Plex Watchlist are removed automatically once they are downloaded and shows stay in the Watchlist, because only shows that are in the Watchlist are monitored for newly released episodes. You can change which media type/s should be automatically removed from your watchlist by navigating to '/Settings/Content Services/Plex/Plex auto remove'
  • The script tries its best to avoid downloading unwanted (e.g. sample) files. If samples still show up on plex, you can create a .plexignore file and add it to the mounts parent directory (more info here).
  • The Plex Watchlist of your specified users will polled for changes every 5 seconds, which is when it will try to find newly added content.
  • The Plex Watchlist will be updated entirely every 30 minutes, which is when it will try to find newly released episodes from watchlisted series. This is only done every 30 minutes, because building the whole watchlist can take more than a minute, depending on the amount of shows you have in there.
  • You can connect plex_debrid to trakt.tv to get more accurate release dates and times for your content, without needing to actually monitor any of your trakt content.
Trakt watchlists, collections and public lists:
  • To connect the script to trakt, navigate to '/Settings/Content Services/Trakt/Trakt users/Edit/Add user'. You can add an unlimited amount of users.
  • To monitor and download your users trakt watchlists, collections or public lists, navigate to '/Settings/Content Services/Trakt/Trakt lists'. By default, no trakt list is monitored for new content.
  • Only movies and entire shows in the watchlists, public lists and collections are downloaded. Not single seasons or episodes (for now).
  • The trakt watchlists of specified users is updated every 5s.
  • Shows in the trakt collections of specified users are checked for newly released episodes every 30min.
  • Public lists are updated every 30min.
Overseerr requests:
  • You can connect plex_debrid to overseerr to instantly and automatically download approved requests from selected users. For this to work, you need to connect plex_debrid to either Plex or Trakt, since these services can be used to gather more information on the requested media items.
  • To connect the script to overseerr, navigate to '/Settings/Content Services/Overseerr'.
  • By default, all approved requests from all overseerr users are downloaded by plex_debrid. To limit this feature to specific users, navigate to '/Settings/Content Services/Overseerr/Overseerr users'
Jellyseerr requests:
  • You can connect plex_debrid to jellyseerr to instantly and automatically download approved requests from selected users. For this to work, you need to connect plex_debrid to either Plex or Trakt, since these services can be used to gather more information on the requested media items. Since jellyseer and overseerr use the exact same api endpoints, simply set up jellyseer in the plex_debrid overseerr menu:
  • To connect the script to jellyseerr, navigate to '/Settings/Content Services/Overseerr'.
  • By default, all approved requests from all jellyseerr users are downloaded by plex_debrid. To limit this feature to specific users, navigate to '/Settings/Content Services/Overseerr/Overseerr users'

   

📂 Library Collection Service

The services that plex_debrid can use to determine your current media collection.

Plex library:
  • To use your plex library as your library service, navigate to '/Settings/Library Service/Library collection service/Change library service/'
  • If you choose your plex library as your library service, your entire Plex Library (including shares) is checked before downloading anything and the script will avoid duplicate downloads. To limit this library check to specific library sections, navigate to '/Settings/Library Service/Library collectikn service/Edit library service/Plex library check/Edit'
Trakt collection:
  • To use one of your trakt users collections as your library service, navigate to '/Settings/Library Service/Library collection service/Change library service/'
  • If you choose your trakt collection as your library service, your entire trakt collection is checked before downloading anything and the script will avoid duplicate downloads.
  • (You need at least one item in your trakt collection. If its currently empty, just add a random movie or show.)

🔁 Library Update Services

The services that plex_debrid can update/refresh after a successful download. You can add any combination of services.

Plex library:
  • To refresh your plex libraries after a succesful download, navigate to '/Settings/Library Service/Library update service/Edit/'
  • You can add an unlimited amount of libraries to be refreshed
  • plex_debrid is now capable of only partially scanning your libraries. This feature is currently only available for content that's downloaded through realdebrid.
Plex lables:
  • To add automatic version and user lables to your downloaded content, navigate to '/Settings/Library Service/Library update service/Edit/'
  • This requires a Plex library refresh to be set up aswell (see above).
  • Lables that will be added are: "From: ..." for each user that watchlisted this item, "Version: ..." for each version that was downloaded.
Trakt collection:
  • To mark content as collected on Trakt after it has been successfully downloaded, navigate to '/Settings/Library Service/Library update service/Edit/'
  • plex_debrid will automatically add the downloaded resolution and other properties of the downloaded media to your trakt collection
Jellyfin Libraries:
  • To refresh your jellyfin libraries after a succesful download, navigate to '/Settings/Library Service/Library update service/Edit/'
  • plex_debrid is currently only able to refresh your entire jellyfinlibrary. Partial library scans to come shortly!
Overseerr requests:
  • To mark your overserr requests as available after a succesful download, navigate to '/Settings/Library Service/Library update service/Edit/'
Jellyseerr requests:
  • To mark your jellyseerr requests as available after a succesful download, navigate to '/Settings/Library Service/Library update service/Edit/'

👀 Library Ignore Services

The services that plex_debrid will use to ignore content. You can add any combination of services. You can explore the media thats currently ignored from the main plex_debrid menu.

Plex Discover Watch Status:
  • To use a plex users plex discover watch status to ignore content, navigate to '/Settings/Library Service/Library ignore services/Edit/'
Trakt Watch Status:
  • To use a trakt users trakt watch status to ignore content, navigate to '/Settings/Library Service/Library ignore services/Edit/'
📋 Local Ignore List:
  • To use a local text file of queries to ignore content, navigate to '/Settings/Library Service/Library ignore services/Edit/'
  • You will be prompted to provide a path to a directory (not a file), in which plex_debrid will save a file named ignored.txt after content is ignored.
  • If you want to create that file yourself and dont want to wait for plex_debrid to create it, make sure to save it in your specified path and under the correct name ignored.txt
  • If you want to use the ignore file with the plex_debrid docker version, make sure to pick the path ./config/, so that the file is saved outside of your container.

🧲 Scraping Services:

The services that plex_debrid can use to find torrents. You can add any combination of services. By default, torrentio is the only service enabled. You can connect more scraping services to make sure you find high quality, cached releases.

torrentio (highly recommended):
  • The torrentio implementation uses the torrentio API to instantaniously get releases from torrentions gigantic release database. No actual scraping is done, which is why this service is so fast.
  • You can enable torrentio by navigating to '/Settings/Scraper/Sources/Add/'. There are no other steps needed.
  • You can edit the torrentio settings by navigating to '/Settings/Scraper/Sources/Edit/'. The settings menu will prompt you to visit 'https://torrentio.strem.fun/configure', where you can edit your settings. Your configuration "manifest url" will be copied to your clipboard after every change you make. You can paste that url into the plex_debrid setting to update your configuration. Dont enter your Debrid information, its not needed.
legacy scrapers (rarbg, 1337x, nyaa):
  • The only "legacy" scrapers currently integrated are for rarbg.to, nyaa.si and 1337x.to - you can turn these off or on by navigating to '/Settings/Scraper/Sources/Edit/'.
jackett:
  • Its recommended to install "jackett", a program that wraps a huge amount of torrent indexers (https://github.com/Jackett/Jackett). Once installed, go to http://localhost:9117 and add a few of your favorite indexers. Enable the jackett server setting "CORS". Once the jackett setup is complete, you can enable jackett inside plex_debrid by navigating to '/Settings/Scraper/Sources/Edit/Add source/jackett'.
  • You can now choose to use a specific debrid service for a specific torrent tracker by navigating to "/Settings/Debrid Services/Tracker specific Debrid Services". This comes in handy if you are using a private tracker that forces you to use a debrid service that will seed your torrents (e.g. debridlink,put.io).
prowlarr:
  • If you prefer Prowlarr over Jackett, you can integrate prowlarr into plex_debrid by navigating to '/Settings/Scraper/Sources/Edit/Add source/prowlarr'. Prowlarr has stricted rate limits than jackett for some indexers (e.g. 1337x), which could cause plex_debrid to timeout the request to prowlarr and therefore find less releases than jackett.
  • You can now choose to use a specific debrid service for a specific torrent tracker by navigating to "/Settings/Debrid Services/Tracker specific Debrid Services". This comes in handy if you are using a private tracker that forces you to use a debrid service that will seed your torrents (e.g. debridlink,put.io).
orionoid:
  • You can integrate the orionoid scrapers into plex_debrid by navigating to '/Settings/Scraper/Sources/Edit/Add source/orionoid'.
  • By default, only the top 5 links are fetched per scraping attempt and the links are sorted by "popularity", not the premium-only "best" attribute. This is done to be "free" account friendly, you can change these parameters in the orionoid source settings '/Settings/Scraper/Sources/Edit/Edit sources/orionoid'.
  • You can find a full list of all possible parameters and their respective values at "https://panel.orionoid.com/" in the "Developers" menu, section "API Docs" under "Stream API".

🔽 Debrid Services:

The services that plex_debrid can use to download torrents. You can add any combination of services.

Debrid services:
  • You can add more than one debrid service and change the order in which they should be checked for cached releases by navigating to '/Settings/Debrid Services/Edit'.

Defining versions to download:

Defining versions to download:
  • Check out the Wiki for a complete documentation of the version settings: https://github.com/itsToggle/plex_debrid/wiki/Version-Guides

  • You can define what release qualities plex_debrid should download by defining a "version". You can add an unlimited amount of versions by navigating to '/Settings/Scraper Settings/versions'. By default, plex_debrid only comes with 1 version definiton ([1080p SDR])

  • versions consist of an unlimited amount of completely customizable "rules" and "triggers".

  • "Rules" define the quality requirements of your versions. The rules can be either formulated as a requirement or as a preference. The first rule has the highest priority, the last one the lowest. To give some examples, here are the rules that make up the default [1080p SDR] version:

    1)  cache status  requirement :   cached
    2)  resolution    requirement :       <=  1080
    3)  resolution    preference  :  highest
    4)  title         requirement :  exclude  (H?D?.?CAM|H?D?.?TS)
    5)  title         requirement :  exclude  (3D)
    6)  title         requirement :  exclude  (DO?VI?)
    7)  title         requirement :  exclude  (HDR)
    8)  title         preference  :  include  (EXTENDED|REMASTERED)
    9)  size          preference  :   lowest
    10) seeders       preference  :  highest
    11) size          requirement :       >=  0.1
    
  • "Triggers" define when plex_debrid should look for a version. You can add triggers that limit a version to a specific media type, or to specific movies/shows. You can define how many times plex_debrid should attempt to download a version and how many attempts should be made with other versions, before a version is attempted to be downloaded. Other triggers can limit a version to a specific genre or can limit a version to a specific user that requested the movie/show. Here are some of the possible triggers, given in an example of a 720p version that should only be looked for, if the media items in question are "shows" that have been released "before 2010", are not "Family Guy" or "Last week tonight", and no other version has been found for "5 attempts":

    A) media type    requirement :   shows
    B) retries       requirement :       >=  5
    C) retries       requirement :       <=  48
    D) title         requirement :  exclude  (family.guy|last.week.tonight)
    E) year          requirement :       <=  2010
    
  • Text based rule values are interpreted as regex definitions, are case-insensitive and use official regex syntax. check out regexr.com to try out your regex definitions, or visit our discord server to see how other people use versions.

Limitations:

Plex Limitations:
  • If plex is chosen as the library collection service, trakt and overseerr content needs to be matched to the plex media type. In order to accurate match content from Overseerr and Trakt to Plex, its neccessary to have at least one movie and one show inside a library thats visible by plex_debrid. Thats because in order to accurately match content, a search by imdb/tmdb/tvdb ID is necessary - which currently only works by requesting a "Fix Match" call to an existing library item. Until Plex allows a universal search by ID, this is the best I can do.
  • plex_debrid cannot destinguish between a truly empty library and a library that couldnt be reached because its offline (or not reachable for any other reason). In order to avoid unwanted behaviour, the script simply stops running whenever an empty library is encountered. You will need to manually add at least one media item to the libraries visible by plex_debrid, before the download automation can run savely.
  • The plex discover api only provides release dates, not precise release times. Its recommended to connect the script to trakt.tv, which enables plex_debrid to find more accurate release dates and even find out if movies can be downloaded before their actual release date.

plex_debrid's People

Contributors

codevski avatar itstoggle avatar kacecottam avatar kamalf avatar kana2001 avatar maspuce avatar mcorcoran avatar murmiration avatar piratsch avatar themegaphoenix 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

plex_debrid's Issues

Error when items with special characters are in Trakt Watchlist

I get the following error when I have the show "Rap Sh!t" in my Trakt watchlist. I believe the exclamation point is causing the error.

Exception in thread Thread-1312:
Traceback (most recent call last):
File "/opt/homebrew/Cellar/[email protected]/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/threading.py", line 980, in _bootstrap_inner
self.run()
File "/opt/homebrew/Cellar/[email protected]/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/threading.py", line 917, in run
self._target(*self._args, **self._kwargs)
File "/Volumes/external/plex_rd.py", line 2495, in run
if plex_watchlist.update() or overseerr_requests.update() or trakt_watchlist.update():
File "/Volumes/external/plex_rd.py", line 815, in update
for element in watchlist_shows:
TypeError: 'NoneType' object is not iterable

Editing show menu on startup setting crashes the script

Hello.
I was attempting to edit the setting not to show menu on startup (inputs are 2411 the last '1' causes the crash) but when you attempt to edit it the script crashes with this traceback:

Traceback (most recent call last):
File "/home/rom/plex_rd.py", line 2304, in
ui.run()
File "/home/rom/plex_rd.py", line 2272, in run
ui.options()
File "/home/rom/plex_rd.py", line 2221, in options
option.input()
File "/home/rom/plex_rd.py", line 1750, in input
func()
File "/home/rom/plex_rd.py", line 2200, in settings
setting.input()
File "/home/rom/plex_rd.py", line 1787, in input
clipboard.copy(getattr(self.cls,self.key))
File "/home/rom/.local/lib/python3.10/site-packages/pyperclip/init.py", line 659, in lazy_load_stub_copy
return copy(text)
File "/home/rom/.local/lib/python3.10/site-packages/pyperclip/init.py", line 336, in call
raise PyperclipException(EXCEPT_MSG)
pyperclip.PyperclipException:
Pyperclip could not find a copy/paste mechanism for your system.
For more information, please visit https://pyperclip.readthedocs.io/en/latest/index.html#not-implemented-error

OS is arch-linux but the same error also happens on freebsd

Would be happy to give more info if required.

Virtual disk disappeared

Hi.

It worked for me for a short time, then the disc disappeared.. I don't know what the problem is. I applied the steps correctly.. My system is Windows 11.. What do you think the problem is?

Missing permissions

Sorry for spamming the issues but eh, what can you do...

The script doesn't have permissions to access settings.json
image

This one I genuinely don't know how to fix, because if I open an admin cmd it will say it's missing modules but if I right click and open with python it doesn't have permissions, unless this is something completely different.

docker unable to connect to localhost

hi just trying out the dockerized version of plex debrid unable to get it to work
after the initial setup when i choose run it says unable to connect to localhost:32400 or the plex library is really empty

Issues scraping indexers from jackett

Hi there, here is the snip of the errors i a m getting when only jackett scraper is enabled. I have no issues using the default scrapers. Let me know if you need anything else. I am using a windows 10 machine.
image

RealDebrid issues

Hey, since the last time I got the script to work I've had quite a few issues;

  1. Any time I would add something to the watchlist, it scrape, download, and I'd be able to watch it but it kept erroring out saying either the plex transcoder crashed or that I don't have good enough internet connection (100d/60u) and most of the time it did play, the video would just be a smeary mess. I tried different indexers, and I doubt that was it but it did improve the scraping time. I also tried both on my desktop and phone and it's about the same, smeary mess and dies after maybe 10 seconds.

  2. Since then I left it for a few days as I didn't have time to mess around with it, but now that I've come back to it I got a real-debrid error 8, essentially saying I have a bad token. (removed id just to be safe idk)
    image
    image

Did the token expire or did I get banned? This genuinely makes no sense to me anymore.
Also just to mention, I got a refund and used your referral code, hope you got some free days :)

Don't add "SAMPLE" files

Not sure if your script handles the part of selecting which files of the torrents to download.

It would be nice if files containing "SAMPLE" in the title could be excluded (as they show up as movies...)

Thank you!

Jackett as an indexer/scraper

https://github.com/Murmiration/plex_rd-jackett

Have you seen this fork of your project? You seem to have interacted with the dev at some point. I am experimenting with Jackett right now too in some way, managed to get an instance of it running remotely on a Heroku dyno and I'm trying to integrate its API to control my debrid services, instead of having to use the arr apps (Sonarr, Radarr etc) which require downloading content/hoarding and running everything 24/7 on a home server.

Issues in script

Hi, and first of all, thank you so much for creating this fantastic project. The script I am trying to add to my plex server failed while I was trying to run it. I am a complete beginner with this project. I am done with mounting a real debris through rclone but still unable to get this script run. I am using Python3 latest, and the script gives me an error on line 91. Could you please help me here, also rClone is not cloning properly on my server with the clone mount parameters you mentioned. I am. Having4 core, 8G RAM server with 200G SSD with a network port of 200 Mbps.

(solved) No Releases are addes since newest update

Hi :)

Ever since I updated to the newest version, no releases are added (even when many are found).
Release sorting settings:

"Release sorting":[
            [
                "(1080|720|480)(?=p|i)",
                "title",
                "number",
                "1"
            ],
            [
                "(.*)",
                "wanted",
                "number",
                "1"
            ],
            [
                "(.*)",
                "unwanted",
                "number",
                "0"
            ],
            [
                "(1337x)",
                "source",
                "text",
                "0"
            ],
            [
                "(EXTENDED|REMASTERED)",
                "title",
                "text",
                "1"
            ],
            [
                "(h.?265|x.?265)",
                "title",
                "text",
                "1"
            ],
            [
                "(.*)",
                "title_deviation",
                "number",
                "0"
            ],
            [
                "(.*)",
                "size",
                "number",
                "0"
            ]
        ]

Any Ideas on what's going on here?

Multiple Versions

Add functionality to add multiple versions of a movie/show. E.g. HDR and an SDR versions or 2160p and 1080p versions

Cannot connect to plex

Hi

I've tried to install the rclone.exe on windows and nothing loaded, and i got plex_rd working, which is saying cannot reach plex even tho i have it on the same server, Any ideas to get rclone installed and for it to access my plex? Im using windows server 2012 :-)

plex rediscovering already downloaded content

When mounting realdebrid with the rclone fork aswell as the official rclone software, it seems as though Plex re-discovers some content when the download link is re-generated by rclone - putting it at the top of the "recently added" list. This is not an issue persay, but it's not pretty either.

Plex library not refreshed

The script successfully detects when an item has been added to the watchlist. It also correctly matches the media and requests it on the debrid service. However, I don't think the request to refresh the library is working correctly. I've reproduced this bug quite a few times -- I have to rescan the library from Plex UI.

I wonder if this is due to a race condition? Perhaps the refresh instruction is sent before the media is ready to be indexed.

Reset to default

Hi mate, thanks for creating this wonderful tool. Is there a way to reset all the settings of the script to default? I was playing with scrapers/sort releases etc and would like to know how to reset it back to default. Thanks again.

Items added to ignore list after release

Is there a way to delay adding items to the ignore list if nothing is found? Sometimes new episodes are scraped right after release, but before a torrent is found and are added to the ignore list. When the torrents are available a few hours later, it doesn't re-scrape. Maybe an option to add a 24 hr delay before adding to the ignore list?

duplicate downloads for newly watchlisted content

sometimes the script doesnt recognize media content as already downloaded and tries to download it again (multiple times).

This seems to occur when a plex library refresh does not find the media content, but im not entirely sure when and how this happens.

Will try to fix this asap

Automation Idea

Firstly, I would like to say I am so thankful you are developing this tool! It really is all I needed and it helps me a lot!

Secondly, I would like to request a quality of life feature.

When an user wishes to watch a title, the following process occurs:

  1. Choosing the desired title;
  2. Adding the title to the Wishlist;
  3. Going Back to the home page waiting for the title to appear;
  4. Clicking on the title once again

I believe the user experience would be positively impacted if steps 3 and 4 were somehow automated. That way when clicking on the "Add to Wishlist" button, the selected title would automatically open and play in the video player after a few seconds.

Sort releases by the number of seeders

First off I want to say this is a great scripts and is quite use-full but I have ran into the issue of the script picking torrents with 1 or 2 seeders hence it taking a while to download my movies. I have Jackett setup and when I manually search for a movie it brings up multiple torrents with tons of seeders so I'm left to assume its something to do with the script

Request: Add support for other debrid providers

Hi, would love to see your projects evolve and support other Debrid providers which offer API access.

Can help test, and maybe implement and might be able to provide temporary API access from my accounts for the following services: Debrid-Link.fr, AllDebrid.com.

I bet many people would also want to see this for Premiumize.me

Links to API:
DL: https://debrid-link.fr/api_doc/v2/introduction

AD:
https://docs.alldebrid.com/#general-informations

Both these services offer Webdav by the way, in contrast to RD and Debrid-Link.fr also seeds content which makes it my current favorite and compatible with private trackers.

Library refresh for emby and jellyfin

plex_debrid will work with other personal media servers in the future. To make new content available to watch, a library refresh needs to be able to be performed for these services.

Jellyfin or Jellyseerr Support?

hey itsToggle!

I just wanted to ask about Jellyfin compatibility since Jellyfin is FOSS and runs quite similarly to Plex.
At the moment, I can use plex_debrid to get the files and then use Jellyfin to play them, but I'd rather get rid of the middle man and simply use Jellyfin, Jellyseerr [https://hub.docker.com/r/fallenbagel/jellyseerr], and plex_debrid. I don't care as much for the Plex reccommended section but I would love to have Jellyfin support!

Thanks so much for your great work on this cohesive software!

Crashing after running for a while, macOS Monterey

Exception in thread Thread-1:
Traceback (most recent call last):
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/threading.py", line 932, in _bootstrap_inner
self.run()
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "plex_rd.py", line 1712, in run
element.download(library=library)
File "plex_rd.py", line 328, in download
self.Seasons = self.uncollected(library)
File "plex_rd.py", line 303, in uncollected
Seasons.remove(season)
ValueError: list.remove(x): x not in list
^CTraceback (most recent call last):
File "plex_rd.py", line 2347, in
ui.run()
File "plex_rd.py", line 2315, in run
ui.options()
File "plex_rd.py", line 2248, in options
option.input()
File "plex_rd.py", line 1774, in input
func()
File "plex_rd.py", line 1751, in run
text = input("")

Download fails 'object has no attribute 'id''

Hi!

I often get the following error when the script tries to download tv series:

Exception in thread Thread-127:
Traceback (most recent call last):
  File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/script/plex_rd.py", line 1313, in download
    result[index] = cls.download(library=library,parentReleases=parentReleases)
  File "/script/plex_rd.py", line 347, in download
    if not self.debrid_download():
  File "/script/plex_rd.py", line 381, in debrid_download
    if not debrid.download(self,stream=False):
  File "/script/plex_rd.py", line 714, in download
    if service.download(element,stream=stream,query=query,force=force):
  File "/script/plex_rd.py", line 868, in download
    debrid.realdebrid.post('https://api.real-debrid.com/rest/1.0/torrents/selectFiles/' + str(response.id), {'files':'all'})
AttributeError: 'types.SimpleNamespace' object has no attribute 'id'

Multi-Season packs are not prefered

When downloading very old shows, releases are popular that contain more than one season. This is currently not prefered inside the scraper and leads to missing episodes or missing seasons.

Trakt Problem?

Just downloaded the new one and i added my Trakt username and did the auth code but its coming up with errors
error

The scripts great, I've used it a lot, Think i've tired it out lol

Scraping Doesn't Work with Overseerr Sync and Prowlarr

Hello again! I decided to take my day out and get plex_debrid working on my Mac. However, after setting up everything I wanted, every type of scraping fails. It simply gives these errors before anything takes place. I've tried my best to figure out what's wrong but I have no clue at the moment.

2022-08-03 15:56:21.960399] scraping sources for query "pirates.of.the.caribbean.dead.men.tell.no.tales.2017" ... Exception in thread Thread-2:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/threading.py", line 932, in _bootstrap_inner
self.run()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "plex_rd.py", line 2516, in scrape
result[index] = cls(query)
File "plex_rd.py", line 2458, in new
response = scraper.prowlarr.session.get(url,headers=headers)
File "/Users/hassaanali/Library/Python/3.8/lib/python/site-packages/requests/sessions.py", line 542, in get
return self.request('GET', url, **kwargs)
File "/Users/hassaanali/Library/Python/3.8/lib/python/site-packages/requests/sessions.py", line 515, in request
prep = self.prepare_request(req)
File "/Users/hassaanali/Library/Python/3.8/lib/python/site-packages/requests/sessions.py", line 443, in prepare_request
p.prepare(
File "/Users/hassaanali/Library/Python/3.8/lib/python/site-packages/requests/models.py", line 318, in prepare
self.prepare_url(url, params)
File "/Users/hassaanali/Library/Python/3.8/lib/python/site-packages/requests/models.py", line 392, in prepare_url
raise MissingSchema(error)
requests.exceptions.MissingSchema: Invalid URL '/api/v1/search?query=pirates.of.the.caribbean.dead.men.tell.no.tales.2017&type=search&limit=1000&offset=0': No scheme supplied. Perhaps you meant http:///api/v1/search?query=pirates.of.the.caribbean.dead.men.tell.no.tales.2017&type=search&limit=1000&offset=0?
Exception in thread Thread-1:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/threading.py", line 932, in _bootstrap_inner
self.run()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "plex_rd.py", line 2545, in run
element.download(library=library)
File "plex_rd.py", line 343, in download
self.Releases += scraper(self.query())
File "plex_rd.py", line 2240, in new
scraped_releases += result
TypeError: 'NoneType' object is not iterable

Wont recognize requests

I installed requests but the script keeps asking for it
image
image

I reinstalled python and restarted my computer multiple times, but that's about the extent of my troubleshooting knowledge.

suggestion: rate limiting

Some sort of rate limit seems to be needed, got an error on realdebrid: too many connections.
If the watchlist is large (500+) it should maybe be split up in smaller iterations and / or rate limited to x queries per minute or something in order not to get IP blacklisted.

Quality Filters to be used while scraping

If we can set the quality filter like the minimum the scraper can fetch is 720p and maximum 1080p or 1440p in the filter would be great instead of filters based on sizes. Size filter is not useful in the cases where episodes with variable duration will vary in sizes too, effectively meaning missing out on those one.

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.