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:
parent
b688e6a977
commit
ef6de53776
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user