Add minutes as a unit also
This commit is contained in:
1 parent
c0f52ae12e
commit
b50477e536
1 file changed
+3
-1
@@ -325,7 +325,9 @@ def download_media_metadata(media_id):
|
|||||||
unit = lambda p: str(p)[-1].lower()
|
unit = lambda p: str(p)[-1].lower()
|
||||||
number = lambda p: int(str(p)[-2], base=10)
|
number = lambda p: int(str(p)[-2], base=10)
|
||||||
try:
|
try:
|
||||||
if 'hours' == unit(parts):
|
if 'minutes' == unit(parts):
|
||||||
|
published_datetime = now + timedelta(minutes=number(parts))
|
||||||
|
elif 'hours' == unit(parts):
|
||||||
published_datetime = now + timedelta(hours=number(parts))
|
published_datetime = now + timedelta(hours=number(parts))
|
||||||
elif 'days' == unit(parts):
|
elif 'days' == unit(parts):
|
||||||
published_datetime = now + timedelta(days=number(parts))
|
published_datetime = now + timedelta(days=number(parts))
|
||||||
|
|||||||
Reference in new issue
Block a user