As described in #264 xHamster downloads are not possible, unless their site itself is specified as HTTP-Referer.
Since it didn't work for me either, I tried to fix it.
As it seems, it only works if the referer is passed as custom stream context option, as this overrides other values.
With this fix, it's possible to download videos from xHamster if the stream option is activated.
To achieve this without the streaming option, I recommend to use a plugin in your web browser.
As described in #264 xHamster downloads are not possible, unless their site itself is specified as HTTP-Referer. Since it didn't work for me either, I tried to fix it. As it seems, it only works if the referer is passed as custom stream context option, as this overrides other values.
further details here: http://docs.guzzlephp.org/en/stable/faq.html#how-can-i-add-custom-stream-context-options https://www.php.net/manual/en/context.http.php#context.http.header
Setting the referer as Guzzle request header (http://docs.guzzlephp.org/en/stable/request-options.html#headers) or through CURLOPT_REFERER did not work.
With this fix, it's possible to download videos from xHamster if the stream option is activated. To achieve this without the streaming option, I recommend to use a plugin in your web browser.