'Curl doesn't download file which requires redirection ,even with -L flag

This is a link https://1lib.in/dl/4993988/f3ffaf to download an EPUB file. This link get redirected to https://p300.zlibcdn.com/dtoken/{some-value}.

It downloads on browser. But I cannot download it using curl even with -L flag, curl "https://1lib.in/dl/4993988/f3ffaf" -L -o download.epub, it just downloads a html file.

Any idea to get this file downloaded from CLI?

Thank



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source