Closed MarionBWeinzierl closed 4 years ago
Is there any way we can list all the files from dropbox and put them in a dropdown box? (See https://colab.research.google.com/notebooks/forms.ipynb)
I've just been playing with the API and it seems like we can list the files in the shared folder:
!rm -rf full_video.mp4
!pip install dropbox
import dropbox
dbx = dropbox.Dropbox('sl.AbLLnqb_KxyrxnU5hN3UMD1PtuAEe7B2PvjA3SLrnpVYLGuTcxmWlI8V-tzQWwKllHS9Mj0HMFKq3139-y_S_YL8G4KHpzpeCm4A21uBZ8eGewIlwzUW6-k1_6p7mmKl54lcSDjS')
shared_link = dropbox.files.SharedLink(url='https://www.dropbox.com/sh/fcbe7ebrvuutfgh/AACAe78sSZRMjFhJQAq1wM-Ra?dl=0')
print(dbx.files_list_folder(path="", shared_link=shared_link))
print(dbx.files_list_folder(path="/Apoorva_experiment_clips", shared_link=shared_link))
But I can't figure out how to get a single item from the info returned.
If that isn't possible, or will take too long, maybe we can leave the code as it is, but include clear instructions to the user where to get the link, and (again, if time allows) have it as an input box rather than modifying the code?
I added a field to put in the link, and some description how to get it.
When I tried your code snipped it didn't work and said something about authentication token no longer valid -- not sure authentication for what? Anyways, as we don't know at this point how they want to process data and whether, for example, they want to loop over a folder or only want to look at a single video, and whether they load the videos usually from Dropbox or from their computer. maybe we shouldn't put too much time into this now. We can always come back to it later.
See #2 . I am not totally happy with having to find the right links first, but or now it works. Let me know if you have any good ideas for this, though.