data-horde / gdrivac Goto Github PK
View Code? Open in Web Editor NEWA script for immunizing a google account for the effects of 13 September which will break some Google Drive Links
License: Creative Commons Zero v1.0 Universal
A script for immunizing a google account for the effects of 13 September which will break some Google Drive Links
License: Creative Commons Zero v1.0 Universal
Saving accessed URLs is a good way to reduce duplicates on one hand, but on the other it increases the memory burden significantly. What to do?
After running this program on my list of links only a very small amount (only 3 google docs files) were added to the recent tab on google drive. I experimented a bit with gdrive and to add a file to the recent tab I had to send a http put request to
https://clients6.google.com/drive/v2internal/files/{FILE_ID}?fields=id%2Ckind,lastViewedByMeDate&modifiedDateBehavior=NO_CHANGE&supportsTeamDrives=true&enforceSingleParent=true&key={SOME_KEY}
with the additional SAPISID and APISID cookies, and the Authorization and Origin headers. This method seems to work with files, I haven't tested it on folders.
To "simulate" a log-in to a Google account, it's possible to use 3 session keys:
The following is my current understanding of the format the values for these come in:
If these are correct, I will update the interactive instructions to describe the shape of the values for these cookies, and later also add in a session-cookie shape checker, to make sure cookies are valid.
Until then, the DoAError
exception can be used to validate cookies. A DoAError
(Denial of Access Error) is raised when invalid cookie values are used to access a private file.
I have a MacBook Pro with macOS Catalina (10.15.7) and one module for the script wasn't in the requirements:
PS: On macOS python and python3 are two separated commands and not using python3 would bring other errors, so it would be better if you write this as an observation in the readme.
Session cookies appear sufficient to access files, my testing on private files has revealed.
What is confusing, however, is that files accessed by gdrivac are not added into "Recent" or "Shared with me" on Google Drive. Would sleeping resolve this? Further investigation is needed.
The current isAccessed and askingForAccount conditions are very easy to dupe, perhaps also passing the URL and checking if the domain is drive.google.com might be a good idea.
docs.google.com etc. would need warnings, since they are not at risk of link rot and also because they would break any "drive.google.com" checking pattern.
Elaboration needed on the lines:
If you have worked with session cookies before, this tutorial might serve as a nice reference https://github.com/Data-Horde/ytcc-archive/wiki/Setup-Tutorial
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.