add flake.nix dev shell
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
{
|
||||
description = "free-bandcamp-downloader flake";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs";
|
||||
};
|
||||
|
||||
outputs =
|
||||
{ self, nixpkgs, ... }:
|
||||
let
|
||||
|
||||
system = "x86_64-linux";
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
packageOverrides = pkgs.callPackage ./python-packages.nix { };
|
||||
python = pkgs.python3.override { inherit packageOverrides; };
|
||||
|
||||
in
|
||||
{
|
||||
devShells.x86_64-linux.default = pkgs.mkShell {
|
||||
|
||||
packages = [
|
||||
(python.withPackages (
|
||||
p: with p; [
|
||||
requests
|
||||
beautifulsoup4
|
||||
tqdm
|
||||
urllib3
|
||||
docopt-ng
|
||||
pyrfc6266
|
||||
python-guerrillamail
|
||||
]
|
||||
))
|
||||
];
|
||||
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -163,26 +163,6 @@ class BCFreeDownloader:
|
||||
os.remove(file_name)
|
||||
return glob.glob(os.path.join(dir_name, "*"))
|
||||
|
||||
# Tag downloaded audio file with url & comment
|
||||
@staticmethod
|
||||
def tag_file(file_name: str, head_data: Dict):
|
||||
try:
|
||||
f = mutagen.File(file_name)
|
||||
if f is None:
|
||||
return
|
||||
|
||||
f["website"] = head_data["@id"]
|
||||
if head_data.get("keywords"):
|
||||
f["genre"] = head_data["keywords"]
|
||||
comment = ""
|
||||
comment += head_data.get("description", "").strip()
|
||||
comment += "\n\n" + head_data.get("creditText", "")
|
||||
f["comment"] = comment.strip()
|
||||
f.save()
|
||||
except Exception:
|
||||
# only should happen if the file doesn't support tags
|
||||
pass
|
||||
|
||||
def _download_purchased_album(
|
||||
self, user_id: int, tralbum_data: Dict
|
||||
) -> DownloadRet:
|
||||
|
||||
@@ -14,7 +14,6 @@ dependencies = [
|
||||
"beautifulsoup4>=4.12.2,<5.0.0",
|
||||
"tqdm>=4.66.1,<5.0.0",
|
||||
"pyrfc6266>=1.0.2,<2.0.0",
|
||||
"mutagen>=1.47.0,<2.0.0",
|
||||
"docopt-ng>=0.9.0,<1.0.0",
|
||||
"python-guerrillamail>=0.2.0,<1.0.0"
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user