Skip to content

Commit

Permalink
Don't apply token/UA/visitor ID to googlevideo URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
devoxin committed Jul 12, 2024
1 parent 0fca093 commit 1b215bb
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,15 @@ public void onRequest(HttpClientContext context,

String userAgent = context.getAttribute(ATTRIBUTE_USER_AGENT_SPECIFIED, String.class);

if (userAgent != null) {
request.setHeader("User-Agent", userAgent);
request.setHeader("X-Goog-Visitor-Id", tokenTracker.getVisitorId());
context.removeAttribute(ATTRIBUTE_USER_AGENT_SPECIFIED);
}
if (!request.getURI().getHost().contains("googlevideo")) {
if (userAgent != null) {
request.setHeader("User-Agent", userAgent);
request.setHeader("X-Goog-Visitor-Id", tokenTracker.getVisitorId());
context.removeAttribute(ATTRIBUTE_USER_AGENT_SPECIFIED);
}

oauth2Handler.applyToken(request);
oauth2Handler.applyToken(request);
}

// try {
// URI uri = new URIBuilder(request.getURI())
Expand Down

0 comments on commit 1b215bb

Please sign in to comment.