tattoomees 2 Posted March 9, 2020 Share Posted March 9, 2020 (edited) Sure, Are you using Windows or Linux? Linux How are you mounting the drive? (rclone or something else) rclone What is your mount point and or letter (if windows)? /mnt/unionfs Is this for a Team Drive (Shared Drive) or a Personal Drive? team drive Edited March 9, 2020 by tattoomees Link to comment Share on other sites More sharing options...
atrpm 3 Posted March 9, 2020 Author Share Posted March 9, 2020 Hello again I keep getting File "scan.py", line 19 print(f'Starting scan for: {drive.driveId}') ^ SyntaxError: invalid syntax Working on a headless machine, so changed that to true. Config json is there, but no dice. Any help appreciated Make sure you are using python 3 or above. Link to comment Share on other sites More sharing options...
tattoomees 2 Posted March 9, 2020 Share Posted March 9, 2020 atprm any ideas of getting sample config file please? Link to comment Share on other sites More sharing options...
M3th0s 14 Posted March 9, 2020 Share Posted March 9, 2020 (edited) Make sure you are using python 3 or above. I am definitely using python3 EDIT: Traceback (most recent call last): File "scan.py", line 1, in <module> from googleDriveService import getChanges File "/opt/emby_gdrive_autoscan/googleDriveService.py", line 4, in <module> from googleapiclient.discovery import build ModuleNotFoundError: No module named 'googleapiclient' Edited March 9, 2020 by M3th0s Link to comment Share on other sites More sharing options...
tattoomees 2 Posted March 9, 2020 Share Posted March 9, 2020 hi M3th0s did you installed requirements python3 -m pip install -r requirements.txt did u figured out config.json ? Link to comment Share on other sites More sharing options...
atrpm 3 Posted March 9, 2020 Author Share Posted March 9, 2020 Sure, Are you using Windows or Linux? Linux How are you mounting the drive? (rclone or something else) rclone What is your mount point and or letter (if windows)? /mnt/unionfs Is this for a Team Drive (Shared Drive) or a Personal Drive? team drive Here is a good example: { "general": { "scanIntervalMinutes": 3, "headless": true }, "drives": [ { "driveId": "0AAH4-DGT097sZZZZZZZZ", "currentPageToken": null, "pageSize": 100, "changesStartDate": "2020-03-09T00:00:00", "credentialsPath": "credentials.json", "includeItemsFromAllDrives": true, "supportsAllDrives": true, "includeRemoved": true, "physicalDriveMountLetter": "/mnt/unionfs", "mountPoint": null, "retries": 3 } ], "emby" : { "apiKey": "3509a0589231423ea896a3153ee44444", "ip": "localhost", "port": "8096", "protocol": "http", "retries": 3 } } Link to comment Share on other sites More sharing options...
atrpm 3 Posted March 9, 2020 Author Share Posted March 9, 2020 I am definitely using python3 EDIT: Traceback (most recent call last): File "scan.py", line 1, in <module> from googleDriveService import getChanges File "/opt/emby_gdrive_autoscan/googleDriveService.py", line 4, in <module> from googleapiclient.discovery import build ModuleNotFoundError: No module named 'googleapiclient' You need to install requirements: pip3 install -r requirements.txt Link to comment Share on other sites More sharing options...
tattoomees 2 Posted March 9, 2020 Share Posted March 9, 2020 thanks it scans but i moved folder to it and Current token: 567748 No changes found. any ideas ? Link to comment Share on other sites More sharing options...
atrpm 3 Posted March 9, 2020 Author Share Posted March 9, 2020 thanks it scans but i moved folder to it and Current token: 567748 No changes found. any ideas ? Is probably getting filter due to the changesStartDate settings. Also get the latest code, I fixed a bug related to that a few minutes ago. Link to comment Share on other sites More sharing options...
tattoomees 2 Posted March 9, 2020 Share Posted March 9, 2020 how i can get latest code ? via git update ? Link to comment Share on other sites More sharing options...
atrpm 3 Posted March 9, 2020 Author Share Posted March 9, 2020 how i can get latest code ? via git update ? Yes, google git pull. Link to comment Share on other sites More sharing options...
tattoomees 2 Posted March 9, 2020 Share Posted March 9, 2020 getting an error error: Your local changes to the following files would be overwritten by merge: config.json Link to comment Share on other sites More sharing options...
atrpm 3 Posted March 9, 2020 Author Share Posted March 9, 2020 getting an error error: Your local changes to the following files would be overwritten by merge: config.json Make a copy of your config.json file in another directory, use the git pull -f to force the update, copy the config.json back and you should be good to got. Link to comment Share on other sites More sharing options...
tattoomees 2 Posted March 9, 2020 Share Posted March 9, 2020 still same error when i run git pull -f Link to comment Share on other sites More sharing options...
atrpm 3 Posted March 10, 2020 Author Share Posted March 10, 2020 still same error when i run git pull -f Just clone the repo again, in a different directory Link to comment Share on other sites More sharing options...
M3th0s 14 Posted March 10, 2020 Share Posted March 10, 2020 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! Link to comment Share on other sites More sharing options...
atrpm 3 Posted March 10, 2020 Author Share Posted March 10, 2020 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. 1 Link to comment Share on other sites More sharing options...
M3th0s 14 Posted March 10, 2020 Share Posted March 10, 2020 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! Link to comment Share on other sites More sharing options...
tattoomees 2 Posted March 10, 2020 Share Posted March 10, 2020 (edited) 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 March 10, 2020 by tattoomees Link to comment Share on other sites More sharing options...
tattoomees 2 Posted March 10, 2020 Share Posted March 10, 2020 still the same i moved folder to it and Current token: 567782 No changes found. Finished scanning for: 0AJjmj8NqU0_bUk9PVA. Took 0secs Link to comment Share on other sites More sharing options...
atrpm 3 Posted March 10, 2020 Author Share Posted March 10, 2020 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? Link to comment Share on other sites More sharing options...
tattoomees 2 Posted March 10, 2020 Share Posted March 10, 2020 i removed completely old folder and git clone new made changes on config file and result is the same . Link to comment Share on other sites More sharing options...
tattoomees 2 Posted March 10, 2020 Share Posted March 10, 2020 Can you put here output what you get ? Link to comment Share on other sites More sharing options...
M3th0s 14 Posted March 10, 2020 Share Posted March 10, 2020 (edited) 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 March 10, 2020 by M3th0s Link to comment Share on other sites More sharing options...
M3th0s 14 Posted March 14, 2020 Share Posted March 14, 2020 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! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now