Compare commits

..

1 Commits

Author SHA1 Message Date
ReenigneArcher
aaed4884ed fix(youtube): update extractor handling consent 2023-11-22 09:49:31 +00:00
2 changed files with 16 additions and 48 deletions

View File

@ -6,13 +6,9 @@ env:
pypy-versions: pypy-2.7, pypy-3.6, pypy-3.7 pypy-versions: pypy-2.7, pypy-3.6, pypy-3.7
cpython-versions: main cpython-versions: main
test-set: core test-set: core
# Python beta version to be built using pyenv before setup-python support
# Must also be included in all-cpython-versions
next: 3.13
on: on:
push: push:
# push inputs aren't known to GitHub
inputs: inputs:
cpython-versions: cpython-versions:
type: string type: string
@ -21,7 +17,6 @@ on:
type: string type: string
default: core default: core
pull_request: pull_request:
# pull_request inputs aren't known to GitHub
inputs: inputs:
cpython-versions: cpython-versions:
type: string type: string
@ -61,23 +56,6 @@ jobs:
test-set: ${{ steps.run.outputs.test-set }} test-set: ${{ steps.run.outputs.test-set }}
own-pip-versions: ${{ steps.run.outputs.own-pip-versions }} own-pip-versions: ${{ steps.run.outputs.own-pip-versions }}
steps: steps:
# push and pull_request inputs aren't known to GitHub (pt3)
- name: Set push defaults
if: ${{ github.event_name == 'push' }}
env:
cpython-versions: all
test-set: core
run: |
echo "cpython-versions=${{env.cpython-versions}}" >> "$GITHUB_ENV"
echo "test_set=${{env.test_set}}" >> "$GITHUB_ENV"
- name: Get pull_request inputs
if: ${{ github.event_name == 'pull_request' }}
env:
cpython-versions: main
test-set: both
run: |
echo "cpython-versions=${{env.cpython-versions}}" >> "$GITHUB_ENV"
echo "test_set=${{env.test_set}}" >> "$GITHUB_ENV"
- name: Make version array - name: Make version array
id: run id: run
run: | run: |
@ -101,7 +79,6 @@ jobs:
# versions with a special get-pip.py in a per-version subdirectory # versions with a special get-pip.py in a per-version subdirectory
printf 'own-pip-versions=%s\n' \ printf 'own-pip-versions=%s\n' \
"$(json_list 2.6, 2.7, 3.2, 3.3, 3.4, 3.5, 3.6)" >> "$GITHUB_OUTPUT" "$(json_list 2.6, 2.7, 3.2, 3.3, 3.4, 3.5, 3.6)" >> "$GITHUB_OUTPUT"
tests: tests:
name: Run tests name: Run tests
needs: select needs: select
@ -144,20 +121,13 @@ jobs:
ytdl-test-set: ${{ contains(needs.select.outputs.test-set, 'download') && 'download' || 'nodownload' }} ytdl-test-set: ${{ contains(needs.select.outputs.test-set, 'download') && 'download' || 'nodownload' }}
run-tests-ext: sh run-tests-ext: sh
steps: steps:
- name: Prepare Linux
if: ${{ startswith(matrix.os, 'ubuntu') }}
shell: bash
run: |
# apt in runner, if needed, may not be up-to-date
sudo apt-get update
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v3
#-------- Python 3 ----- #-------- Python 3 -----
- name: Set up supported Python ${{ matrix.python-version }} - name: Set up supported Python ${{ matrix.python-version }}
id: setup-python id: setup-python
if: ${{ matrix.python-impl == 'cpython' && matrix.python-version != '2.6' && matrix.python-version != '2.7' && matrix.python-version != env.next }} if: ${{ matrix.python-impl == 'cpython' && matrix.python-version != '2.6' && matrix.python-version != '2.7' && matrix.python-version != '3.12'}}
# wrap broken actions/setup-python@v4 # wrap broken actions/setup-python@v4
# NB may run apt-get install in Linux
uses: ytdl-org/setup-python@v1 uses: ytdl-org/setup-python@v1
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
@ -194,23 +164,23 @@ jobs:
'import sys' \ 'import sys' \
'print(sys.path)' \ 'print(sys.path)' \
| ${expected} - | ${expected} -
#-------- Python next (was 3.12) - #-------- Python 3.12 -
- name: Set up CPython 3.next environment - name: Set up CPython 3.12 environment
if: ${{ matrix.python-impl == 'cpython' && matrix.python-version == env.next }} if: ${{ matrix.python-impl == 'cpython' && matrix.python-version == '3.12' }}
shell: bash shell: bash
run: | run: |
PYENV_ROOT=$HOME/.local/share/pyenv PYENV_ROOT=$HOME/.local/share/pyenv
echo "PYENV_ROOT=${PYENV_ROOT}" >> "$GITHUB_ENV" echo "PYENV_ROOT=${PYENV_ROOT}" >> "$GITHUB_ENV"
- name: Cache Python 3.next - name: Cache Python 3.12
id: cachenext id: cache312
if: ${{ matrix.python-impl == 'cpython' && matrix.python-version == env.next }} if: ${{ matrix.python-impl == 'cpython' && matrix.python-version == '3.12' }}
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
key: python-${{ env.next }} key: python-3.12
path: | path: |
${{ env.PYENV_ROOT }} ${{ env.PYENV_ROOT }}
- name: Build and set up Python 3.next - name: Build and set up Python 3.12
if: ${{ matrix.python-impl == 'cpython' && matrix.python-version == env.next && ! steps.cachenext.outputs.cache-hit }} if: ${{ matrix.python-impl == 'cpython' && matrix.python-version == '3.12' && ! steps.cache312.outputs.cache-hit }}
# dl and build locally # dl and build locally
shell: bash shell: bash
run: | run: |
@ -222,13 +192,12 @@ jobs:
export PYENV_ROOT=${{ env.PYENV_ROOT }} export PYENV_ROOT=${{ env.PYENV_ROOT }}
export PATH=$PYENV_ROOT/bin:$PATH export PATH=$PYENV_ROOT/bin:$PATH
git clone "https://github.com/pyenv/pyenv.git" "$PYENV_ROOT" git clone "https://github.com/pyenv/pyenv.git" "$PYENV_ROOT"
pyenv install ${{ env.next }} pyenv install 3.12.0b4
- name: Locate Python 3.next - name: Locate Python 3.12
if: ${{ matrix.python-impl == 'cpython' && matrix.python-version == env.next }} if: ${{ matrix.python-impl == 'cpython' && matrix.python-version == '3.12' }}
shell: bash shell: bash
run: | run: |
PYTHONHOME="$(echo "${{ env.PYENV_ROOT }}/versions/${{ env.next }}."*)" PYTHONHOME="${{ env.PYENV_ROOT }}/versions/3.12.0b4"
test -n "$PYTHONHOME"
echo "PYTHONHOME=$PYTHONHOME" >> "$GITHUB_ENV" echo "PYTHONHOME=$PYTHONHOME" >> "$GITHUB_ENV"
echo "PATH=${PYTHONHOME}/bin:$PATH" >> "$GITHUB_ENV" echo "PATH=${PYTHONHOME}/bin:$PATH" >> "$GITHUB_ENV"
#-------- Python 2.7 -- #-------- Python 2.7 --
@ -399,7 +368,7 @@ jobs:
done done
#-------- nose -------- #-------- nose --------
- name: Install nose for Python ${{ matrix.python-version }} - name: Install nose for Python ${{ matrix.python-version }}
if: ${{ (matrix.python-version != '3.2' && steps.setup-python.outputs.python-path) || (matrix.python-impl == 'cpython' && (matrix.python-version == '2.7' || matrix.python-version == env.next)) }} if: ${{ (matrix.python-version != '3.2' && steps.setup-python.outputs.python-path) || (matrix.python-impl == 'cpython' && (matrix.python-version == '2.7' || matrix.python-version == '3.12')) }}
shell: bash shell: bash
run: | run: |
echo "$PATH" echo "$PATH"

View File

@ -2121,8 +2121,7 @@ def sanitize_filename(s, restricted=False, is_id=False):
if restricted and (char in '!&\'()[]{}$;`^,#' or char.isspace()): if restricted and (char in '!&\'()[]{}$;`^,#' or char.isspace()):
return '_' return '_'
if restricted and ord(char) > 127: if restricted and ord(char) > 127:
return '' if unicodedata.category(char)[0] in 'CM' else '_' return '_'
return char return char
# Replace look-alike Unicode glyphs # Replace look-alike Unicode glyphs