Code Monkey home page Code Monkey logo

darkempire78 / music-discord-bot Goto Github PK

View Code? Open in Web Editor NEW
93.0 3.0 51.0 961 KB

A music Discord bot with more than 30+ commands which allows to play music on your server efficiently. Supports Youtube, Spotify, Deezer and Soundcloud links. Skips intros and blanks in the music with Sponsorblock.

Home Page: https://top.gg/bot/796749718217555978

License: GNU General Public License v3.0

Python 99.31% Dockerfile 0.69%
discord discord-bot discord-py discordbot discord-music-bot music-bot-discord discord-bot-music music deezer soundcloud

music-discord-bot's Issues

Use StreamURLFetcher & PyTube instead of youtube_dl

Hi there!

I recently saw this project from you.
I'm maintainer of youtube-search-python & I made few additions to my project which you might like.

As you might be aware, that youtube_dl or vanilla PyTube is kinda slow to get video URLs as they make "additional web requests" for getting the exact same response which you already have when displaying it to the user.

from youtubesearchpython import *
fetcher = StreamURLFetcher() # Instantiate this class only once (makes web requests).

video = Video.get("https://www.youtube.com/watch?v=aqz-KE-bpKQ") # Let's assume you get information of this video for displaying.
url = fetcher.get(video, 251) # You can use same response to get its stream URL (Very fast, does not make any requests).
print(url)

See more here.

Thankyou, I just wanted to let you know.

NOTE: I'm not sure how stable it is at the moment, but is definitely worth trying.
You may close (or delete) this issue, once you read.

KeyError

Hello, today i tried to setup this musicbot. everything worked fine, i added my spotify ClientID, ClientSecret & my Discordtoken into the configfile. however now if i try to run it it print out a error that i cant fix my myself. Here is the error written in text:

D:\Downloads\downloaded_pythonprojects\Music-Discord-Bot-main>main.py
Traceback (most recent call last):
  File "D:\Downloads\downloaded_pythonprojects\Music-Discord-Bot-main\main.py", line 72, in <module>
    spotifyAppToken = tekore.request_client_token(spotifyClientId, spotifyClientSecret)
  File "D:\python\lib\site-packages\tekore\_auth\util.py", line 204, in request_client_token
    return cred.request_client_token()
  File "D:\python\lib\site-packages\tekore\_auth\refreshing.py", line 148, in request_client_token
    token = self._client.request_client_token()
  File "D:\python\lib\site-packages\tekore\_sender\client.py", line 79, in wrapper
    return post_func(request, response, *params)
  File "D:\python\lib\site-packages\tekore\_auth\expiring\decor.py", line 30, in func
    return Token(response.content, uses_pkce)
  File "D:\python\lib\site-packages\tekore\_auth\expiring\token.py", line 39, in __init__
    self._scope = Scope(*token_info['scope'].split(' '))
KeyError: 'scope'

and here a screenshot:
image

While using Move Command raised an exception: AttributeError: 'tuple' object has no attribute 'title' and 'url'

Command raised an exception: AttributeError: 'tuple' object has no attribute 'title'
and
Command raised an exception: AttributeError: 'tuple' object has no attribute 'title'

The problem is
Cogs/move.py

embed = discord.Embed(title="Song moved", description=f"- [**{trackToMove.title}**]({trackToMove.uri}) was moved from `{indexFromFake}` to `{indexToFake}`.",

here trackToMove is a tuple inside a list,
so better use trackToMove[index_number_of_title] and trackToMove[index_number_of_url]

so solve is

embed = discord.Embed(title="Song moved", description=f"- [**{trackToMove[5]}**]({trackToMove[4]}) was moved from `{indexFromFake}` to `{indexToFake}`.",

mysql.connector

Refuse to import the module mysql
ModuleNotFoundError: No module named 'mysql'

Missing from requirements.txt + playlist limits

Hi
After some time managed to run it, well there are some glitches with music,
i don't know if it's because Lavalink, but i see its resource usage is minimal yet
periodically stutters, what's worse is sometimes then speeds up to match timestamp,
occasionally quality drops, so many problems, maybe its Discord? I'm new to all this.
I think these are missing from requirements.txt
wavelink
youtube-search-python
psutil
Also the 15 limit for playlist is absurd, queues too, either remove or raise.
Also the shuffle isn't working as advertised :) but i see you have task for that.
Thanks

Age restriction

Hello, i have a issue with play music with an age restriction.

While using remove Command raised an exception: AttributeError: 'Bot' object has no attribute 'music'

Problem while trying to remove a song from the queue it shows that error
the problem is in
Cogs/removeRemoverange.py

if (int(index) - 1) > len(self.bot.music[ctx.guild.id]["musics"]): return await ctx.channel.send(f"{self.bot.emojiList.false} {ctx.author.mention} The index is invalid!")

Solve,

just comment out these 2 line no need for any use.

after commenting it out it will show another error,

Command raised an exception: IndexError: list index out of range

because
track = tracks[index]

solve is

track = tracks[index-2]

Command raised an exception: ZeroConnectedNodes:

Its return a error in Discord Channel when i put any Yt,Spotify or other link on my command Play.

[Command raised an exception: ZeroConnectedNodes: ]

WEBSOCKET | Connection Failure::
Traceback (most recent call last):
File "C:\Users\elemesmo\anaconda3\lib\site-packages\wavelink\websocket.py", line 76, in _connect
self._websocket = await self._node.session.ws_connect(uri, headers=self.headers, heartbeat=self._node.heartbeat)
File "C:\Users\elemesmo\anaconda3\lib\site-packages\aiohttp\client.py", line 754, in _ws_connect
resp = await self.request(
File "C:\Users\elemesmo\anaconda3\lib\site-packages\aiohttp\client.py", line 544, in _request
await resp.start(conn)
File "C:\Users\elemesmo\anaconda3\lib\site-packages\aiohttp\client_reqrep.py", line 905, in start
self._continue = None
File "C:\Users\elemesmo\anaconda3\lib\site-packages\aiohttp\helpers.py", line 656, in exit
raise asyncio.TimeoutError from None
asyncio.exceptions.TimeoutError

I Have everything running great in MySQL. I think its some problem with youtubedl

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.