From d185a3f45180aa0276fbce2fbc95198a65266fda Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sun, 4 Apr 2021 11:16:44 -0700 Subject: [PATCH] Update requirements.txt. --- frontends/ycdl_flask/backend/common.py | 2 ++ requirements.txt | 9 ++++++++- ycdl/ytapi.py | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/frontends/ycdl_flask/backend/common.py b/frontends/ycdl_flask/backend/common.py index 19e5e56..a109cae 100644 --- a/frontends/ycdl_flask/backend/common.py +++ b/frontends/ycdl_flask/backend/common.py @@ -56,6 +56,8 @@ def after_request(response): #################################################################################################### #################################################################################################### +# These functions will be called by the launcher, flask_dev, flask_prod. + def init_ycdldb(*args, **kwargs): global ycdldb ycdldb = ycdl.ycdldb.YCDLDB(*args, **kwargs) diff --git a/requirements.txt b/requirements.txt index 421e38c..4d471ab 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,12 @@ +# For parsing RSS bs4 + +# For running the webserver flask gevent -https://github.com/voussoir/else/raw/master/_voussoirkit/voussoirkit.zip + +# For parsing Youtube API's published dates and duration strings isodate + +# My own variety toolkit +https://github.com/voussoir/else/raw/master/_voussoirkit/voussoirkit.zip diff --git a/ycdl/ytapi.py b/ycdl/ytapi.py index bcf19f0..9318eb2 100644 --- a/ycdl/ytapi.py +++ b/ycdl/ytapi.py @@ -29,6 +29,7 @@ class Video: self.description = snippet.get('description', '') self.author_id = snippet['channelId'] self.author_name = snippet.get('channelTitle', self.author_id) + # Something like '2016-10-01T21:00:01' self.published_string = snippet['publishedAt'] self.published = isodate.parse_datetime(self.published_string).timestamp() @@ -37,6 +38,7 @@ class Video: self.live_broadcast = None self.tags = snippet.get('tags', []) + # Something like 'PT10M25S' self.duration = isodate.parse_duration(content_details['duration']).seconds self.views = int_none(statistics.get('viewCount', None)) self.likes = int_none(statistics.get('likeCount', 0))