KraXen72 / shira

Download music from YouTube, YouTube Music and Soundcloud, with great metadata and little effort.
MIT License
61 stars 3 forks source link

UTC timezone #9

Open iofane opened 4 months ago

iofane commented 4 months ago

Firstly, thanks for the great app. There's an issue in tagging.py that the datetime.fromisoformat() method doesn't support 'Z' at the end of the timestamp. This prevents downloading.

example error: File "C:\shira\shiradl\tagging.py", line 48, in metadata_applier v = datetime.fromisoformat(str(v)).date() ValueError: Invalid isoformat string: '2015-08-02T00:00:00Z'

Fix: in tagging.py swapped out from datetime import datetime to from dateutil import parser swapped out v = datetime.fromisoformat(str(v)).date() to v = parser.isoparse(str(v)).date()

The dateutil library seems to just handle UTC 'Z' easier.

Alternatively having a timezone cli option could help me to set something up from the get go.

KraXen72 commented 4 months ago

ah, okay. i didn't know about dateutil. i'll work on a fix. thanks for letting me know what you did to fix it. i'm just glad the app is getting so many users :)