问题
I scraped a link and it works perfectly on chrome / safari / firefox at macos getting the ressource but when the same link is used from another operating system like windows or android I get a 404 error in the browser.
An example link would be:
https://p18d1c9b884-6b67-4bc4-8b38-7fe101682ea8.hdfilme.ws/hls/b74ec1eb98c4b214199fb328d53ed255/b74ec1eb98c4b214199fb328d53ed255-0.png?msKey=S9
It is part of a m3u8 file, which can be found under:
https://load.hdfilme.ws/hls/b74ec1eb98c4b214199fb328d53ed255/b74ec1eb98c4b214199fb328d53ed255.m3u8
It has nothing to do with session because it is always available from macos even in private mode or curl.
Anyone has a hint or tip what could be causing that?
回答1:
I can not tell you why and if it is running on macos, since I only got a windows system to test, but I can tell you why it is not running on windows.
So I tested both links provided and couldn´t open the second one. I got the same error described by you. I investigated the other link and watched the networktraffic of the source page. So the reason why you can not access the page is you are missing a headers option in your request.
You need to add the Headeroption 'referer: https://hdfilme.cx/filme1/21-bridges-13297-stream/deutsch'
With that option added to a request you can access the ressource behind. For example you can use the following command: curl 'https://p18d1c9b884-6b67-4bc4-8b38-7fe101682ea8.hdfilme.ws/hls/b74ec1eb98c4b214199fb328d53ed255/b74ec1eb98c4b214199fb328d53ed255-0.png?msKey=S9' -H 'referer: https://hdfilme.cx/filme1/21-bridges-13297-stream/deutsch' --output 0.png
With that command you would get the first PNG file downloaded.
来源:https://stackoverflow.com/questions/61665262/why-is-link-only-working-from-macos-operating-system