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
- 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:
- 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.
- 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.
- 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:
- 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.
- 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.
- 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.
- Lastly, wait for the notebook to upload the file...
- After a few seconds (depending on your file size), it will finish uploading, by showing Video id "xxxx" was successfully uploaded.
- We're done. That's it. You can check your YouTube Studio if the video is uploaded already with the same URL ID.
- First, with your secret JSON key.
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:
- video_dir, means you need to copy the "path" toward where your video(s) are located on Google Drive.
- video_urls_file, for this, I copied the path to one of the videos in the folder. So...
- youtube_secret, means you need to copy the path to your json secret key.
But as the previous one, it's still not working functionally. So... It's useless in the end...
End Product
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.