Use the R package googledrive

tidyverse googledrive glue

to create a list of urls

I needed to migrate videos from Vimeo to Google drive. I had created all the screencasts using Screenflow. The source files were in directories according to course.

Steps

1. Use batch export in Screenflow to move your videos to your Google drive.

2. Load packages and get files on google directory

show
pacman::p_load(tidyverse, googledrive, glue)

drive_auth()

files_330a  <- drive_get("~/screencasts/330A")

3. List files in the google drive directory

show
drive_ls(files_330a)  %>%
  select(name, id)
# A tibble: 78 x 2
   name                id                                          
   <chr>               <chr>                                       
 1 0-welcome-p2.mp4    10vcJerqjZIDsj0DHSE6kb_vJt0yMdntJ           
 2 0-welcome-p1.mp4    1eyxPjAujqzKolCzn5Cd_0-3jwJvUhccO           
 3 0-welcome-p2-script 17QiIjihUrSCuECf4ROMWqJQGYzBcJ_mf5n_iVU8uDNc
 4 0-welcome-p1.mp4    1ErU_Up0xvWQ0AkMsteDtMCuuZ9woPBg1           
 5 0-welcome-p1-script 1rf6KWRjLHXDcY0EjHuE512wwouHXfFqhJLbDGUHRe54
 6 0-welcome-p2.mp4    1ASoRZlEbNxPMZpnTUQlncZF1JWTamyVV           
 7 2-acct-cycle-p1.mp4 1-IReFvCYDMOuu0cuze6SSAezuCiKJSwq           
 8 2-acct-cycle-p2.mp4 1-LVQFNskadqeHM9c-Y_hcjWqsQknW56s           
 9 1-fb.mp4            1HbdPlashijYJZ7b0aZhQWkOpYWLJdpRZ           
10 1-fb-cashflow.mp4   1CEM51-KtFQu5G2pzKX-bEqcxc1-jGuCd           
# … with 68 more rows

4. Change permissions of files in directory to Sonoma State

show
files_330a  %>% 
  drive_share(role = "reader", type = "domain", domain = "sonoma.edu")

5. Compile list of urls to upload to LMS

show
drive_ls(files_330a)  %>%
  select(name, id)  %>%
  mutate(url = glue("https://drive.google.com/file/d/{id}/view?usp=sharing"))  %>%
  arrange(name)  %>%
  select(name, url)  
# A tibble: 78 x 2
   name             url                                               
   <chr>            <glue>                                            
 1 0-asc-logon.mp4  https://drive.google.com/file/d/1qRRp3OyqNnY8uICm…
 2 0-welcome-p1-sc… https://drive.google.com/file/d/1rf6KWRjLHXDcY0Ej…
 3 0-welcome-p1.mp4 https://drive.google.com/file/d/1eyxPjAujqzKolCzn…
 4 0-welcome-p1.mp4 https://drive.google.com/file/d/1ErU_Up0xvWQ0AkMs…
 5 0-welcome-p2-sc… https://drive.google.com/file/d/17QiIjihUrSCuECf4…
 6 0-welcome-p2.mp4 https://drive.google.com/file/d/10vcJerqjZIDsj0DH…
 7 0-welcome-p2.mp4 https://drive.google.com/file/d/1ASoRZlEbNxPMZpnT…
 8 1-concept.mp4    https://drive.google.com/file/d/1-7Vl4k0Ui0I5kwEI…
 9 1-fb-cashflow.m… https://drive.google.com/file/d/1CEM51-KtFQu5G2pz…
10 1-fb.mp4         https://drive.google.com/file/d/1HbdPlashijYJZ7b0…
# … with 68 more rows

6. Write output to a csv file

and perform tedious task of updating each link.