Advertisement
kohpriwniranam

googledrive

Jan 25th, 2024
2,171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.38 KB | None | 0 0
  1. from googledriver import download
  2.  
  3. URL = 'https://drive.google.com/file/d/xxxxxxxxx/view?usp=share_link'
  4. download(URL, './model/tf_gpt2_model')
  5.  
  6.  
  7. from googledriver import download
  8.  
  9. URL = 'https://drive.google.com/file/d/xxxxxxxxx/view?usp=share_link'
  10. cached_path = download(URL, None, 'tf_model')
  11.  
  12. Installation
  13. pip install googledriver
  14.  
  15. Features
  16. 1. File Download
  17. Download to specific path
  18. from googledriver import download
  19. URL = 'https://drive.google.com/file/d/xxxxxxxxx/view?usp=share_link'
  20. download(URL, './model/tf_gpt2_model')
  21.  
  22. Download to cached folder
  23. To download a cached file (or directory) from a URL and return its path, you can use the following method.
  24.  
  25. from googledriver import download
  26. URL = 'https://drive.google.com/file/d/xxxxxxxxx/view?usp=share_link'
  27. cached_path = download(URL, None, 'tf_model')
  28.  
  29. #=============================================================#
  30.  
  31. 2. Folder Download
  32.  
  33. from googledriver import download_folder
  34. URL = 'https://drive.google.com/file/d/xxxxxxxxx/view?usp=share_link'
  35. download_folder(URL)
  36.  
  37.  
  38. from googledriver import download_folder
  39. URL = 'https://drive.google.com/file/d/xxxxxxxxx/view?usp=share_link'
  40. save_folder = './any/path/to/save/'
  41. download_folder(URL, save_folder)
  42.  
  43.  
  44. from googledriver import download_folder
  45. URL = 'https://drive.google.com/file/d/xxxxxxxxx/view?usp=share_link'
  46. download_folder(URL, cached=True)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement