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

pacman::p_load(tidyverse, googledrive, glue)

drive_auth()

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

3. List files in the google drive directory

drive_ls(files_330a)  %>%
  select(name, id)
# A tibble: 78 x 2
   name                  id                                          
   <chr>                 <chr>                                       
 1 4-eps.mp4             10RAJOk8wc6n3WENrsvSZF6KsmQRxEiRq           
 2 4-change-estimate.mp4 10F14Om7eL4UM4sjP4c_gZ2krqYonmpP_           
 3 2-acct-cycle-p2.mp4   1-LVQFNskadqeHM9c-Y_hcjWqsQknW56s           
 4 2-acct-cycle-p1.mp4   1-IReFvCYDMOuu0cuze6SSAezuCiKJSwq           
 5 3-acct-cycle-p1.mp4   1-dwiKWSXC6PQIiVgc2NVF-3Zi0h_-dTM           
 6 0-welcome-p2.mp4      10vcJerqjZIDsj0DHSE6kb_vJt0yMdntJ           
 7 0-welcome-p1.mp4      1eyxPjAujqzKolCzn5Cd_0-3jwJvUhccO           
 8 0-welcome-p2-script   17QiIjihUrSCuECf4ROMWqJQGYzBcJ_mf5n_iVU8uDNc
 9 0-welcome-p1.mp4      1ErU_Up0xvWQ0AkMsteDtMCuuZ9woPBg1           
10 0-welcome-p1-script   1rf6KWRjLHXDcY0EjHuE512wwouHXfFqhJLbDGUHRe54
# … with 68 more rows

4. Change permissions of files in directory to Sonoma State

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

5. Compile list of urls to upload to LMS

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.