diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..3654105 --- /dev/null +++ b/flake.nix @@ -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 + ] + )) + ]; + + }; + }; +} diff --git a/free_bandcamp_downloader/bc_free_downloader.py b/free_bandcamp_downloader/bc_free_downloader.py index bb26e78..c6ece17 100644 --- a/free_bandcamp_downloader/bc_free_downloader.py +++ b/free_bandcamp_downloader/bc_free_downloader.py @@ -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: diff --git a/pyproject.toml b/pyproject.toml index 2ce1b38..b47b116 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" ]