Question about Google Drive to Youtube Uploader - Thumbnail.
Question about Google Drive to Youtube Uploader - Thumbnail.

TL;DR

Practically, Yes. You can upload to YouTube from Google Drive, using Google Colab, but it's not gonna work functionally, as it's not gonna viewable by public,

This article is written in English.

Brief Warning


Notice

  • This post intended to show how using Google Colab supposedly could be useful for good, but probably shutted down by YouTube due to its possibility to be abused by others.
  • This post is not to encourage others to abuse the system, as I thought this system could be useful, especially as it seems more efficient as everything is already in the cloud (Google Workspace), rather than doing much work by upload-download-reuploading things again.
  • This probably has the same workaround as the mirroring system implemented by others such as MultiUp.org.
  • This article is written based on my understanding only, as I have zero to little knowledge on Python topics.


Introduction

Why do I need to solve these problems?

  • Need to post some videos to my YouTube channel.
  • The video itself is already available on Google Drive.
  • Each size is also quite big, ranging from 600 MB to 2.2 GB.
  • Uploading remotely from Google Drive seems more efficient, rather than re-downloading each locally, then re-uploading everything manually to YouTube.


Application/Workaround

YouTube™ Uploader for Dropbox, Drive

At first, I tried this Google Workspace App, named YouTube™ Uploader for Dropbox, Drive. This app has a size limit around 1024 GB (if I understand correctly, as they said it's 1~Hundreds of MB or GB). So, as the videos that I have range from 600 MB to 2.2 GB, I tried using the 2.2 GB first, but it's not working, and showed an error. Then I tried the 600 MB one, but it also showed the same message.

I give up then. I need to find another solution.

youtube-up by agent87 on github

So, I found a solution in github, a repository named youtube-up, entitled Directly upload media from Google drive to Youtube using google colab, by agent87. It seems like it's actually easier to apply and learn. Thus, steps that I did was:

  1. Set-Up Things on Google Cloud Platform.
    • Create a new project.
    • Enable the YouTube Data API v3.
    • Create OAuth Consent Screen. Then Publish the App.
    • Create OAuth (2.0) Client ID. Make sure that the Application type is Desktop app.
    • Download JSON Secret Key. This is needed for later.
  2. Prepare things on Google Drive.
    • Upload the JSON Secret Key file to Google Drive. Place it on the root to make it easier to access later on.
    • Make sure that the video you wanted to upload is already on "your drive". If it's shared from others, copy the file first to your drive, and delete it later after you are done to save storage.
  3. Time to Work in Google Colab.
    • Create a new notebook. This will create a new Jupyter notebook to be used for. Rename it if needed.
    • Create a new code line, then paste this first line, to clone the git to our notebook from github.
      !git clone https://github.com/agent87/youtube_uploader.git
    • Now, press Ctrl + Enter to start the process then. After a few seconds, the notebook then will start the process by Connecting -> Initializing -> Connected, then start processing the code-line. After the process is finished, a green checkmark will be shown later on the left side.
    • Mount Google Drive, to use it as a repository (?) for taking out files that we needed later on.
    • Create another new code-line, and paste this line.
      !cd youtube_uploader
    • Press Ctrl + Enter to start the process.
    • Next, create another new code-line, and paste this line. This will install a youtube uploader python script (?), with it's dependence(s) (?) to our notebook.
      !python youtube_uploader/setup.py
    • Then, press Ctrl + Enter to start the process.
    • Last, to start uploading, create another new code-line, and paste this line.
      !python2 youtube_uploader/upload.py
    • Press Ctrl + Enter to start the process.
    • Next, fill the area with following items:
      1. First, with your secret JSON key.
        • Open the Google Drive folder that we have mounted before.
        • Right-click your json file, and copy the path to this file.
        • Paste the path in the processing code-line.
        • Press enter after this.
      2. Next, select the video that you wanted to upload.
        • Open the Google Drive folder that we have mounted before.
        • Right-click the file, then copy the path to this file.
        • Paste the path in the processing code-line.
        • Press enter again to continue.
      3. Now, we need to authorize the application.
        • Click the URL on the code-line.
        • Select the channel that you wanted to upload to.
        • Click Advanced to continue.
        • Choose Go To "Your application name" (unsafe) to proceed.
        • Press continue.
        • Click the copy icon to copy the code.
        • Paste the code in the processing code-line.
        • Press enter to continue.
      4. Lastly, wait for the notebook to upload the file...
      5. After a few seconds (depending on your file size), it will finish uploading, by showing Video id "xxxx" was successfully uploaded.
      6. We're done. That's it. You can check your YouTube Studio if the video is uploaded already with the same URL ID.

At first, I felt happy, as it showed up as Processing... on the channel, as a sign that it's actually working as intended. But then... After inserting the metadata, and changing the Visibility option from Private to Public, it suddenly changed itself into Private (locked) with Terms and policies on the Restrictions tab. This means the video can only be viewed by myself, and no one else, which basically... unusable (unless you wanted to make your channel as an archive channel, which also not practical to do). So... I guess it's time to find another workaround.

Uploading-video-on-youtube by sandeepyadav1478 on github

Next, I found another repository on github, by sandeepyadav1478. Practically, it's the same step, as we already have a json secret key and prepared all needed files on Google Drive. The only difference is three things:

  1. video_dir, means you need to copy the "path" toward where your video(s) are located on Google Drive.
  2. video_urls_file, for this, I copied the path to one of the videos in the folder. So...
  3. youtube_secret, means you need to copy the path to your json secret key.
And that's it. After pressing Ctrl + Enter in the last code-line, the process will begin, and you just need to wait. But there's another difference. The previous repository needs us to upload each video, one by one. But this one, it will upload every video "in the folder". So you need to make sure that you choose the correct path.

But as the previous one, it's still not working functionally. So... It's useless in the end...

End Product

End Product of Trying to Upload Videos using Google Colab.
C. Videos that I uploaded manually; B. Videos that I uploaded using notebook by sandeepyadav1478; and A. Videos that I uploaded using notebook by agent87.

Why does this thing keep happening?

I wonder why you couldn't change the video into another Visibility option as it's uploaded already. After lurking around on the net, I found the answer. In short, it was due to our app that is not verified by Google. And the verification process will last for days too based on some comments... You can read more of it here: Using Youtube Data API makes my videos private on upload. Which means, yeah it's just not gonna work functionally.

Manually

In the end, due to none of these methods actually working, I ended up downloading all of these videos, then re-upload it again to the channel. And it's working, like how it is supposed to be.


Conclusion

Yes, it's just not working. The workaround does work, as each video is uploaded already on the channel. But functionally, none of these is viewable by the public. So it's no use then.