plex_autoscan


Recommended Posts

https://github.com/l3uddz/plex_autoscan

 

So, I've installed this easily on Ubuntu boxes but hit a snag installing the requirements from the requirements.txt file (below).

 

Flask ~= 0.12.2
psutil ~= 5.4.0
requests ~= 2.18.4
peewee ~= 2.10.1
backoff ~= 1.5.0
sqlitedict ~= 1.5.0
sudo python -m pip install -r requirements.txt

 

This is my error when I do the install:
 

Requirement already satisfied: Flask~=0.12.2 in /usr/lib64/python2.7/site-packages (from -r requirements.txt (line 1)) (0.12.4)
Collecting psutil~=5.4.0 (from -r requirements.txt (line 2))
  Using cached https://files.pythonhosted.org/packages/7d/9a/1e93d41708f8ed2b564395edfa3389f0fd6d567597401c2e5e2775118d8b/psutil-5.4.7.tar.gz
Collecting requests~=2.18.4 (from -r requirements.txt (line 3))
  Using cached https://files.pythonhosted.org/packages/49/df/50aa1999ab9bde74656c2919d9c0c085fd2b3775fd3eca826012bef76d8c/requests-2.18.4-py2.py3-none-any.whl
Collecting peewee~=2.10.1 (from -r requirements.txt (line 4))
  Using cached https://files.pythonhosted.org/packages/7a/bc/aafce76cae9362dccf70e35c16a6cc11d114ebb640bbb86d76255be5c0d6/peewee-2.10.2.tar.gz
Collecting backoff~=1.5.0 (from -r requirements.txt (line 5))
  Using cached https://files.pythonhosted.org/packages/99/c2/e8309fc7a635132df5731ec52a95bf9edee9d0214cafef22d2855a99748e/backoff-1.5.0.tar.gz
Collecting sqlitedict~=1.5.0 (from -r requirements.txt (line 6))
  Using cached https://files.pythonhosted.org/packages/7e/ab/e8af7777c1b7daafc9b7594dc17872b72d64cc8524ecd4e7c1f261918e72/sqlitedict-1.5.0.tar.gz
Requirement already satisfied: click>=2.0 in /usr/lib64/python2.7/site-packages (from Flask~=0.12.2->-r requirements.txt (line 1)) (7.0)
Requirement already satisfied: Jinja2>=2.4 in /usr/lib64/python2.7/site-packages (from Flask~=0.12.2->-r requirements.txt (line 1)) (2.10)
Requirement already satisfied: Werkzeug>=0.7 in /usr/lib64/python2.7/site-packages (from Flask~=0.12.2->-r requirements.txt (line 1)) (0.14.1)
Requirement already satisfied: itsdangerous>=0.21 in /usr/lib64/python2.7/site-packages (from Flask~=0.12.2->-r requirements.txt (line 1)) (0.24)
Collecting chardet<3.1.0,>=3.0.2 (from requests~=2.18.4->-r requirements.txt (line 3))
  Using cached https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl
Collecting certifi>=2017.4.17 (from requests~=2.18.4->-r requirements.txt (line 3))
  Using cached https://files.pythonhosted.org/packages/df/f7/04fee6ac349e915b82171f8e23cee63644d83663b34c539f7a09aed18f9e/certifi-2018.8.24-py2.py3-none-any.whl
Collecting urllib3<1.23,>=1.21.1 (from requests~=2.18.4->-r requirements.txt (line 3))
  Using cached https://files.pythonhosted.org/packages/63/cb/6965947c13a94236f6d4b8223e21beb4d576dc72e8130bd7880f600839b8/urllib3-1.22-py2.py3-none-any.whl
Collecting idna<2.7,>=2.5 (from requests~=2.18.4->-r requirements.txt (line 3))
  Using cached https://files.pythonhosted.org/packages/27/cc/6dd9a3869f15c2edfab863b992838277279ce92663d334df9ecf5106f5c6/idna-2.6-py2.py3-none-any.whl
Requirement already satisfied: MarkupSafe>=0.23 in /usr/lib64/python2.7/site-packages (from Jinja2>=2.4->Flask~=0.12.2->-r requirements.txt (line 1)) (1.0)
Installing collected packages: psutil, chardet, certifi, urllib3, idna, requests, peewee, backoff, sqlitedict
  Running setup.py install for psutil ... error
    Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-At35Ip/psutil/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-rxqpvh/install-record.txt --single-version-externally-managed --compile:
    /tmp/tmp5bSa1K.c:1:10: fatal error: linux/ethtool.h: No such file or directory
     #include <linux/ethtool.h>
              ^~~~~~~~~~~~~~~~~
    compilation terminated.
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-2.7
    creating build/lib.linux-x86_64-2.7/psutil
    copying psutil/_pswindows.py -> build/lib.linux-x86_64-2.7/psutil
    copying psutil/_compat.py -> build/lib.linux-x86_64-2.7/psutil
    copying psutil/_psosx.py -> build/lib.linux-x86_64-2.7/psutil
    copying psutil/__init__.py -> build/lib.linux-x86_64-2.7/psutil
    copying psutil/_common.py -> build/lib.linux-x86_64-2.7/psutil
    copying psutil/_pslinux.py -> build/lib.linux-x86_64-2.7/psutil
    copying psutil/_pssunos.py -> build/lib.linux-x86_64-2.7/psutil
    copying psutil/_psaix.py -> build/lib.linux-x86_64-2.7/psutil
    copying psutil/_psbsd.py -> build/lib.linux-x86_64-2.7/psutil
    copying psutil/_psposix.py -> build/lib.linux-x86_64-2.7/psutil
    copying psutil/_exceptions.py -> build/lib.linux-x86_64-2.7/psutil
    creating build/lib.linux-x86_64-2.7/psutil/tests
    copying psutil/tests/test_unicode.py -> build/lib.linux-x86_64-2.7/psutil/tests
    copying psutil/tests/test_sunos.py -> build/lib.linux-x86_64-2.7/psutil/tests
    copying psutil/tests/test_posix.py -> build/lib.linux-x86_64-2.7/psutil/tests
    copying psutil/tests/test_windows.py -> build/lib.linux-x86_64-2.7/psutil/tests
    copying psutil/tests/test_process.py -> build/lib.linux-x86_64-2.7/psutil/tests
    copying psutil/tests/test_osx.py -> build/lib.linux-x86_64-2.7/psutil/tests
    copying psutil/tests/__init__.py -> build/lib.linux-x86_64-2.7/psutil/tests
    copying psutil/tests/test_misc.py -> build/lib.linux-x86_64-2.7/psutil/tests
    copying psutil/tests/test_linux.py -> build/lib.linux-x86_64-2.7/psutil/tests
    copying psutil/tests/test_system.py -> build/lib.linux-x86_64-2.7/psutil/tests
    copying psutil/tests/test_connections.py -> build/lib.linux-x86_64-2.7/psutil/tests
    copying psutil/tests/test_memory_leaks.py -> build/lib.linux-x86_64-2.7/psutil/tests
    copying psutil/tests/test_aix.py -> build/lib.linux-x86_64-2.7/psutil/tests
    copying psutil/tests/test_contracts.py -> build/lib.linux-x86_64-2.7/psutil/tests
    copying psutil/tests/test_bsd.py -> build/lib.linux-x86_64-2.7/psutil/tests
    copying psutil/tests/__main__.py -> build/lib.linux-x86_64-2.7/psutil/tests
    running build_ext
    building 'psutil._psutil_linux' extension
    creating build/temp.linux-x86_64-2.7
    creating build/temp.linux-x86_64-2.7/psutil
    gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_VERSION=547 -DPSUTIL_LINUX=1 -DPSUTIL_ETHTOOL_MISSING_TYPES=1 -I/usr/include/python2.7 -c psutil/_psutil_common.c -o build/temp.linux-x86_64-2.7/psutil/_psutil_common.o
    In file included from /usr/include/bits/posix1_lim.h:160:0,
                     from /usr/include/limits.h:183,
                     from /usr/lib64/gcc/x86_64-slackware-linux/7.3.0/include-fixed/limits.h:194,
                     from /usr/lib64/gcc/x86_64-slackware-linux/7.3.0/include-fixed/syslimits.h:7,
                     from /usr/lib64/gcc/x86_64-slackware-linux/7.3.0/include-fixed/limits.h:34,
                     from /usr/include/python2.7/Python.h:19,
                     from psutil/_psutil_common.c:9:
    /usr/include/bits/local_lim.h:38:10: fatal error: linux/limits.h: No such file or directory
     #include <linux/limits.h>
              ^~~~~~~~~~~~~~~~
    compilation terminated.
    error: command 'gcc' failed with exit status 1

 

Link to comment

Out of genuine curiosity, can I ask why you are trying to install this?  Do you run Plex and Sonarr/Radarr on different servers?

 

I tried in the past to get this working but Iearned that this script was designed for when Plex and Sonarr/Radarr are on different servers - if they are on the same i.e. unRAID dockers, then this isn't needed as when you connect the sonarr docker to Plex, Plex only scans the directory in question.  I've witnessed this on my own setup and new media appears in plex within a minute of being added.

 

https://forum.rclone.org/t/plex-with-rclone-mount-possible-to-auto-update-partial-scan/5525/3?u=binsonbuzz

 

Quote

If everything is on one server, I’d suggest using Sonarr/Radarr to download and rename instead of file bot. You can use the built-in Sonarr/Radarr integration to trigger a plex scan (it’s under the “Connect” feature in Sonarr/Radarr) when a new episode/movie is downloaded. The Plex integration works in a way that it will only scan the folder that was changed by Sonarr/Radarr (so for example, a new episode of a tv show, Plex will only scan the Season folder). It happens very quickly so new episodes after they are moved with Sonarr/Radarr will end up in Plex within a minute or so.

 

Link to comment
On 10/5/2018 at 6:16 PM, DZMM said:

Out of genuine curiosity, can I ask why you are trying to install this?  Do you run Plex and Sonarr/Radarr on different servers?

 

I tried in the past to get this working but Iearned that this script was designed for when Plex and Sonarr/Radarr are on different servers - if they are on the same i.e. unRAID dockers, then this isn't needed as when you connect the sonarr docker to Plex, Plex only scans the directory in question.  I've witnessed this on my own setup and new media appears in plex within a minute of being added.

 

https://forum.rclone.org/t/plex-with-rclone-mount-possible-to-auto-update-partial-scan/5525/3?u=binsonbuzz

 

 

I have two servers.

Server #1 = Remote Feeder Server (Dedicated Hetzner Server in Germany). it has the Usenet stack (Sonarr, Radarr, NZBGet).....and it grabs content and pushes it up to the Cloud
Server #2 = UnRAID Server with Plex Docker and rclone mounts to read cloud content.

 

Issue = Sonarr/Radarr are on a different server than plex.  Therefore, when new content is added, Plex does not perform a scan and add the content.

Solution = Plex_Autoscan. It fires off a manual scan of the specific directory where new content has been added. I'm also trying to get plex_rcs working but hit a snag there as well. Posted on their github about it asking dev for help.

 

I actually have Plex_Autoscan working just fine on Server #1....I have Plex installed on that Server as well. Plex_Autoscan is far more efficient than Plex native Automatic Scans. When Plex detects content, it re-scans the ENTIRE library where the new content was added to. With Plex_Autoscan, a command is sent to Plex to ONLY scan the directory where new content was added instead of the ENTIRE library.

 

If I can get Plex_Autoscan requirements installed successfully on Server #2 (UnRAID server).....then I can make Sonarr/Radarr on Server #1 fire off a webhook command to Server #2 upon successful download. This is all documented in the Plex_Autoscan github

Edited by Stupifier
Link to comment

Yeah, my life is a lot easier at the moment as I do everything locally and just manage my gdrive mount via rclone on my unRAID server.

 

Maybe have a go at installing plex_rcs which the author claims is easier to install the plex_autoscan - the instructions definitely seem simpler.

Quote

If you have different servers for downloading and Plex, you can use plex_autoscan, but I’ll shamelessly plug my new program plex_rcs (https://github.com/stokkes/plex_rcs 97). Plex_rcs works by monitoring the rclone cache log and when it detects a cache expiration notification (new file on Google Drive), it will trigger a scan immediately of the folder that was modified, so shows should appear very quickly there as well. It integrates with Plex directly so it compares the folder that was just modified by rclone against your Plex library, matches the section and updates only the folder in question. Configuration is pretty simple compared to plex_autoscan.

https://github.com/stokkes/plex_rcs

Link to comment
12 minutes ago, DZMM said:

Yeah, my life is a lot easier at the moment as I do everything locally and just manage my gdrive mount via rclone on my unRAID server.

 

Maybe have a go at installing plex_rcs which the author claims is easier to install the plex_autoscan - the instructions definitely seem simpler.

https://github.com/stokkes/plex_rcs

My Download/Upload speeds are pitiful compared to that of Hetzner (1 gbps up/down). That's why I do what I do.

 

Already been in the process of setting that up....but I hit a snag and posted up on his github hoping for help.

 

I got plex_rcs to detect changes and identify where to scan....but I get weird errors when it actually tries to fire the manual Plex scan command. Real frustrating currently. But yes, I believe this method of doing things is much more straight forward.....just wish I could figure it out. I'm "zhdenny" on github in there.
https://github.com/stokkes/plex_rcs/issues/2

 

As a poor alternative, I have my UnRAID Plex instance doing Full scans of all of my Plex Libraries every hour.......it picks up everything......it's just not instant like I would like.

Edited by Stupifier
Link to comment
8 hours ago, DZMM said:

I actually need plex_rcs as well now as I'm uploading content to the mount direct now, so plex isn't picking this up straightaway.  Can you post your modified script please so I can see if I can get it working on my system - thanks

Attached my modified plex_rcs.py. Take special notice to the lines I mention in this thread. That outlines all the differences/changes made. You might choose to modify that further to fit YOUR NEEDS.
https://github.com/stokkes/plex_rcs/issues/2

plex_rcs.py

  • Like 1
Link to comment
18 hours ago, Stupifier said:

Care to share your "workaround"?

The problem I wanted to solve was different to yours.  I wanted to ditch unionfs from Nerd Pack as I have a strong suspicion it is causing problems on my server. 

 

To get rid of it I created a new rclone cache remote to handle uploading files to gdrive, whilst still presenting a 'union' for radarr and sonarr of what's on gdrive and what's still local.  I still use a vfs mount for plex to play cloud files.  I thought plex via the vfs mount wouldn't see new files uploaded via rclone cache or scan just the right directories, but this luckily proved to be wrong.

 

The other problem I thought I'd have was how to get plex to see and play files that were local i.e how to expose just the local files from the rclone cache mount, as I wanted plex to play gdrive files via the vfs mount?  I managed to fix this by decrypting and mounting the folder where the local files were encrypted and awaiting upload by rclone cache, and then adding this new mount of just local files to plex.  Again, I lucked out as plex spotted any new local files almost instantly.

  • Like 1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.