airflow.providers.amazon.aws.example_dags.example_google_api_youtube_to_s3

This is a more advanced example dag for using GoogleApiToS3Operator which uses xcom to pass data between tasks to retrieve specific information about YouTube videos:

First it searches for up to 50 videos (due to pagination) in a given time range (YOUTUBE_VIDEO_PUBLISHED_AFTER, YOUTUBE_VIDEO_PUBLISHED_BEFORE) on a YouTube channel (YOUTUBE_CHANNEL_ID) saves the response in S3 + passes over the YouTube IDs to the next request which then gets the information (YOUTUBE_VIDEO_FIELDS) for the requested videos and saves them in S3 (S3_DESTINATION_KEY).

Further information:

YOUTUBE_VIDEO_PUBLISHED_AFTER and YOUTUBE_VIDEO_PUBLISHED_BEFORE needs to be formatted YYYY-MM-DDThh:mm:ss.sZ. See https://developers.google.com/youtube/v3/docs/search/list for more information. YOUTUBE_VIDEO_PARTS depends on the fields you pass via YOUTUBE_VIDEO_FIELDS. See https://developers.google.com/youtube/v3/docs/videos/list#parameters for more information. YOUTUBE_CONN_ID is optional for public videos. It does only need to authenticate when there are private videos on a YouTube channel you want to retrieve.

Module Contents

Functions

transform_video_ids(**kwargs)

Attributes

YOUTUBE_CHANNEL_ID

YOUTUBE_VIDEO_PUBLISHED_AFTER

YOUTUBE_VIDEO_PUBLISHED_BEFORE

S3_BUCKET_NAME

YOUTUBE_VIDEO_PARTS

YOUTUBE_VIDEO_FIELDS

task_video_ids_to_s3

airflow.providers.amazon.aws.example_dags.example_google_api_youtube_to_s3.YOUTUBE_CHANNEL_ID[source]
airflow.providers.amazon.aws.example_dags.example_google_api_youtube_to_s3.YOUTUBE_VIDEO_PUBLISHED_AFTER[source]
airflow.providers.amazon.aws.example_dags.example_google_api_youtube_to_s3.YOUTUBE_VIDEO_PUBLISHED_BEFORE[source]
airflow.providers.amazon.aws.example_dags.example_google_api_youtube_to_s3.S3_BUCKET_NAME[source]
airflow.providers.amazon.aws.example_dags.example_google_api_youtube_to_s3.YOUTUBE_VIDEO_PARTS[source]
airflow.providers.amazon.aws.example_dags.example_google_api_youtube_to_s3.YOUTUBE_VIDEO_FIELDS[source]
airflow.providers.amazon.aws.example_dags.example_google_api_youtube_to_s3.transform_video_ids(**kwargs)[source]
airflow.providers.amazon.aws.example_dags.example_google_api_youtube_to_s3.task_video_ids_to_s3[source]

Was this entry helpful?