Jump to content


Photo

GDrive - emby_autoscan

GDrive Autoscan Scan Google Drive

  • Please log in to reply
12 replies to this topic

#1 atrpm OFFLINE  

atrpm

    Advanced Member

  • Members
  • 32 posts
  • Local time: 07:12 AM

Posted 03 September 2019 - 08:24 PM

I have been working on a python script to pull file changes from GDrive using google’s api, get the file info and send a request to emby’s api to update the file path via the library/media/updated endpoint.

So far I have been able to successfully do this, script have been running with no issues for 24 hrs before I make it public there are a few improvements that I have to make.

I have tested this on a windows machine, I would like to find a few ppl with different OS to make sure that it works fine there, so please is interested send a PM.

I do have an Emby related question, after a request has been sent and media is scheduled to be refreshed, what happens if the server is restarted before that task is completed?

 

Here is the github link: https://github.com/a...gdrive_autoscan


Edited by atrpm, 05 September 2019 - 02:37 PM.


#2 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 140578 posts
  • Local time: 05:12 AM

Posted 03 September 2019 - 08:42 PM

Hi, if it's restarted then you'll have to send it again or just wait for the next library scan.

#3 atrpm OFFLINE  

atrpm

    Advanced Member

  • Members
  • 32 posts
  • Local time: 07:12 AM

Posted 03 September 2019 - 09:21 PM

Hi, if it's restarted then you'll have to send it again or just wait for the next library scan.


Luke if I send the path including the file name, will emby only scan that file or will it still scan the entire directory?

#4 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 140578 posts
  • Local time: 05:12 AM

Posted 03 September 2019 - 10:11 PM

Depends. In some cases it will scan the entire directory.

#5 atrpm OFFLINE  

atrpm

    Advanced Member

  • Members
  • 32 posts
  • Local time: 07:12 AM

Posted 05 September 2019 - 02:38 PM

Updated the post with the github link. 



#6 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 140578 posts
  • Local time: 05:12 AM

Posted 05 September 2019 - 02:40 PM

Thanks for the info !



#7 drmikewest OFFLINE  

drmikewest

    Newbie

  • Members
  • 3 posts
  • Local time: 12:12 PM

Posted 05 October 2019 - 01:27 PM

Thank you for this and a quick question.

 

Configuring the config.json file, but I am not sure what to insert in this field: 

 

driveId - google drive ID

 

What do I use for the "Google Drive ID"

 

I have tried various iterations of my Gsuite login (xyz@abc.com) but to no avail.

Should I rather be using something else? 

 

Hope this question makes sense...


Edited by drmikewest, 05 October 2019 - 01:28 PM.


#8 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 140578 posts
  • Local time: 05:12 AM

Posted 05 October 2019 - 01:35 PM

What config.json file? I have no idea what you mean, sorry.

#9 drmikewest OFFLINE  

drmikewest

    Newbie

  • Members
  • 3 posts
  • Local time: 12:12 PM

Posted 05 October 2019 - 01:42 PM

What config.json file? I have no idea what you mean, sorry.

 

From the github page: https://github.com/a...gdrive_autoscan

 

Installation, Step 5: 

Configure the config.json. (do this before moving on)

 

In the config.json is a field: "driveId": "insert drive id here"

[I'm at a loss as to what I should insert as my drive id?]

 

When I run the scan.py script, I receive the following error: 

  File "scan.py", line 19
    print(f'Starting scan for: {drive.driveId}')
                                              ^
SyntaxError: invalid syntax
 
 
Hoping that's a little clearer and makes somewhat more sense? 


#10 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 140578 posts
  • Local time: 05:12 AM

Posted 05 October 2019 - 01:43 PM

Ok sorry I don't know very much about this tool but perhaps there is someone here that does. Thanks.

#11 drmikewest OFFLINE  

drmikewest

    Newbie

  • Members
  • 3 posts
  • Local time: 12:12 PM

Posted 05 October 2019 - 01:54 PM

Ok sorry I don't know very much about this tool but perhaps there is someone here that does. Thanks.

 

Thanks anyways.

 

Hoping @atrpm sees this...



#12 atrpm OFFLINE  

atrpm

    Advanced Member

  • Members
  • 32 posts
  • Local time: 07:12 AM

Posted 05 October 2019 - 09:38 PM

Thanks anyways.

 

Hoping @atrpm sees this...

 

The google drive id (as google calls it in its API documentation) is the folder ID where your media is store at. The way that I found mine was from the URL, after the folder path ex. https://drive.google...drive/folders/drive-id-should-be-here. So, if you go into the folder from your web browser you should be able to find it.

 

Also, I just push so bug fixes so make sure to get the latest code.



#13 atrpm OFFLINE  

atrpm

    Advanced Member

  • Members
  • 32 posts
  • Local time: 07:12 AM

Posted 05 October 2019 - 09:39 PM

Here is a great example. https://ploi.io/docu...drive-folder-id







Also tagged with one or more of these keywords: GDrive, Autoscan, Scan, Google, Drive

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users