magiruuvelvet / LightweightQtDRMStreamViewer

A lightweight as possible DRM stream viewer based on the Qt Web Engine
MIT License
17 stars 4 forks source link

[feature] support for HTTP Accept-Language header #19

Closed magiruuvelvet closed 3 years ago

magiruuvelvet commented 5 years ago

implement support to set the preferred content language per provider, by default the Qt Web Engine doesn't contain this header at all

snippet I found on the internet for reference

view->page()->profile()->setRequestInterceptor(/*instance inerit QWebEngineUrlRequestInterceptor*/)
...
void /*class inerit WebEngineUrlRequestInterceptor*/::interceptRequest(QWebEngineUrlRequestInfo &info)
{
    info.setHttpHeader("Accept-Language", "zh-CN,zh;q=0.8");
}
magiruuvelvet commented 3 years ago

implemented in 4c01880798b597a988e6fa3a1df90117bf22115f