Compare commits

...

5 Commits

Author SHA1 Message Date
Mozi 810cf55549
Merge 569d25e0fa into 1a366403d9 2024-04-28 19:37:08 +02:00
bashonly 1a366403d9
[build] Run `macos_legacy` job on `macos-12` (#9804)
`macos-latest` has been bumped to `macos-14-arm64` which breaks the builds

Authored by: bashonly
2024-04-28 15:35:17 +00:00
Simon Sawicki 7e26bd53f9
[core/windows] Fix tests for `sys.executable` with spaces (Fix for 64766459e3)
Authored by: Grub4K
2024-04-28 15:47:55 +02:00
Mozi 569d25e0fa add comments about http 401 2024-04-26 05:24:53 +00:00
Mozi 696ac32838 [ie/brilliantpala] Check if cookies are invalidated 2024-04-25 17:28:18 +00:00
3 changed files with 14 additions and 7 deletions

View File

@ -300,7 +300,7 @@ jobs:
macos_legacy:
needs: process
if: inputs.macos_legacy
runs-on: macos-latest
runs-on: macos-12
steps:
- uses: actions/checkout@v4

View File

@ -2090,10 +2090,7 @@ Line 1
args = [sys.executable, '-c', 'import sys; print(end=sys.argv[1])', argument, 'end']
assert run_shell(args) == expected
escaped = shell_quote(argument, shell=True)
args = f'{sys.executable} -c "import sys; print(end=sys.argv[1])" {escaped} end'
assert run_shell(args) == expected
assert run_shell(shell_quote(args, shell=True)) == expected
if __name__ == '__main__':

View File

@ -27,8 +27,18 @@ class BrilliantpalaBaseIE(InfoExtractor):
r'"username"\s*:\s*"(?P<username>[^"]+)"', webpage, 'logged-in username')
def _perform_login(self, username, password):
login_form = self._hidden_inputs(self._download_webpage(
self._LOGIN_API, None, 'Downloading login page'))
login_page, urlh = self._download_webpage_handle(
self._LOGIN_API, None, 'Downloading login page', expected_status=401)
if not (urlh.status == 401 or urlh.url.startswith(self._LOGIN_API)):
self.write_debug('Cookies are valid, no login required.')
return
if urlh.status == 401:
# The stored cookies have been invalidated.
# No login page will be returned and cookies will be reset, so visit the page again.
login_page = self._download_webpage(self._LOGIN_API, None, 'Downloading login page')
login_form = self._hidden_inputs(login_page)
login_form.update({
'username': username,
'password': password,