This is based on the following page.
By writing the following code, you can get a Google Drive folder ID from a path.
# ドライブのマウント
from google.colab import drive
drive.mount('/content/drive')
# koraのインストール
!pip install kora
from kora.xattr import get_id
# 例)マイドライブへのidを取得する
path = "/content/drive/MyDrive"
fid = get_id(path)
print("https://drive.google.com/drive/u/1/folders/{}".format(fid))
You can also try it from the following notebook. I hope you find this helpful.