This fork is modified for Emby server. It allows Emby clients get videos and subtitles from CloudFlare Worker instead of Emby server.
- You should add your domain to CloudFlare.
- Set the domain name of your Emby server to proxied.
Transcode will not work when enabled.
- Install rclone
- Setup your Google Drive: https://rclone.org/drive/
- Run
rclone config fileto find yourrclone.conflocation - Find
refresh_tokenin yourrclone.conf, androot_folder_idtoo(optionally). - Copy the content of worker/dist/worker.js to CloudFlare Workers.
- Fill
refresh_token,root_folder_idand other options on the top of the script. - Set
emby_redirecttoture, and fill the url of your Emby server inemby_server. - Deploy!
- Add the following URLs to Routes of the CloudFlare Worker you deploy in the last step.
REPLACE_WITH_YOUR_EMBY_SERVER_URL/videos/*
REPLACE_WITH_YOUR_EMBY_SERVER_URL/Videos/*
REPLACE_WITH_YOUR_EMBY_SERVER_URL/emby/Videos/*
REPLACE_WITH_YOUR_EMBY_SERVER_URL/emby/videos/*
- Fill path mappings in
path_match:
path_match: {
'EMBY_SERVER_PATH_0': 'GDINDEX_PATH_0',
'EMBY_SERVER_PATH_1': 'GDINDEX_PATH_1',
},
For example, GDIndex can access a file at https://xxx.123.workers.dev/Mediafile/Movie/title/filename.mkv, the Emby can access with the same file at /mnt/external/Movie/title/filename.mkv. The path_match field should be:
path_match: {
'/mnt/external': '/Mediafile',
},
- Create a service account, a corresponding service account key, and get the JSON from the Google Cloud Platform console
- In the props object, replace the
service_account_jsonvalue with the contents of the service account JSON file and setservice_accounttotrue. - Make sure that the service account in question has access to the folder specified in
root_folder_id - Deploy
This mode will serve a simple nginx-like directory listing, and it only work with one drive. upload will be ignored in this mode.
On the top of the script, change lite: false into lite: true, than thats all.
To enable on-the-fly lite mode, especially with command-line applications, you can include a HTTP header x-lite: true in your requests.
