@DZMM Thanks a lot for all the info, I've set up the scripts and they work really well. I was surprised how few modifications were required to get things working.
Have a odd problem, wondering if anyone had encountered it. It's to do with Direct Play on Plex. Direct streaming on Plex works fine, either because the file is an MKV or if I turn off direct play in the app settings. However, when direct playing all that happens is a black screen with the loading icon. I've played with various settings on buffer and chunk size and limit. It makes no difference. The exact same files direct play when played locally through the exact same Plex server. In a nutshell, to play files from gdrive I have to direct stream. Any attempt to direct play them causes a black screen with infinite load. However, these same files direct play when accessed locally through that same Plex server. Client - Apple TV 4K , All files are formatted as MP4, with ac3 and mov_text - compatible with direct play.
Please let me know if anyone has encountered this or have found a solution. Thanks.