youtube_get_newest_video_fr.../.drone.yml

36 lines
828 B
YAML
Raw Permalink Normal View History

2021-09-13 22:00:22 +02:00
kind: pipeline
type: docker
name: default
steps:
- name: test
image: python:3.8-alpine
pull: if-not-exists
environment:
YOUTUBE_API_KEY:
from_secret: YOUTUBE_API_KEY
YOUTUBE_CHANNEL_ID: 'UCmpilcSVu1T-AsAiiHbfpcA'
TZ: 'Europe/Berlin'
2021-09-13 22:03:08 +02:00
commands:
- apk --no-cache add gcc musl-dev tzdata
- pip3 install --no-cache-dir -r requirements.txt
- |
python3 -c '
from GetLatestVideo import API
import os
2021-09-13 22:00:22 +02:00
2021-09-13 22:03:08 +02:00
YOUTUBE_API_KEY = os.getenv("YOUTUBE_API_KEY")
YOUTUBE_CHANNEL_ID = os.getenv("YOUTUBE_CHANNEL_ID")
2021-09-13 22:00:22 +02:00
2021-09-13 22:03:08 +02:00
CHANNEL_ID = [
YOUTUBE_CHANNEL_ID
]
2021-09-13 22:00:22 +02:00
2021-09-13 22:03:08 +02:00
videos = []
yt = API(YOUTUBE_API_KEY)
2021-09-13 22:00:22 +02:00
2021-09-13 22:03:08 +02:00
for channel in CHANNEL_ID:
videos.append(yt.get_latest_video(channel))
2021-09-13 22:00:22 +02:00
2021-09-13 22:03:08 +02:00
print(videos)'