GithubHelp home page GithubHelp logo

data-horde / gdrivac Goto Github PK

View Code? Open in Web Editor NEW
11.0 11.0 1.0 285 KB

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

Python 100.00%
google google-account google-drive link-rot

gdrivac's People

Contributors

madprogramer avatar pyxia-code avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

pyxia-code

gdrivac's Issues

Scanned URL Retention

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?

Requesting the gdrive url might NOT be enough

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.

Google Session Key/Value Format

To "simulate" a log-in to a Google account, it's possible to use 3 session keys:

  • SID
  • SSID
  • HSID

The following is my current understanding of the format the values for these come in:

  • SID: 70 alphanumeric upper and lower case characters, with dashes in between followed by a final . That's 71 characters in total.
  • SSID: 17 alphabetic upper and lower case characters
  • HSID: 17 alphanumeric upper and lower case characters, with underscores.

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.

Requirements error

I have a MacBook Pro with macOS Catalina (10.15.7) and one module for the script wasn't in the requirements:

  • colorama
    After I installed, the help command worked.
    Could you please add it to the requirements file ?

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.

"Touching" Files

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.

Less Lazy isAccessed and askingForAccount conditions

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.