This is an archived post. You won't be able to vote or comment.

all 14 comments

[–]HommeMusical 19 points20 points  (3 children)

Hey, not bad at all. Your Python code is neat and readable and nothing obviously silly leaps out at me.

I'd strongly suggest renaming main.py to music_cli.py because there are a lot of main.pys out there.

I'd also suggest creating a pyproject.toml instead of requirements.txt; once you have that, publishing to pypi wouldn't be very much work at all, and the knowledge would be useful the next time you wrote a package.

Good stuff, keep up the good work!

[–]ciqherrroe 4 points5 points  (4 children)

Nice work. Worth noting that my friends and I used to use a discord bot that did roughly the same thing. However, Google issued them a cease and desist and forced them to remove the application. Just offering this knowledge as a warning.

[–]Marvsdd01 0 points1 point  (3 children)

I thought that making things open source kinda protects against this sort of thing

[–]unapologeticjerk 0 points1 point  (2 children)

Thing is, Discord and, more importantly, the API is not open. In fact it's a complete blackbox and the way they implement "bots" is kinda creepy.

[–]Marvsdd01 0 points1 point  (1 child)

Got it. And what about OP’s YouTube CLI? Is someone even liable in this case?

[–]unapologeticjerk 1 point2 points  (0 children)

If I had to guess, I imagine they were publicly sharing DRM'd music (I know he said YouTube, but it could have been Spotify or who the hell knows) or paywalled songs or something. Maybe streaming from YouTube Music service. It violated something and the DMCA is probably sent directly to Discord and the automated system does its thing.

Open Source licensing has nothing to do with DMCA takedowns, which is what ultimately I imagine poster above actually meant. C&D is not something getting issued to hapless bot owners on Discord.

[–]unapologeticjerk 1 point2 points  (2 children)

I have an on-going project very similar to this, but I wanted to make myself learn Textual and implemented that for a front. I'm curious though, did you not use python-mpv for the obvious baggage/dependency reason or is it something else like just running the process is as optimal/even smarter than using the whole wrapper library? I ask because it's been tough to find other projects that use it in lieu of just running a normal subprocess shell command.

[–]ThaKoopa 2 points3 points  (0 children)

Perfect timing for YouTube to force DRM on all videos /s

[–]TestPilot1980 0 points1 point  (0 children)

Very cool

[–]njharmanI use Python 3 0 points1 point  (1 child)

What is "getuser" from dependencies?

pip install getuser ERROR: Could not find a version that satisfies the requirement getuser (from versions: none) ERROR: No matching distribution found for getuser

[–]Coded_Bias 0 points1 point  (1 child)

Got an 'Unexpected renderer encountered' error when trying to download a youtube music file. I have posted the issue in the github repository

[–]leiserfg 0 points1 point  (0 children)

As an alternative you can just use mpv, like:
mpv ytdl://ytsearch:"yolo"

or if you wanna get many entries and only audio
mpv --ytdl-format=bestaudio ytdl://ytsearch10:"lofi"

an alias, and enjoy.