[ PlexDrive ] [ 5.0.0 ] Plexdrive mounts your Google Drive FUSE filesystem (optimized for media playback)

This is the best place for community developers to publish their genius work. Your Apps enrich the QNAP Turbo NAS.
User avatar
QNAP_Stephane
Experience counts
Posts: 2767
Joined: Wed Mar 27, 2013 1:00 am

[ PlexDrive ] [ 5.0.0 ] Plexdrive mounts your Google Drive FUSE filesystem (optimized for media playback)

Postby QNAP_Stephane » Tue Dec 12, 2017 9:13 pm

Image

Source : https://github.com/dweidenfeld/plexdrive

Download : x86 (fw 4.2.6) / arm64 / x31 /x41 /x19 /x64

https://qnapclub.eu/index.php?act=detail&qpkg_id=505

About :

Plexdrive allows you to mount your Google Drive account as read-only fuse filesystem, with direct delete option on the filesystem.

The project is comparable to projects like rclone, google-drive-ocamlfuse or node-gdrive-fuse, but optimized for media streaming e.g. with plex ;)

Please note that plexdrive doesn't currently support writes (adding new files or modifications), it only supports reading existing files and deletion.

Code: Select all

[~] # plexdrive --help
Usage of plexdrive:
  --cache-file string
        Path the the cache file (default "/share/homes/admin/.plexdrive/cache.bolt")
  --chunk-check-threads int
        The number of threads to use for checking chunk existence (default 2)
  --chunk-load-ahead int
        The number of chunks that should be read ahead (default 3)
  --chunk-load-threads int
        The number of threads to use for downloading chunks (default 2)
  --chunk-size string
        The size of each chunk that is downloaded (units: B, K, M, G) (default "10M")
  -c, --config string
        The path to the configuration directory (default "/share/homes/admin/.plexdrive")
  -o, --fuse-options string
        Fuse mount options (e.g. -fuse-options allow_other,...)
  --gid int
        Set the mounts GID (-1 = default permissions) (default -1)
  --max-chunks int
        The maximum number of chunks to be stored on disk (default 8)
  --refresh-interval duration
        The time to wait till checking for changes (default 1m0s)
  --root-node-id string
        The ID of the root node to mount (use this for only mount a sub directory) (default "root")
  --uid int
        Set the mounts UID (-1 = default permissions) (default -1)
  --umask value
        Override the default file permissions
  -v, --verbosity int
        Set the log level (0 = error, 1 = warn, 2 = info, 3 = debug, 4 = trace)
  --version
        Displays program's version information
--------------------------------------------------------------------------
QnapClub AppCenter - https://www.qnapclub.eu
--------------------------------------------------------------------------

User avatar
mydjtl
Getting the hang of things
Posts: 65
Joined: Wed Jan 11, 2017 7:52 am

Re: [ PlexDrive ] [ 5.0.0 ] Plexdrive mounts your Google Drive FUSE filesystem (optimized for media playback)

Postby mydjtl » Sun Dec 31, 2017 12:48 pm

How do you install fuse on QNAP?


https://github.com/dweidenfeld/plexdrive

Installation
First you need to install fuse on your system
Then you should download the newest release from the GitHub release page.
Create your own client id and client secret (see https://rclone.org/drive/#making-your-own-client-id).
Sample command line for plexdrive
./plexdrive mount -c /root/.plexdrive -o allow_other /mnt/plexdrive
TS-251+ w (2) 3gb Red WD HDs. 8gb RAM in one slot. 4.3.3

User avatar
QNAP_Stephane
Experience counts
Posts: 2767
Joined: Wed Mar 27, 2013 1:00 am

Re: [ PlexDrive ] [ 5.0.0 ] Plexdrive mounts your Google Drive FUSE filesystem (optimized for media playback)

Postby QNAP_Stephane » Sun Dec 31, 2017 6:22 pm

it is installed by default on your NAS
--------------------------------------------------------------------------
QnapClub AppCenter - https://www.qnapclub.eu
--------------------------------------------------------------------------

bluebonnet
New here
Posts: 5
Joined: Fri May 29, 2015 11:35 pm

Re: [ PlexDrive ] [ 5.0.0 ] Plexdrive mounts your Google Drive FUSE filesystem (optimized for media playback)

Postby bluebonnet » Sat Jul 14, 2018 7:07 am

Can I get more step-by-step instructions of what to do after the install? I installed the qpkg, but not sure what to do next. I do have a gdrive API key, but don't know where to put it in.

bluebonnet
New here
Posts: 5
Joined: Fri May 29, 2015 11:35 pm

Re: [ PlexDrive ] [ 5.0.0 ] Plexdrive mounts your Google Drive FUSE filesystem (optimized for media playback)

Postby bluebonnet » Thu Aug 09, 2018 11:57 am

This was a real trial and error process for me to figure out how to set this up. Thought I'd document the exact steps that work on a QNAP so others could set this up too. It is fantastic if you want to use the Plex Media Server to load media files from your Google Drive.

Prep
1) Install the PlexDrive app from https://qnapclub.eu/en/qpkg/505. This app does nothing in the regular QNAP gui interface, you have to access it via Terminal. Note, we already have Fuse on QNAP, so nothing is needed to get that installed/working.
2) Get Google API credentials (recommended) or create your own. Follow the instructions here: https://rclone.org/drive/#making-your-own-client-id. Paste these into a text file so they are ready to go when you get to step 5.

Mount Your PlexDrive
3) Use any SSH terminal to connect to your server, such as BitVise, Putty, etc. Log in to your Qnap's IP address as the admin.
4) Change to the PlexDrive app directory:

Code: Select all

 cd /share/CACHEDEV1_DATA/.qpkg/PlexDrive

5) Enter the command to mount your PlexDrive:

Code: Select all

 ./plexdrive mount -c /root/.plexdrive -o allow_other /mnt/HDA_ROOT/plexdrive

You will know it is working if you get the following instructions:

Code: Select all

   1. Please go to https://console.developers.google.com/
   2. Create a new project
   3. Go to library and activate the Google Drive API
   4. Go to credentials and create an OAuth client ID
   5. Set the application type to 'other'
   6. Specify some name and click create
   7. Enter your generated client ID: xxxxxxx  [i]<enter your own client id here and press enter[/i]
   8. Enter your generated client secret: xxxxxx  [i]<enter your own client secret here and press enter[/i]
   Go to the following link in your browser https://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=xxxxx=state-token
   Paste the authorization code: xxxxxx

Once you have entered the required info, it will take a few mins to build the cache, but it is now set and ready.

Create a Plex library from your Google Drive media
6) Restart Plex.
7) Add a new library from location /mnt/HDA_ROOT/plexdrive/
For example, I have a library called "Gdrive Movies" pointing to /mnt/HDA_ROOT/plexdrive/Media/Movies/

Hope this helps someone.

bluebonnet
New here
Posts: 5
Joined: Fri May 29, 2015 11:35 pm

Re: [ PlexDrive ] [ 5.0.0 ] Plexdrive mounts your Google Drive FUSE filesystem (optimized for media playback)

Postby bluebonnet » Thu Aug 09, 2018 12:38 pm

Also, if you are getting errors for "Transport Endpoint is not connected," then use this command to unmount:

Code: Select all

fusermount -uz /mnt/HDA_ROOT/plexdrive

You will get a return message that "fusermount: /mnt/HDA_ROOT/plexdrive not mounted"

Them re-run the mount command:

Code: Select all

./plexdrive mount -c /root/.plexdrive -o allow_other /mnt/HDA_ROOT/plexdrive

bluebonnet
New here
Posts: 5
Joined: Fri May 29, 2015 11:35 pm

Re: [ PlexDrive ] [ 5.0.0 ] Plexdrive mounts your Google Drive FUSE filesystem (optimized for media playback)

Postby bluebonnet » Sun Aug 12, 2018 7:30 am

I'm having some problems with my setup and would appreciate any help. All of my directions above work great for getting plexdrive (pd) mounted, well at least temporarily. After I run the mounting steps in terminal, it seems the pd setup never really finishes full setup. I never get any kind of completion notice. But, if I leave the terminal window open, pd stays mounted and I can use it -- can load plex libraries, can ** streaming from my gdrive, etc. Works really great. But as soon as I disconnect from terminal (close my ssh session), the plexdrive mount breaks and nothing works.

So, I am at a loss for what could be the issue. Is there something missing in my setup? Is it QNAP just not liking the mount and disconnecting it as soon as I am not connected?

Thoughts?

bluebonnet
New here
Posts: 5
Joined: Fri May 29, 2015 11:35 pm

Re: [ PlexDrive ] [ 5.0.0 ] Plexdrive mounts your Google Drive FUSE filesystem (optimized for media playback)

Postby bluebonnet » Sun Aug 19, 2018 3:37 pm

I figured it out. Plexdrive needs to continually run in terminal, and as soon as you close the terminal session it breaks it (per my previous post). The solution is to use Tmux, which allows an ongoing terminal session to run even if you close the window. Apparently this is standard on linux, but qnap doesn't have it by default. Here are the directions I found in another post, and they work for me so far:
1) Manually install Entware: https://qnapclub.eu/en/qpkg/286
2) Manually install tmux: https://qnapclub.eu/en/qpkg/395
3) SSH to QNAP from computer
4) tmux
5) enter the commands to launch plexdrive, outlined above
6) close entire terminal session - command entered keeps running
7) login to QNAP again by SSH
8 ) tmux a (get back to monitoring process you began in tux previously)

Some good tux introductory material here: https://danielmiessler.com/study/tmux/

My next challenge: how to get this to autorun when the server reboots


Return to “Community Apps”

Who is online

Users browsing this forum: No registered users and 3 guests