Skip to content

Commit

Permalink
quick fix for bandcamp
Browse files Browse the repository at this point in the history
  • Loading branch information
gpchelkin committed Mar 2, 2023
1 parent 00e0124 commit 2803abc
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 24 deletions.
28 changes: 8 additions & 20 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ pyflakes = ["+*"]
"wemake-python-styleguide" = ["+*"]

[tool.tox]
# TODO https://github.com/python-poetry/poetry/blob/master/docs/faq.md#is-tox-supported
legacy_tox_ini = """
[tox]
skipsdist = true
Expand Down
3 changes: 1 addition & 2 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
appdirs==1.4.4 ; python_version >= "3.9" and python_version < "4.0"
astor==0.8.1 ; python_version >= "3.9" and python_version < "4.0"
attrs==22.2.0 ; python_version >= "3.9" and python_version < "4.0"
autorepr==0.3.0 ; python_version >= "3.9" and python_version < "4.0"
Expand Down Expand Up @@ -62,7 +61,7 @@ pyflakes==2.4.0 ; python_version >= "3.9" and python_version < "4.0"
pygments==2.14.0 ; python_version >= "3.9" and python_version < "4.0"
python-slugify==8.0.1 ; python_version >= "3.9" and python_version < "4.0"
pyyaml==6.0 ; python_version >= "3.9" and python_version < "4.0"
requests-cache==0.9.8 ; python_version >= "3.9" and python_version < "4.0"
requests-cache==1.0.0 ; python_version >= "3.9" and python_version < "4.0"
requests==2.28.2 ; python_version >= "3.9" and python_version < "4"
restructuredtext-lint==1.4.0 ; python_version >= "3.9" and python_version < "4.0"
ruamel-yaml-clib==0.2.7 ; platform_python_implementation == "CPython" and python_version < "3.11" and python_version >= "3.9"
Expand Down
5 changes: 3 additions & 2 deletions scdlbot/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
BIN_PATH = os.getenv("BIN_PATH", "")
scdl_bin = local[os.path.join(BIN_PATH, "scdl")]
bcdl_bin = local[os.path.join(BIN_PATH, "bandcamp-dl")]
BCDL_ENABLE = False
WORKERS = int(os.getenv("WORKERS", 2))
# TODO try to change to spawn or forkserver to save RAM
# https://stackoverflow.com/a/66113051
Expand Down Expand Up @@ -864,7 +865,7 @@ def run_async(coro):
cmd_name = ""
cmd_args = ()
cmd_input = None
if (DOMAIN_SC in host and DOMAIN_SC_API not in host) or (DOMAIN_BC in host):
if (DOMAIN_SC in host and DOMAIN_SC_API not in host) or (DOMAIN_BC in host and BCDL_ENABLE):
# If link is sc/bc, we try scdl/bcdl first:
if DOMAIN_SC in host and DOMAIN_SC_API not in host:
cmd = scdl_bin
Expand All @@ -884,7 +885,7 @@ def run_async(coro):
"--extract-artist", # Set artist tag from title instead of username
)
cmd_input = None
elif DOMAIN_BC in host:
elif DOMAIN_BC in host and BCDL_ENABLE:
cmd = bcdl_bin
cmd_name = str(cmd)
cmd_args = (
Expand Down

0 comments on commit 2803abc

Please sign in to comment.