Skip to content

Commit

Permalink
fix: video_note and voice download error
Browse files Browse the repository at this point in the history
  • Loading branch information
tangyoha committed Apr 7, 2023
1 parent c4e9833 commit c237633
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion media_downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ async def _get_media_meta(
media_obj.date.isoformat(), # type: ignore
file_format,
)

file_name = validate_title(file_name)
temp_file_name = os.path.join(app.temp_save_path, dirname, file_name)

file_name = os.path.join(file_save_path, file_name)
Expand Down
8 changes: 4 additions & 4 deletions tests/test_media_downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,11 +440,11 @@ def test_get_media_meta(self):
self.assertEqual(
(
platform_generic_path(
"/root/project/test1/2019_07/1 - voice_2019-07-25T14:53:50.ogg"
"/root/project/test1/2019_07/1 - voice_2019-07-25T14_53_50.ogg"
),
platform_generic_path(
os.path.join(
app.temp_save_path, "test1/1 - voice_2019-07-25T14:53:50.ogg"
app.temp_save_path, "test1/1 - voice_2019-07-25T14_53_50.ogg"
)
),
"ogg",
Expand Down Expand Up @@ -679,12 +679,12 @@ def test_get_media_meta(self):
self.assertEqual(
(
platform_generic_path(
"/root/project/test2/2019_07/6 - video_note_2019-07-25T14:53:50.mp4"
"/root/project/test2/2019_07/6 - video_note_2019-07-25T14_53_50.mp4"
),
platform_generic_path(
os.path.join(
app.temp_save_path,
"test2/6 - video_note_2019-07-25T14:53:50.mp4",
"test2/6 - video_note_2019-07-25T14_53_50.mp4",
)
),
"mp4",
Expand Down
2 changes: 0 additions & 2 deletions tests/utils/test_updates.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
"""Unittest module for update checker."""
import os
import sys
import unittest

import mock
from rich.markdown import Markdown

sys.path.append("..") # Adds higher directory to python modules path.
from utils.updates import check_for_updates
Expand Down

0 comments on commit c237633

Please sign in to comment.