Copy PDF file from Google drive to remote server - google-drive-api

I've built nice browsing window which shows all of the pdf files on my (or any user) Google Drive for managing purposes.
What i looking to do is simple, i want to take a pdf file from my google drive (i have all the info related to this file - "downloadUrl","webContentLink" etc) and just copy it to my server (remote).
Any thoughts?

I guess I'm pretty late here, but this may help other people too.
You could try using Grive. Here's a straightforward tutorial: http://xmodulo.com/2013/05/how-to-sync-google-drive-from-the-command-line-on-linux.html
Even if you don't have root access on the server, you can simply build from source, and:
$ mkdir ~/google_drive
$ cd ~/google_drive
$ grive -a
You'll receive an auth URL which you need to paste on your browser and click on "Allow Access" and you're done. Go to the google_drive dir on your server and run grive to sync between your local dir and your GDrive.

Related

How do I access my Google Drive (G: ) Windows Mount from the Windows Subsystem for Linux (WSL)?

I'm working on a project that I have stored on my Google Drive mount on Windows, and I would like to use Linux for portions of that project. The Windows Subsystem for Linux has served me well for most of my projects, but I've never had the need to mount a network drive. While it's not imperative that I use my Google Drive mount for this project (I could easily place it in my /downloads or /documents folder), I was curious as to how I could access my Google Drive from WSL.
I attempted to create a new mount via:
sudo mkdir /mnt/googledrive
This successfully created the directory, and then I used the command:
sudo mount -t drvfs G: /mnt/googledrive
This too seemed to be successful.
I was able cd to the /mnt/googledrive directory, but I couldn't access any of my files (it reported the '.' location was unavailable).
Perhaps I've simply misunderstood what I was doing?
Any help would be greatly appreciated!
I found a workaround, not using the "Google Drive" application but the "Backup and Sync" for individuals (https://www.google.com/drive/download/).
Basicaly it's doing the same for me but in a different way. Backup and Sync will permit you to backup your drive to Google but also Sync your Google Drive localy.
By choosing to sync your drive localy, you can even select some folders, the files are sync to the "C" drive under your user profile at the same level of your "My Documents" folder.
Using that way, you can access your files from your linux with the working /mnt/c/... link.
If that answer is too late for you, might be still in time for others ;-)

How to download or list all files on a website directory

I have a pdf link like www.xxx.org/content/a.pdf, and I know that there are many pdf files in www.xxx.org/content/ directory but I don't have the filename list. And When I access www.xxx.org/content/ using browser, it will redirect to www.xxx.org/home.html.
I tried to use wget like "wget -c -r -np -nd --accept=pdf -U NoSuchBrowser/1.0 www.xxx.org/content", but it returns nothing.
So does any know how to download or list all the files in www.xxx.org/content/ directory?
If the site www.xxx.org blocks the listing of files in HTACCESS, you can't do it.
Try to use File Transfer Protocol with FTP path you can download and access all the files from the server. Get the absolute path of of the same URL "www.xxx.org/content/" and create a small utility of ftp server and get the work done.
WARNING: This may be illegal without permission from the website owner. Get permission from the web site first before using a tool like this on a web site. This can create a Denial of Service (DoS) on a web site if not properly configured (or if not able to handle your requests). It can also cost the web site owner money if they have to pay for bandwidth.
You can use tools like dirb or dirbuster to search a web site for folders/files using a wordlist. You can get a wordlist file by searching for a "dictionary file" online.
http://dirb.sourceforge.net/
https://sectools.org/tool/dirbuster/

Install Google Drive in localhost directory

I use Xampp for localhost. I would like to have my files on localhost synced on different computers. I figure that I could just install Google Drive inte the Xampp directory eg. "localhost/Google Drive" (of course I will have to do this on all computers).
Before I do so I wonder if there would be any disadvantages doing so?
Also I wonder how to get "localhost/Google Drive/some-website/index.php" to work (note the space in "Google Drive")?
The best way to do this is to use a local service that calls your google drive files by url, check the google drive documentation so you can do this integration.
Couldn't wait.
Works like a CHARM! Did not experience any disadvantages.
I solved the "Google Drive space problem" like this:
Quit Google Drive
Move the folder to your "htdocs" folder and rename the folder to eg. "google-drive" (my location and filename is "C:\xampp\htdocs\google-drive")
Restart Google Drive (it will say that folder could not be found)
Choose the option to relink to the new folder.
Since I installed the Google Drive folder in "C:\xampp\htdocs\google-drive" I have the option to work on localhost without syncing files eg. files in "C:\xampp\htdocs\my-uncynked-folder".

Download files from google drive via URL

We are planning on opening a company account on google drive which will be accessible to only company people.
The issue is we want to put several files on our drive and download them programatically. We tried using google drive APIs but the download speed it very low.
Then we also tried wget but that requires that all the files are made public which we cannot do.
Is there any way to use wget with credentials which will allow a file to be downloaded via an URL.
Our typical file size is 50GB.
There is actually a command from wget to specify user and password. Have you tried the following?
wget --user='username' --ask-'password' https://docs.google.com/'ItemType'/Export='DocumentId'

Syncing network folder with Google Drive

I am not a developer but was looking into google drive for my business. I asked if they could sync a folder on a networked extrnal harddrive. I was instructed to write an app. I run a business I am not a developer. Does anyone have any suggestions?
You can try something like gdrive_sync
You don't have to write any code but you will need to install python, download this program, and do some typing in a command line window.
After you download and install python... download gdrive_sync and extract it to a directory with 7zip. Then open a command line and go to the directory you extracted to and type
setup.py install
to install the program. Then follow the instructions under the "Usage" section of the link above to synchronize your drives with google drive. It's a powerful and free way to use google drive if you are willing to spend a bit of time on it.