This is based on the following page.

https://stackoverflow.com/questions/67324695/is-there-a-way-to-get-the-id-of-a-google-drive-folder-from-the-path-using-colab

By writing the following code, you can get a Google Drive folder ID from a path.

#fd#!f#pfprrprairoikiotdimvopmhner=tg.aik=(omnog"oosr"ehguta/ttlna.c_tetlxoip.(landsc'tit(:o/ktdep/lcorna/aorttdbnai/hrtmd)iieprvmnoieptrv.o/tegrd/otrgMoieygdvtDlre_rei'ii.v)dvceeo"m/drive/u/1/folders/{}".format(fid))

You can also try it from the following notebook. I hope you find this helpful.

https://colab.research.google.com/github/nakamura196/ndl_ocr/blob/main/パスからGoogle_DriveのフォルダのIDを取得.ipynb