Update requirements.txt.

master
voussoir 2021-04-04 11:16:44 -07:00
parent 10f67cae4b
commit d185a3f451
No known key found for this signature in database
GPG Key ID: 5F7554F8C26DACCB
3 changed files with 12 additions and 1 deletions

View File

@ -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)

View File

@ -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

View File

@ -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))