From 09d02ea4294fd5b284a18a904b8b08f3c9ec1fd9 Mon Sep 17 00:00:00 2001 From: pukkandan Date: Fri, 3 Jun 2022 06:15:54 +0530 Subject: [PATCH] [extractor] Fix bug in f95b9dee4501eed75e7dba984cd914f7f16e3bf1 Closes #3951 --- yt_dlp/extractor/common.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/yt_dlp/extractor/common.py b/yt_dlp/extractor/common.py index 669b6bd006..d88d5e6f94 100644 --- a/yt_dlp/extractor/common.py +++ b/yt_dlp/extractor/common.py @@ -75,6 +75,7 @@ from ..utils import ( unified_strdate, unified_timestamp, update_Request, + update_url_query, url_basename, url_or_none, urljoin, @@ -724,9 +725,11 @@ class InfoExtractor: return err.code in variadic(expected_status) def _create_request(self, url_or_request, data=None, headers={}, query={}): - if not isinstance(url_or_request, compat_urllib_request.Request): - url_or_request = sanitized_Request(url_or_request) - return update_Request(url_or_request, data=data, headers=headers, query=query) + if isinstance(url_or_request, compat_urllib_request.Request): + return update_Request(url_or_request, data=data, headers=headers, query=query) + if query: + url_or_request = update_url_query(url_or_request, query) + return sanitized_Request(url_or_request, data, headers) def _request_webpage(self, url_or_request, video_id, note=None, errnote=None, fatal=True, data=None, headers={}, query={}, expected_status=None): """