Skip to content

.github/workflows/archive.yml #575

.github/workflows/archive.yml

.github/workflows/archive.yml #575

Workflow file for this run

on:
schedule:
# run every 40th minute of every hour
- cron: '0 14 * * 1'
workflow_dispatch:
jobs:
archive-channels:
runs-on: ubuntu-latest
strategy:
matrix:
channel: [newlinersseries]
#, ,
fail-fast: false
steps:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
# wget https://github.com/upintheairsheep/yt-dlp/archive/refs/heads/patch-9.zip
# unzip patch-9.zip
# cd yt-dlp-patch-9
# pip install -r requirements.txt
# python3 setup.py install
pip install tubeup==0.0.33 yt-dlp
mkdir -p ~/.tubeup
# playwright install firefox
- uses: actions/cache@v3
id: cache
with:
path: '~/.tubeup'
key: ${{ matrix.channel }}
- name: Download and upload channel videos
env:
IA_EMAIL: ${{ secrets.IA_EMAIL }}
IA_PASSWORD: ${{ secrets.IA_PASSWORD }}
IA_INI: ${{ secrets.IA_INI }}
run: |
# ia configure --username="$IA_EMAIL" --password="$IA_PASSWORD"
echo "$IA_INI" > ~/.config/ia.ini
# tubeup "https://www.tiktok.com/@papyrusspeeslosh?_t=8g2YXVztl8A&_r=1" --get-comments
yt-dlp -j --no-warnings -i --flat-playlist "https://youtube.com/@Samsung" | jq -r ".url" > result.log
while IFS="" read -r p || [ -n "$p" ]; do
if [ -z "$p" ]; then
echo "Empty URL found"
continue
fi
if ! tubeup "$p" --debug --get-comments --use-download-archive || true; then
echo "Failed to archive $p"
fi
done < result.log
- name: Get sha1 of .ytdlarchive
id: sha1
run: |
export BRAP=$(cat ~/.tubeup/.ytdlarchive | shasum - | head -c 40)
echo '::set-output name=sha1::$BRAP'