diff --git a/media_downloader.py b/media_downloader.py index e2bca79..3b500e3 100644 --- a/media_downloader.py +++ b/media_downloader.py @@ -38,7 +38,7 @@ def _get_media_meta(media_obj: object, _type: str) -> Tuple[str, str]: THIS_DIR, _type, "voice_{}.{}".format( - dt.fromtimestamp(media_obj.date).isoformat(), file_format + dt.utcfromtimestamp(media_obj.date).isoformat(), file_format ), ) elif _type == "photo": diff --git a/tests/test_media_downloader.py b/tests/test_media_downloader.py index 9134ee8..ce969db 100644 --- a/tests/test_media_downloader.py +++ b/tests/test_media_downloader.py @@ -85,7 +85,7 @@ class MockClient: def download_media(self, *args, **kwargs): assert "AwADBQADbwAD2oTRVeHe5eXRFftfAg", args[0] - assert "/root/project/voice/voice_2019-07-25T16:53:50.ogg", kwargs[ + assert "/root/project/voice/voice_2019-07-25T14:53:50.ogg", kwargs[ "file_name" ] return kwargs["file_name"] @@ -108,7 +108,7 @@ class MediaDownloaderTestCase(unittest.TestCase): self.assertEqual( ( "AwADBQADbwAD2oTRVeHe5eXRFftfAg", - "/root/project/voice/voice_2019-07-25T16:53:50.ogg", + "/root/project/voice/voice_2019-07-25T14:53:50.ogg", ), result, )