Making things easier for scdl-as-a-lib users (#498)

* refactor: don't touch the global logging config

* test: skip m4a test if there's no go+ sub instead of erroring

* Log to stderr

---------

Co-authored-by: 7x11x13 <x7x11x13@gmail.com>
This commit is contained in:
Arsenii es3n1n 2024-07-08 20:10:44 +02:00 committed by GitHub
parent b688e6a977
commit ef6de53776
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 3 deletions

View File

@ -109,11 +109,10 @@ from tqdm import tqdm
from scdl import __version__, utils from scdl import __version__, utils
from scdl.metadata_assembler import METADATA_ASSEMBLERS, MetadataInfo from scdl.metadata_assembler import METADATA_ASSEMBLERS, MetadataInfo
logging.basicConfig(level=logging.INFO, format="%(message)s")
logging.getLogger("requests").setLevel(logging.WARNING)
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO) logger.setLevel(logging.INFO)
logger.addFilter(utils.ColorizeFilter()) logger.addFilter(utils.ColorizeFilter())
logger.addHandler(logging.StreamHandler())
FFMPEG_PIPE_CHUNK_SIZE = 1024 * 1024 # 1 mb FFMPEG_PIPE_CHUNK_SIZE = 1024 * 1024 # 1 mb

View File

@ -1,4 +1,5 @@
import os import os
import pytest
from pathlib import Path from pathlib import Path
from tests.utils import assert_not_track, assert_track, call_scdl_with_auth from tests.utils import assert_not_track, assert_track, call_scdl_with_auth
@ -91,7 +92,8 @@ def test_m4a(tmp_path: Path):
"--opus", "--opus",
) )
assert r.returncode == 0 assert r.returncode == 0
assert not (tmp_path / 'track.opus').exists(), 'Please make sure that you have a GO+ subscription' if (tmp_path / 'track.opus').exists():
pytest.skip('No go+ subscription')
assert_track( assert_track(
tmp_path, tmp_path,
"track.m4a", "track.m4a",