Comments (8)
@IgorDubois Try using Python 2.7, that's what this was coded with. :X Sorry for that.
from bandcamp-dl.
I've forked and modified it a bit so that it works. (In Python 3.5.2 at least)
In the process I also had to modify Slugify and include it as the author seems to have abandoned it.
deps.txt and requirements.txt have been modified appropriately, must be cloned and installed from source using the instructions as I'm not about to put it on pypi (Its your project) and I'm not comfortable making a PR for it to be merged yet.
I might make a PR after I:
Recode some stuff to use asyncio/aiohttp
Merge @Bendito999's changes
Write my own function to replace Slugify.
Improve default file naming e.g: Foo - Bar (Ft. Baz).mp3
vs. foo-bar-ft-baz.mp3
. --template
would override.
No idea when I might do these things though, but hey at least it works in the mean time eh?
from bandcamp-dl.
Yeah. I'm wondering if there's a way we can make this work with both Python 3 and Python 2? 🤔
from bandcamp-dl.
I've kinda got it cross-compatible as-in it at least grabs the tracks and names them from a bc album/page link.
Currently not working:
Metadata
Album art
Progress bar (Broken in Python 2.7.11 and 3.5.2)
If the progress bar is part of wgetter (I would assume so) I might end up replacing it anyway, as having wgetter and requests is kind of redundant.
Possibly more. I'll mess around with it some more later :)
Edit: In case its not obvious I have not committed my most recent changes in my fork.
from bandcamp-dl.
@Evolution0 I think the point of having wgetter
was in order to have an easy way to download files to a specific output file more easily than you can do with Requests. Been awhile since I've worked on this script but that was my thought process around it.
from bandcamp-dl.
Hm, currently it is:
tmp_file = wgetter.download(track_url, outdir=dirname)
os.rename(tmp_file, filename)
With requests:
r = requests.get(track_url, stream=True)
with open(dirname + "/" + filename, "wb") as file:
file.write(r.content)
Not much harder and gets rid of a dep.
Edit: As a side effect of trying this out I noticed create_directory returns a strangely formed path (In my case):
'D:\\bandcamp-dl\\bandcamp-dl\\bandcamp_dl/the-enigma-tng/asia-deth'
Its mixing back and forward slashes because os.path isn't getting free reign to form the path itself. Its pretty smart, you can just set artist and album as folder names then join them to get the path.
I think maybe wgetter autocorrected the path?
from bandcamp-dl.
@Evolution0 - Yeah, that may be the case. I honestly wasn't sure how WGetter was handling it, but it's a thin wrapper around wget
so it probably does auto-correct the paths.
from bandcamp-dl.
I found that the path formed by template_to_path was perfectly fine but when using requests to download the track I only needed the filename variable.
I removed what Python 2.7.X code I had for backwards compatibility while I sorted the dependency issue out.
I got everything working under Python 3.5.2 with the latest version of the deps, current dep list looks like this:
beautifulsoup4==4.5.1
docopt==0.6.2
lxml==3.6.4
mutagen==1.35.1
ply==3.9
requests==2.12.3
slimit==0.8.1
unicode-slugify==0.1.3
I added the progress bar back in without using a module so that is nice.
Now I just need to make it cross-compatible without making a mess of the code this time.
from bandcamp-dl.
Related Issues (20)
- Track lyrics not being embedded when downloading track URLS HOT 2
- Default download directory woes HOT 5
- bandcamp-dl cannot be installed with setuptools >= 58.0.2 due to "demjson" dependency HOT 2
- Error running the script HOT 1
- SOCKS proxy support HOT 3
- Can't download album art HOT 5
- Use less verbose output when finish album download HOT 3
- Unable to download track HOT 3
- Arch PyPI installation command not found HOT 1
- Feature to change location of download HOT 3
- bandcamp-dl command doesnt work anymore HOT 1
- Config file support HOT 4
- Download full wishlist
- --assume-yes option HOT 6
- Downloading doesn't work (TypeError: 'NoneType' object is not subscriptable) HOT 1
- ModuleNotFoundError HOT 3
- Consider editing repository setings to remove "Packages" section HOT 1
- unable to get local issuer certificate HOT 4
- Better error message, if download is not available (incorrect link) HOT 1
- Private tracks bypass - ONLY if private tracks are accessible online HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bandcamp-dl.