manga-download / haruneko

Prototype of HakuNeko based on NW.js + TypeScript
https://haruneko-docs.pages.dev
126 stars 32 forks source link

Handle edge cases to stream animes (HLS compo & referer) #59

Open MikeZeDev opened 1 year ago

MikeZeDev commented 1 year ago

Case ; Animepahe uses Kwix. We are able to get Kwix playlist. Downloading the video is ok it works through FFMpeg.

However, its not possible to preview the video. Fragments in the playlist cant be fetched to be previewed in Haku because we need a custom referer to get them, and HLS.min doesn't allow custom referer afaik (and its not planed to be added). While its understandable in a browser context its problematic for us.

Not sure what could be the solution tho.

MikeZeDev commented 1 year ago

Should i add, i think there is a similar problem with Mp4Cloud

ronny1982 commented 11 months ago

There are some approaches that could be investigated:

  1. Using a custom protocol such as hakuneko-stream://.../chunk.ts for all segments of the video, which will then be fetched internally by HakuNeko
  2. Embed the video player in a spoofed HTML document which has the Document.referrer property set to the original URL where the video was from
  3. In case of using HLS.js, custom loaders may be able to help in solving the problem
MikeZeDev commented 4 months ago

about the 2nd approach : Lets say the website address is A.com

1) you may have to fetch the playlist using A.com as referrer, on B.com website. 2) fragments must be fetched (perhaps on a third host) using B.com as referer, or A.com referrer, depending on the website 3) same as 2 for the -may be needed- AES key from m3u8