Closed djay closed 2 years ago
I will get to this on the weekend... 🙂
Since there is talk of a refactor, I would like to make a note that this is the kind of task that would be make more comfortable for the dev if there were unit tests to back up what he was trying to do... 🙂
As you suspected @djay , changing from a webdav API to the official Google Drive API requires use to use a GCP project with the Drive API enabled. While I don't expect our volume of usage to incur any cost (if it does I'll be happy to pay reasonable fees myself), it does mean we need to create a profile with the appropriate ownership for this project. I think you should own the profile used in this case, don't you agree? If so, please create the needed profile and either setup Drive API access or just share the credentials with me via Discord DM and I'll setup the rest. If you don't care who owns it, then I'll be happy to create the account myself and then just pass the credentials along to you once it's all setup... Thanks! 🙂
For now I've just gone ahead and created a new Google developer project under my own account to create API access. 🙂
seems it needs any any key only https://stackoverflow.com/questions/47041929/does-google-drive-api-allow-us-to-download-public-file-without-authentication
@reduxionist actually it doesn't need any api key. you can browse and download in an anonymous session so I'm sure there is a way with no account or at the very least any api key - https://stackoverflow.com/questions/18116152/how-do-i-get-a-file-list-for-a-google-drive-public-hosted-folder
@djay That's great if you enjoy spelunking and figuring things out on your own; I was following the instructions in Google's documentation which very much wants you to use an API key. I think we have different ways of learning new things. In any case, that link you posted still requires you to generate an API key in exactly the same manner I just said I did.
Also, yes, I'm sure we could scrape and download the files anonymously without an API key -- but then we'd be scraping again and at the mercy of random changes in wording or layout of links, whereas by using the API method we're (somewhat) protected from such changes as they at least have to announce that they're making breaking changes to their API when they do so.
@reduxionist but no paymet required and switch the api key anytime
Right I didn't make any payment, and switching the API is the same -- you're still doing it under an account -- I only asked whether you wanted to the account to be yours or mine. It's not "any api key" as in an anonymous API key, just because the resource is anonymous does not mean the API key doesn't still have to belong to someone...
Sure. Once it's working I'll switch it to mine
Will do this
fixed in #171
Links are on https://www3.dmsc.moph.go.th/
Drive location is https://drive.google.com/drive/folders/1yUVwstf5CmdvBVtKBs0uReV0BTbjQYlT
Looks like the reports are the same so should be just a matter of switching out the nextcloud webdav code for google drive api code and ensuring the files are returned latest first.