How to Set Life cycle for Download url

  java, question

Take the URL of BaiduMusic as an example:

How should we analyze this URL? Is link a document actual address? What is the purpose of xcode and how is it generated?

The link address is definitely not real, and the file name contains a certain cache_key, and the corresponding expire_time and other information can be found.

As for xcode, it may be calculated as follows:

Xcode = md5(cache_key plus secret_key)

The secret_key is only stored in the server, which ensures that the server can verify and the client cannot forge. In this way, the address cannot be downloaded after a certain period of time, thus avoiding problems such as external links.