Skip to content

Fixed subscription import bug #36

Fixed subscription import bug

Fixed subscription import bug #36

name: Subscriptions
on:
- push
- pull_request
jobs:
functionality:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.10', '3.11', '3.12']
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
- name: Adding Subscription
run: |
python3 ./yt_manager.py add-subscription https://www.youtube.com/@PracticalEngineeringChannel
EXIT_CODE=$?
if [ $EXIT_CODE -eq 0 ]; then
echo "Command succeeded with exit code 0"
elif [ $EXIT_CODE -eq -1 ]; then
echo "Command failed with exit code -1"
else
echo "Command exited with unexpected code $EXIT_CODE"
exit 1
fi
shell: bash
- name: List Subscriptions
run: |
python3 ./yt_manager.py list-subscriptions
EXIT_CODE=$?
if [ $EXIT_CODE -eq 0 ]; then
echo "Command succeeded with exit code 0"
elif [ $EXIT_CODE -eq -1 ]; then
echo "Command failed with exit code -1"
else
echo "Command exited with unexpected code $EXIT_CODE"
exit 1
fi
shell: bash
- name: Export subscription
run: |
python3 ./yt_manager.py export-subscriptions
EXIT_CODE=$?
if [ $EXIT_CODE -eq 0 ]; then
echo "Command succeeded with exit code 0"
elif [ $EXIT_CODE -eq -1 ]; then
echo "Command failed with exit code -1"
else
echo "Command exited with unexpected code $EXIT_CODE"
exit 1
fi
shell: bash
- name: Import subscription
run: |
python3 ./yt_manager.py import-subscriptions ./ytdownloader/subscriptions_export.json --overwrite True
EXIT_CODE=$?
if [ $EXIT_CODE -eq 0 ]; then
echo "Command succeeded with exit code 0"
elif [ $EXIT_CODE -eq -1 ]; then
echo "Command failed with exit code -1"
else
echo "Command exited with unexpected code $EXIT_CODE"
exit 1
fi
shell: bash
- name: List Subscriptions (after import)
run: |
python3 ./yt_manager.py list-subscriptions
EXIT_CODE=$?
if [ $EXIT_CODE -eq 0 ]; then
echo "Command succeeded with exit code 0"
elif [ $EXIT_CODE -eq -1 ]; then
echo "Command failed with exit code -1"
else
echo "Command exited with unexpected code $EXIT_CODE"
exit 1
fi
shell: bash
- name: Delete Subscription
run: |
python3 ./yt_manager.py del-subscription @PracticalEngineeringChannel
EXIT_CODE=$?
if [ $EXIT_CODE -eq 0 ]; then
echo "Command succeeded with exit code 0"
elif [ $EXIT_CODE -eq -1 ]; then
echo "Command failed with exit code -1"
else
echo "Command exited with unexpected code $EXIT_CODE"
exit 1
fi
shell: bash