Jump to content


Photo

GDrive - emby_autoscan

GDrive Autoscan Scan Google Drive

  • Please log in to reply
54 replies to this topic

#41 M3th0s OFFLINE  

M3th0s

    Advanced Member

  • Members
  • 103 posts
  • Local time: 11:51 PM

Posted 10 March 2020 - 03:26 AM

Hello again

Finally managed to get this working. I've also go the latest changes to your code just to be on the safe side.

My filter date wise is from yesterday morning however I'm just getting a load of "no changes found, moving along"

Anyway I can fix this?

Thanks in advance!



#42 atrpm OFFLINE  

atrpm

    Advanced Member

  • Members
  • 66 posts
  • Local time: 07:51 PM

Posted 10 March 2020 - 08:06 AM

Hello again
Finally managed to get this working. I've also go the latest changes to your code just to be on the safe side.
My filter date wise is from yesterday morning however I'm just getting a load of "no changes found, moving along"
Anyway I can fix this?
Thanks in advance!


The script has to start getting changes from the creation date of the drive and it will eventually get caught up and start reporting changes. You can see the token getting updated on each trip.

If the drive was created in 2018 it starts getting changes from 2018, it will ignore those changes and move along until the date on the changes is after the filter you set.

There is no way to just start at the desired date from the first time you run the script.
  • M3th0s likes this

#43 M3th0s OFFLINE  

M3th0s

    Advanced Member

  • Members
  • 103 posts
  • Local time: 11:51 PM

Posted 10 March 2020 - 08:08 AM

The script has to start getting changes from the creation date of the drive and it will eventually get caught up and start reporting changes. You can see the token getting updated on each trip.

If the drive was created in 2018 it starts getting changes from 2018, it will ignore those changes and move along until the date on the changes is after the filter you set.

There is no way to just start at the desired date from the first time you run the script.

Beautiful so working as expected :)

 

 

So just to clarify, this will detect any changes and using emby's API pass the specific path to emby scanner. Emby will then scan that specific path and not the whole thing correct?

 

Also if you have any knowledge of linux, do you have any idea how I'd go about creating this as a startup process?

 

Thanks again for all your help!



#44 tattoomees OFFLINE  

tattoomees

    Advanced Member

  • Members
  • 47 posts
  • Local time: 11:51 PM

Posted 10 March 2020 - 08:09 AM

after reinstall , i cant get app verified always going to 

This site can’t be reached

localhost refused to connect.

http://localhost:37973/

 

nevermind i had change it to headless


Edited by tattoomees, 10 March 2020 - 08:18 AM.


#45 tattoomees OFFLINE  

tattoomees

    Advanced Member

  • Members
  • 47 posts
  • Local time: 11:51 PM

Posted 10 March 2020 - 09:10 AM

still the same i moved folder to it and Current token: 567782

No changes found.
Finished scanning for: 0AJjmj8NqU0_bUk9PVA. Took 0secs


#46 atrpm OFFLINE  

atrpm

    Advanced Member

  • Members
  • 66 posts
  • Local time: 07:51 PM

Posted 10 March 2020 - 09:12 AM


still the same i moved folder to it and Current token: 567782
No changes found.
Finished scanning for: 0AJjmj8NqU0_bUk9PVA. Took 0secs


I don’t think you have the latest changes, on the new directory, did you do a git clone?

#47 tattoomees OFFLINE  

tattoomees

    Advanced Member

  • Members
  • 47 posts
  • Local time: 11:51 PM

Posted 10 March 2020 - 11:52 AM

i removed completely old folder and git clone new made changes on config file and result is the same . 



#48 tattoomees OFFLINE  

tattoomees

    Advanced Member

  • Members
  • 47 posts
  • Local time: 11:51 PM

Posted 10 March 2020 - 12:05 PM

Can you put here output what you get ?



#49 M3th0s OFFLINE  

M3th0s

    Advanced Member

  • Members
  • 103 posts
  • Local time: 11:51 PM

Posted 10 March 2020 - 06:49 PM

Yeah I'm having the same issue. 

It will get to the end and won't do anything.

 

Will post output in a sec, as trying a second time just in case.

 

Output:

Issue while trying to retrive changes for drive: 0AAH4-DGT097sUk9PVA. Error: maximum recursion depth exceeded
Trying again, retry # 1
Traceback (most recent call last):
  File "scan.py", line 49, in <module>
    main()
  File "scan.py", line 25, in main
    embyUpdates, nextPageToken, error = getChanges(driveConfig, currentPageToken, generalConfig['headless'])
  File "/opt/emby_gdrive_autoscan/googleDriveService.py", line 203, in getChanges
    getChanges(config, nextPageToken, headless)
  File "/opt/emby_gdrive_autoscan/googleDriveService.py", line 203, in getChanges
    getChanges(config, nextPageToken, headless)
  File "/opt/emby_gdrive_autoscan/googleDriveService.py", line 203, in getChanges
    getChanges(config, nextPageToken, headless)
  [Previous line repeated 950 more times]
  File "/opt/emby_gdrive_autoscan/googleDriveService.py", line 181, in getChanges
    changes = response.get('changes')
AttributeError: 'NoneType' object has no attribute 'get'

Edited by M3th0s, 10 March 2020 - 06:51 PM.


#50 M3th0s OFFLINE  

M3th0s

    Advanced Member

  • Members
  • 103 posts
  • Local time: 11:51 PM

Posted 14 March 2020 - 01:52 PM

Thought I'd leave my findings here in case anyone finds themselves with the same problem.

 

Please bear in mind this applies to an rclone_vfs mount. My scan times are now anywhere between 10-20 mins for a full library scan. The library is around 700TB.

 

I've made some changes to my rclone mount service file and my scan time is down to 15-20 mins from 11 hours!

The flags that you're interested in are

 

--poll-interval=1m

--dir-cache-time 1000h

 

Poll interval does that it says. Scans the locations for changes and flags them in the cache. The cache is now enlarged, due to the other flag. Emby has no issues scanning this and is quite fast at it

 

Hope this helps!



#51 tattoomees OFFLINE  

tattoomees

    Advanced Member

  • Members
  • 47 posts
  • Local time: 11:51 PM

Posted 14 March 2020 - 01:56 PM

Hi can u show how's your config is ? Mine is still not find new files or folders:(

#52 M3th0s OFFLINE  

M3th0s

    Advanced Member

  • Members
  • 103 posts
  • Local time: 11:51 PM

Posted 14 March 2020 - 01:58 PM

These are the flags I use together with my service rclone mount:

--allow-other --fast-list --uid=1000 --gid=1000 --umask 002 --timeout 1h --transfers=16 --checkers=8 --tpslimit 10 --max-read-ahead=256M --poll-interval=1m --dir-cache-time 1000h --vfs-cache-mode writes --vfs-cache-max-age 1h --vfs-read-chunk-size-limit 2048M  --vfs-read-chunk-size 64M --buffer-size 64M

 

Do be sure you're using an rclone vfs mount.



#53 saitoh183 OFFLINE  

saitoh183

    Advanced Member

  • Members
  • 1000 posts
  • Local time: 06:51 PM
  • LocationCanada, St-Eustache, QC

Posted 14 March 2020 - 03:26 PM

I'm still trying to get this to work but the Gdrive Id keeps saying it is wrong. I have tried the ID for my video folder that you find in the url and I have tried the Gdrive ID itself. I'm not using a team drive, it's a gsuite drive.

#54 M3th0s OFFLINE  

M3th0s

    Advanced Member

  • Members
  • 103 posts
  • Local time: 11:51 PM

Posted 14 March 2020 - 03:27 PM

I gave up on the python script, doesn’t seem to work.

#55 Visorak OFFLINE  

Visorak

    Newbie

  • Members
  • 1 posts
  • Local time: 11:51 PM

Posted 29 March 2020 - 03:08 PM

1. So I was wondering if you can utilize service accounts with this or not?

2. I finally got it working I think but ran into this error:
 

Issue while trying to retrive changes for drive: REDACTED. Error: maximum recursion depth exceeded
Trying again, retry # 1
Traceback (most recent call last):
  File "scan.py", line 49, in <module>
    main()
  File "scan.py", line 25, in main
    embyUpdates, nextPageToken, error = getChanges(driveConfig, currentPageToken, generalConfig['headless'])
  File "/opt/emby_gdrive_autoscan/googleDriveService.py", line 203, in getChanges
    getChanges(config, nextPageToken, headless)
  File "/opt/emby_gdrive_autoscan/googleDriveService.py", line 203, in getChanges
    getChanges(config, nextPageToken, headless)
  File "/opt/emby_gdrive_autoscan/googleDriveService.py", line 203, in getChanges
    getChanges(config, nextPageToken, headless)
  [Previous line repeated 950 more times]
  File "/opt/emby_gdrive_autoscan/googleDriveService.py", line 181, in getChanges
    changes = response.get('changes')
AttributeError: 'NoneType' object has no attribute 'get'

All I did was take the last known token and input into the config file and had it start from there to restart it. But I don't know if this is an issue or if something is wrong on my end.







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