X-Git-Url: https://git.sur5r.net/?p=minitube;a=blobdiff_plain;f=src%2Fhttputils.cpp;h=76bac4d74b15edef2afa862d0f1b824c8c9fb164;hp=6865499824d890d7068be34e86bf08b76d92cd6a;hb=ff6d1f7f087f40438952d4b4315a8875f23281cb;hpb=831ecf74b394df57cbc109014189906dc972a92d diff --git a/src/httputils.cpp b/src/httputils.cpp index 6865499..76bac4d 100644 --- a/src/httputils.cpp +++ b/src/httputils.cpp @@ -40,6 +40,16 @@ Http &HttpUtils::yt() { return *h; } +Http &HttpUtils::stealthAndNotCached() { + static Http *h = [] { + Http *http = new Http; + http->addRequestHeader("User-Agent", stealthUserAgent()); + + return http; + }(); + return *h; +} + void HttpUtils::clearCaches() { LocalCache::instance("yt")->clear(); LocalCache::instance("http")->clear();