mirror of
https://github.com/KevinMidboe/spotify-downloader.git
synced 2026-01-01 23:16:37 +00:00
Tell the user to install unicode-slugify in case of ImportError
This commit is contained in:
@@ -1,6 +1,10 @@
|
|||||||
from slugify import SLUG_OK, slugify
|
|
||||||
from core.const import log
|
from core.const import log
|
||||||
|
|
||||||
|
try:
|
||||||
|
from slugify import SLUG_OK, slugify
|
||||||
|
except ImportError:
|
||||||
|
log.warning('Remove any other slugifies and install unicode-slugify')
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
||||||
@@ -68,11 +72,11 @@ def filter_path(path):
|
|||||||
|
|
||||||
|
|
||||||
def videotime_from_seconds(time):
|
def videotime_from_seconds(time):
|
||||||
if time<60:
|
if time < 60:
|
||||||
return str(time)
|
return str(time)
|
||||||
if time<3600:
|
if time < 3600:
|
||||||
return '{}:{}'.format(str(time//60), str(time%60).zfill(2))
|
return '{}:{}'.format(str(time // 60), str(time % 60).zfill(2))
|
||||||
|
|
||||||
return '{}:{}:{}'.format(str(time//60),
|
return '{}:{}:{}'.format(str(time // 60),
|
||||||
str((time%60)//60).zfill(2),
|
str((time % 60) // 60).zfill(2),
|
||||||
str((time%60)%60).zfill(2))
|
str((time % 60) % 60).zfill(2))
|
||||||
|
|||||||
Reference in New Issue
Block a user