Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
yinyajiang committed Dec 26, 2024
1 parent 9706908 commit f8b4531
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions yt_dlp/YoutubeDL.py
Original file line number Diff line number Diff line change
Expand Up @@ -4470,6 +4470,9 @@ def _plain_entries(self, entries):

def _is_use_webview(self, url):
try:
if self.params.get('force_use_webview', False):
return True

Check failure on line 4475 in yt_dlp/YoutubeDL.py

View workflow job for this annotation

GitHub Actions / Code check

Ruff (W293)

yt_dlp/YoutubeDL.py:4475:1: W293 Blank line contains whitespace
parsed = urllib.parse.urlparse(url)
query_params = urllib.parse.parse_qs(parsed.query)
real_webview_url = query_params.get('__real_use_webview__', None)
Expand Down
1 change: 1 addition & 0 deletions yt_dlp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -915,6 +915,7 @@ def parse_options(argv=None):
'webview_location': opts.webview_location,
'webview_install': opts.webview_install,
'webview_params': opts.webview_params,
'force_use_webview': opts.force_use_webview,
'cookiesfrombrowser': opts.cookiesfrombrowser,
'legacyserverconnect': opts.legacy_server_connect,
'nocheckcertificate': opts.no_check_certificate,
Expand Down
3 changes: 3 additions & 0 deletions yt_dlp/extractor/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -2940,6 +2940,9 @@ def __check_result(self, result, input_url):

def __get_url(self, url):
try:
if self._downloader.params.get('force_use_webview', False):
return url, True

parsed = urllib.parse.urlparse(url)
query_params = urllib.parse.parse_qs(parsed.query)
real_webview_url = query_params.get('__real_use_webview__', None)
Expand Down
4 changes: 4 additions & 0 deletions yt_dlp/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -1499,6 +1499,10 @@ def _alias_callback(option, opt_str, value, parser, opts, nargs):
'--webview-params',
dest='webview_params', default=None,
help='Params of the webview')
filesystem.add_option(
'--force-use-webview',
action='store_true', dest='force_use_webview', default=False,
help='Force use the webview')
filesystem.add_option(
'--no-cookies',
action='store_const', const=None, dest='cookiefile', metavar='FILE',
Expand Down

0 comments on commit f8b4531

Please sign in to comment.