Here are the docs:
FetchContent(*args, **kwargs)
Download file’s content from download_url.
Raises:
ApiRequestError, FileNotUploadedError, FileNotDownloadableError
I tried supplying GoogleDriveFile.metadata['selfLInk']
and it didn't work.... there also a GoogleDriveFile.get method
which has 1 argument (i got from errors) I have no idea what that argument is or what it does.. Also GoogleDriveFile.content
is none
Just trying to do this:
data=GoogleDriveFile.getcontent()
z=data.read(1024)
while z:
newdata=do stuff(z)
localfile.write(newdata)
z=data.read(1024)
z.close()
localfile.close()
I think pydrive uses the v2 api, I tried doing something liek this: https://youtu.be/-7YH6rdR-tk?t=573 How do I implement that with pydrive? you can see the data part where he writes data to local file.
drive=login()#
z=drive
an='file.ext' #set permission to anyoen with link cna download
zz = z.ListFile({'q': "'root' in parents and trashed=false"}).GetList()
for f in zz:
if f['title']==an:
ww=f.metadata['downloadUrl']
print ww
print dir(f.FetchContent(ww))
break
import sys
sys.exit()
['__class__', '__delattr__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__']