Recommended Posts

Hey all.

 

A plugin for plexdrive I think would be awesome, its a twist to rclone that helps to avoid the APi bans.

 

 

 

Share this post


Link to post
Share on other sites

Agreed.. This would be great for mounting gdrive accounts for Plex...

Sent from my ONEPLUS A3000 using Tapatalk

Share this post


Link to post
Share on other sites
On 5/27/2017 at 9:22 AM, starbix said:

Hey I wrote a plexdrive plugin. Here it is: https://raw.githubusercontent.com/Starbix/unRAID-plugins/master/plugins/plexdrive.plg

 

I'm totally new to plugin writing, but I also have a unionfs plugin if anyone else is interested.

 

Hopefully it works for you guys

 

Hey Starbix.

 

I would love your unionfs plugin as well.

 

Figuring it out is another thing but I would appreciate it for sure.


And thanks for your first plugin!

Share this post


Link to post
Share on other sites

Can anyon give a tutorial on how the plexdrive pluin works?

 

I installed it, but cannot et it to run.

 

Thanks!

Share this post


Link to post
Share on other sites
6 minutes ago, airbillion said:

Can anyon give a tutorial on how the plexdrive pluin works?

 

I installed it, but cannot et it to run.

 

Thanks!

The plugin places the file "plexdrive" in the /usr/sbin/ folder, so you would just run your command pointing at that.

 

I just spent like a week hitting my head against a wall so let me know if you want more details on how I got plexdrive working A-Z

Share this post


Link to post
Share on other sites
Posted (edited)

OK...I found it and got it to run...thanks...

 

Any additional help on how you have it set up would be great!

Edited by airbillion

Share this post


Link to post
Share on other sites
Posted (edited)
25 minutes ago, airbillion said:

OK...I found it and got it to run...thanks...

 

Any additional help on how you have it set up would be great!

Alright now please take everything I have as a guideline cause I may have set it up all wrong or not in an "optimized way" but hey, it works!

 

Alright I also did stuff over a period so prob some stuff in stupid ways, I'm also going to assume you have your drives mounted with rclone, additionally I did not encrypt, its esentially the same just point to your encrypted folders.

 

create a google API key? or whatever its called, google that.

 

-Created a folder in appdata called "plexdrive"

-created a folder in there called "tmp"

-I copied plexdrive from starbix's plugin into the plexdrive folder, and called it "plexdrive" (additionally could just install it from plexdrive github, this was one of those things that when I started I didnt know)

-chmod -755 /mnt/user/appdata/plexdrive/plexdrive

-create a file in your plexdrive folder called "config.json" and in it put your client ID and secret from google API

 

{
"clientId": "ID goes here",
"clientSecret": "Client Secret goes here"
}

 

 

So you should now have a folder /mnt/user/appdata/plexdrive and inside it should be the file plexdrive and config.json and the folder tmp

 

then here are my mounting scripts

 

/mnt/user/appdata/plexdrive/plexdrive -o allow_other -c /mnt/user/appdata/plexdrive -t

 

and

 

/mnt/user/appdata/plexdrive/tmp /mnt/disks/plxdrive/ &

 

That should get you a working plexdrive, mine mounts to /mnt/disks/plxdrive

 

And here is my rclone mount for my google drive so I can access it outside of plexdrive's read only.

 

rclone mount --allow-other --allow-non-empty plexdrive:/ /mnt/disks/plexdrive/ &

 

So at this point you should have a fully working plexdrive (read only) and a read/write google drive


Add these to your SMB

 

[plexdrive]
path = /mnt/disks/plxdrive
comment =
browseable = yes
# Public
public = yes
writeable = yes
vfs objects =

 

[plexdriveRW]
path = /mnt/disks/plexdrive
comment =
browseable = yes
# Public
public = yes
writeable = yes
vfs objects =

 

To easily wrose your folders.

 

And then (if you wish) your gonna want to make a union mount so that plex will see local and cloud data as the same.

 

So for me I make a folder:

 

/mnt/user/Media/Plex/TV (this folder was empty when I started)

 

I created a new folder in disks

 

/mnt/disks/plexdriveunion/

 

And then I merged those 2 and my plxdrive all together

 

I installed starbix's union plugin but I also went to the nerdpack plugin and installed fuse that way.

 

unionfs -o cow,allow_other /mnt/user/Media/Plex/=RW:/mnt/disks/plxdrive/Media/Plex/=RO /mnt/disks/plexdriveunion/ &

 

So now your /mnt/disks/plexdriveunion folder will have some data in it.

 

Add SMB

 

[plexdriveunion]
path = /mnt/disks/plexdriveunion
comment =
browseable = yes
# Public
public = yes
writeable = yes
vfs objects =

 

Your /mnt/user/media/Plex/TV folder will now have a hiiden folder in it.

 

Point everything, plex, sonarr, etc to /mnt/disks/plexdriveunion and off you go, they will try to write to your local copy and then you simply rclone to the cloud.

 

I'm personally using

 

rclone move --transfers 10 --exclude .unionfs/** --min-age 30d /mnt/user/Media/Plex/TV/Adult plexdrive:/Media/Plex/TV/Adult

 

 

Sorry this jumps all over the place but hopefully it poitns you in the right direction, feel free to ask follow up questions.

 

 

 

 

 

 

Edited by Sparkum
  • Upvote 2

Share this post


Link to post
Share on other sites

Awesome!

 

Thanks for the writeup....I will give this a shot tonight and see if I can get it to work...

 

Share this post


Link to post
Share on other sites

Just found this thread. I too am looking at the plexdrive but what about now that its been updated to version 4 and needs the mongodb

Share this post


Link to post
Share on other sites

You can use plexdrive4.plg instead of plexdrive.plg. Please report back how it works.

Share this post


Link to post
Share on other sites

Just trying to clarify before switching plugins, is either or both of the plexdrive 4 plugins working (starbix's or publicENEMY's)?

 

Thanks in advance.

Share this post


Link to post
Share on other sites

Well, I started playing around and it looks like mongodb is installed but needs a command like

mongod --dbpath /mnt/user/appdata/plexdrive/

 to start mongodb.  I don't know if this would best be done in the mount script or user script scheduled at array startup, etc.

Share this post


Link to post
Share on other sites
Posted (edited)

I just run this script all 5 mins together with the plexdrive stuff (which checks if it's still mounted)

 

if [[ -s "/mnt/user/appdata/plexdrive/mongodb/mongod.lock" ]]; then
echo "mongodb already started"
else
mongod --dbpath /mnt/user/appdata/plexdrive/mongodb &
fi

 

Oh and the plexdrive4 plugin should work, if not please create an issue on github.

Edited by starbix

Share this post


Link to post
Share on other sites

I'm having an issue with the plugin, where when I reboot my server, the mongod.lock file is left in place, with the wrong process number. Thus, when system starts again, it things mongodb is already running (via script above from starbix), but it can't actually find the process/connect to it. Maybe we can incorporate some sort of cleaning into the plugin, upon system shutdown?

Share this post


Link to post
Share on other sites

I did mine a little different, I have:

nohup /usr/bin/mongod --dbpath /mnt/user/appdata/plexdrive/mongodb/ &

in the beginning of my rclone mount script (which I run at array start), and

/usr/bin/mongod --dbpath /mnt/user/appdata/plexdrive/mongodb/ --shutdown

in my rclone unmount script (which I run at array stop).  This line shuts down mongodb cleanly

  • Upvote 1

Share this post


Link to post
Share on other sites
4 hours ago, jjdunkel said:

I did mine a little different, I have:


nohup /usr/bin/mongod --dbpath /mnt/user/appdata/plexdrive/mongodb/ &

in the beginning of my rclone mount script (which I run at array start), and


/usr/bin/mongod --dbpath /mnt/user/appdata/plexdrive/mongodb/ --shutdown

in my rclone unmount script (which I run at array stop).  This line shuts down mongodb cleanly

Perfect! I'll incorporate the shutdown of array script then, thanks for providing it!

On 6/29/2017 at 2:36 PM, starbix said:

I just run this script all 5 mins together with the plexdrive stuff (which checks if it's still mounted)

 


if [[ -s "/mnt/user/appdata/plexdrive/mongodb/mongod.lock" ]]; then
echo "mongodb already started"
else
mongod --dbpath /mnt/user/appdata/plexdrive/mongodb &
fi

 

Oh and the plexdrive4 plugin should work, if not please create an issue on github.

Mind sharing your script that runs every 5 minutes to check on mounts? Thanks for the plugin too!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Copyright © 2005-2017 Lime Technology, Inc. unRAID® is a registered trademark of Lime Technology, Inc.