diff --git a/modules/videos/downloader.py b/modules/videos/downloader.py index a99a1da9..2f972316 100755 --- a/modules/videos/downloader.py +++ b/modules/videos/downloader.py @@ -46,9 +46,7 @@ PREFERRED_VIDEO_FORMAT = ','.join([ '136+140', # 130=720p video-only, 140= high quality audio only '22', # 720p video with audio 'mp4-480p', - 'mp4-360p', - '18', # 360p video with audio - 'bestvideo+bestaudio', # Download the highest resolution as a last resort (1080p is quite large). + 'bestvideo*+bestaudio/best', # Download the highest resolution as a last resort (can be quite large). ]) diff --git a/modules/videos/video/test/test_api.py b/modules/videos/video/test/test_api.py index 0d4fdf52..6a6c5171 100644 --- a/modules/videos/video/test/test_api.py +++ b/modules/videos/video/test/test_api.py @@ -83,6 +83,8 @@ def test_video_delete(test_client, test_session, test_directory, channel_factory vid2 = video_factory(channel_id=channel2.id, with_video_file=True, with_info_json=True) test_session.commit() + assert test_session.query(Video).count() == 2 + vid1_video_path, vid1_caption_path = vid1.video_path, vid1.caption_path vid2_video_path, vid2_info_json_path = vid2.video_path, vid2.info_json_path @@ -97,15 +99,15 @@ def test_video_delete(test_client, test_session, test_directory, channel_factory # Video was added to skip list. assert len(channel1.skip_download_videos) == 1 - # Deleting a video leaves it's entry in the DB, but its files are deleted. - assert test_session.query(Video).count() == 2 + # Video was deleted. + assert test_session.query(Video).count() == 1 assert vid1_video_path.is_file() is False and vid1_caption_path.is_file() is False assert vid2_video_path.is_file() and vid2_info_json_path.is_file() request, response = test_client.delete(f'/api/videos/video/{vid2.id}') assert response.status_code == HTTPStatus.NO_CONTENT - assert test_session.query(Video).count() == 2 + assert test_session.query(Video).count() == 0 assert vid1_video_path.is_file() is False and vid1_caption_path.is_file() is False assert vid2_video_path.is_file() is False and vid2_info_json_path.is_file() is False