qinfengge

qinfengge

醉后不知天在水,满船清梦压星河
github
email
telegram

Build a low-cost personal film and television library using Alist and EMBY.

Actually, I have also written an article about Emby + Google Drive before, but times have changed.
Google Drive has almost banned educational and team drives, and the TOS has become stricter, making it more difficult to transfer files.
On the other hand, OneDrive does not have the transfer function, only local uploads are possible.

Until Aliyun Drive emerged as a strong competitor, with domestic optimization and an active community (referring to many Telegram sharing channels), coupled with the fact that Aliyun Drive OPEN has opened its API, making it almost perfect.

Without further ado, this blog post will guide you on how to use Alist to add Aliyun Drive, mount webdav with rclone, and use Emby to scrape resources from Aliyun Drive.

Installing Alist and Configuring Aliyun Drive#

The official documentation is already very detailed.
It is recommended to install using Docker.

After installation, use the following command to view the admin account password.

Access ip:5244 and log in with the admin account and password.

The official documentation for configuring Aliyun Drive is also very detailed.
The main steps are to select the Aliyun Drive OPEN driver and configure the refresh token.
Go to: https://alist.nn.ci/tool/aliyundrive/request
Use the Aliyun Drive mobile app to scan the QR code and obtain the refresh token.

Notes
Please select Local for the WebDAV Policy, as webdav does not support redirection.
If not set or set incorrectly, Emby can scrape, but entering the resource library will keep loading.
Related Issues:

image

Mounting WebDAV with Rclone#

After installation, use rclone config to create a new configuration.
Select webdav and configure as required.
You can refer to the following article for configuration:
Mount Aliyun Drive on Synology/Linux to Play with Emby and Create Your Own Home Theater!

image

After configuration, use the following command to mount it locally.

  • alist: /home/webdav alist is the name of the rclone configuration, and /home/webdav is the local mount path.
  • --dir-cache-time 4h cache time, refresh cache every 4 hours. If the cloud drive files are not frequently modified, this value can be set to 24h.
  • --cache-dir=/home/cache cache path.
  • --header "Referer:" This is a required parameter for mounting Aliyun Drive, as mentioned in the issues, but it seems to work without it.

If there is an error when mounting with rclone mount

Install fuse

Use df -h to check if the mount was successful.

To unmount, LocalFolder represents the local mount path.

To mount on startup

Start the service:

Set it to start on boot:

Other commands:

Emby Installation and Configuration#

Below is the Emby happy edition Docker image, for demonstration purposes only. Please support the official version if you have the capability.

  • -v /docker/emby:/config Mapping of configuration files, with the former being the host path.
  • -v /aliyun:/aliyun Mapping of resource library paths, should be the path mounted by webdav.
  • --device /dev/dri:/dev/dri Configuring hardware decoding for Emby. If you don't have integrated graphics or don't need it, you can remove this.

Notes
If your server has low configuration and no integrated graphics, it is recommended to disable transcoding.
Go to Settings -> Users -> Configuration and disable the following three options:

image

Other Notes#

cloudDrive2#

Initially, I used cloudDrive2 to mount Aliyun Drive because it was simple.
In the end, I gave up and reinstalled it for various reasons:

  1. Closed Source This thing is completely closed source.
  2. Security Installed it twice, and each time I was flagged by Google for fraud as soon as I entered the website.
  3. Performance It also does not support direct links, and uses the method of downloading locally and then streaming.
  4. Stability There are cases where the mount is dropped.

image
I don't know if it's a false positive or something else, but be cautious with closed source software.
Also, I don't understand why an locally deployed program requires cloud synchronization for account registration...😅

Currently, the Local WebDAV policy is the most compatible way. When watching videos in Emby, it first downloads from webdav to the local machine and then streams it to Emby for playback, so it uses server traffic.
302 redirection can obtain direct links from Aliyun Drive, but cannot be used for scraping with Emby.

If you just want to watch conveniently, you can use the 302 redirection mode and mount webdav with nplayer, so it uses Aliyun's official traffic, and 4K videos won't lag.

If you insist on using Emby with direct links, it is possible, but you need to modify the nginx configuration.
You can refer to the following two articles:

Because I use the nginx of Baota, which does not have the dependencies of nginx, even though I have recompiled the PCRE UTF module and specified that nginx should use this version of PCRE during compilation 🙃, it still reports an error of no UTF Support.

Page Beautification#

image
I think this style is much better than the default Emby display. It is based on Emby Crx.
It provides two methods, one is a Chrome extension for local beautification, suitable for using other people's Emby servers. The other is server-side beautification for your own Emby.

Miss Sister 😍#

If you want to scrape movies produced by certain studios, you can use MetaTube, a plugin that is compatible with both Jellyfin and Emby.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.