GithubHelp home page GithubHelp logo

kijk2869 / discodo Goto Github PK

View Code? Open in Web Editor NEW
41.0 2.0 5.0 3.18 MB

Enhanced Audio Player for Discord

License: MIT License

Python 99.38% Dockerfile 0.62%
discord musicbot music-library python3 standalone node youtube python pypi

discodo's Introduction

Discodo

PyPI Docker Image Version (latest by date) PyPI - License GitHub Workflow Status GitHub Workflow Status

Discodo is an enhanced audio player for discord.

Features

  • Standalone Audio Node
  • Youtube Related Video Autoplay
  • Crossfade and Audio effects
  • Synced Youtube Video Subtitle

Documentation

More information can be found here.

Installation

Discodo requires Python 3.7 or higher

python -m pip install --upgrade discodo

On Linux environments, more dependencies are required.

Execution

Audio Node Server

Additional options can be seen with the --help flag

python -m discodo

Client libraries

Supported sources

  • All sources that can be extracted from youtube_dl
  • All formats that can be demuxed by libav

discodo's People

Contributors

akiacode avatar deepsource-autofix[bot] avatar deepsourcebot avatar dependabot[bot] avatar eunwoo1104 avatar harusame3144 avatar kijk2869 avatar minibox24 avatar restyled-commits avatar saidbysolo avatar wonderlandpark avatar yoruroong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

discodo's Issues

Guide to ubuntu(and derivatives) users experiencing 'illegal hardware instruction'

I solved this problem by running the following commands, and my system is Linux Mint 20 Ulyana.

sudo apt update
sudo apt install --no-install-recommends -y gcc libopus-dev python3-dev libnacl-dev
sudo apt install --no-install-recommends -y pkg-config ffmpeg libavformat-dev libavcodec-dev libavdevice-dev libavutil-dev libswscale-dev libavresample-dev libavfilter-dev
python3.8 -m pip install discodo --no-binary av --force

Please share your method of solving if you are using other distributions in the comments to contribute

discodo.DPYClient().register_local_node() 함수 호출 시 NotImplementedError 발생

register_local_node() 함수를 이용해 로컬 노드를 등록하려고 하면 다음과 같은 에러가 발생하면서 노드가 등록되지 않습니다.

Task exception was never retrieved
future: <Task finished name='Task-1' coro=<DPYClient._register_local_event() done, defined at D:\Programs\Python38\lib\site-packages\discodo\client\DPYClient.py:116> exception=NotImplementedError()>
Traceback (most recent call last):
  File "D:\Programs\Python38\lib\site-packages\discodo\client\DPYClient.py", line 121, in _register_local_event
    LocalNodeProc = await launchLocalNode(**launchOptions)
  File "D:\Programs\Python38\lib\site-packages\discodo\client\node.py", line 42, in launchLocalNode
    LocalNodeProc = await asyncio.create_subprocess_exec(
  File "D:\Programs\Python38\lib\asyncio\subprocess.py", line 236, in create_subprocess_exec
    transport, protocol = await loop.subprocess_exec(
  File "D:\Programs\Python38\lib\asyncio\base_events.py", line 1630, in subprocess_exec
    transport = await self._make_subprocess_transport(
  File "D:\Programs\Python38\lib\asyncio\base_events.py", line 491, in _make_subprocess_transport
    raise NotImplementedError
NotImplementedError

VoiceClient.skip시 AttributeError 발생

File "/usr/local/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped
    ret = await coro(*args, **kwargs)
  File "/green/Cogs/music.py", line 165, in _skip
    await voice.skip()
  File "/usr/local/lib/python3.8/site-packages/discodo/client/voice_client.py", line 99, in skip
    return (await self.query("skip", {"offset": offset}))["remain"]
  File "/usr/local/lib/python3.8/site-packages/discodo/client/voice_client.py", line 57, in query
    raise NodeException(*list(Data["traceback"].items())[0])
NodeException: AttributeError: 'NoneType' object has no attribute 'current'

System Info
OS: Ubuntu 20.04 LTS
Python Version: 3.8.6
Discodo Version: 2.3.13

Empty thumbnails and other attributes

I printed whole track source. But there is no value in thumbnail attribute

스크린샷 2021-01-07 오후 11 07 23

[INFO][MainCog][2021-01-07 23:06:44,396]: {'_type': 'AudioData', 'id': 'UwLFTav2IGQ', 'title': 'BIGONE - Imgonnaparty', 'webpage_url': 'https://www.youtube.com/watch?v=UwLFTav2IGQ', 'thumbnail': None, 'url': None, 'duration': 194, 'is_live': False, 'uploader': 'lovetoken', 'description': None, 'subtitles': {}, 'chapters': {}, 'related': False}

Also tested other videos, also unable to bring thumbnails.

[INFO][MainCog][2021-01-07 23:09:15,855]: {'_type': 'AudioData', 'id': 'E4NO9lnuVNo', 'title': '[MV] Forever 84 - 다모임 (염따, 더 콰이엇, 사이먼 도미닉, 팔로알토, 딥플로우) X 딩고 [DF FILM]', 'webpage_url': 'https://www.youtube.com/watch?v=E4NO9lnuVNo', 'thumbnail': None, 'url': None, 'duration': 242, 'is_live': False, 'uploader': 'dingo freestyle', 'description': None, 'subtitles': {}, 'chapters': {}, 'related': False}

[Deprecated] Sanic variables

Setting variables on Sanic instances is deprecated and will be removed in version 21.9.

You should change your Sanic instance to use instance.ctx.ClientManagers instead.

Remote AudioManager resume feature

The player should be able to recover.
However, to implement this feature, you need to change the way your current node server is managed.

Song crash sometimes

[2020-08-18 13:48:41,774] [Loader.py] [libav.matroska,webm:Loader] [ERROR]: File ended prematurely

may be occured in Stream ip tunneling.

오류

[2020-09-16 09:04:47,097] [event.py] [discodo.event:event] [INFO]: Voice Client of 621870504147681311 not found. create new one.
Task exception was never retrieved
future: <Task finished name='Task-22' coro=<DiscordEvent.parseVoiceServerUpdate() done, defined at /usr/local/lib/python3.8/dist-packages/discodo/event.py:53> exception=ValueError()>
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/discodo/event.py", line 63, in parseVoiceServerUpdate
    vc = VoiceClient(self.client, data)
  File "/usr/local/lib/python3.8/dist-packages/discodo/voice_client.py", line 18, in __init__
    super().__init__(*args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/discodo/voice_connector.py", line 42, in __init__
    self.encoder = opus.Encoder()
  File "/usr/local/lib/python3.8/dist-packages/discodo/natives/opus.py", line 150, in __init__
    raise ValueError
ValueError
[2020-09-16 09:04:47,350] [voice_client.py] [discodo.VoiceClient:voice_client] [INFO]: destroying voice client of 621870504147681311.
Exception ignored in: <function VoiceClient.__del__ at 0x7ff83802a0d0>
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/discodo/voice_client.py", line 90, in __del__
    if self.player and self.player.is_alive():
AttributeError: 'VoiceClient' object has no attribute 'player'

파이썬 3.8.2, 샘플코드로 !join을 실행할 때 디스코도 서버에서 오류가 발생함

IP Rotate Planner

To avoid 429 of youtube, discodo has to rotate ip.
It should be applied to youtube_dl and related fetcher.

(PTC-W0043) Unnecessary `delete` statement in a local scope

Description

Passing a local variable to a del statement results in that variable being removed from the local namespace. When exiting a function all local variables are deleted, so it is unnecessary to explicitly delete variables in such cases. It is recommended to remove this del statement. Not preferred: ```python def …

Occurrences

There is 1 occurrence of this issue in the repository.

See all occurrences on DeepSource → deepsource.io/gh/kijk2869/discodo/issue/PTC-W0043/occurrences/

오류 관련 질문

python 3.8.5, 샘플코드로 실행해 보았습니다. (!join 명령어)
discord.py 1.5.1, discodo 2.3.9입니다.

Ignoring exception in command join:
Traceback (most recent call last):
  File "C:\Users\user\AppData\Local\Programs\Python\Python38-32\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped
    ret = await coro(*args, **kwargs)
  File "E:\Happytree Samsung\Discord File\Team HT\Shrimp\Cogs\music2.py", line 18, in _join
    await self.bot.ws.voice_state(ctx.guild.id, ctx.author.voice.channel.id)
AttributeError: 'NoneType' object has no attribute 'voice_state'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\user\AppData\Local\Programs\Python\Python38-32\lib\site-packages\discord\ext\commands\bot.py", line 902, in invoke
    await ctx.command.invoke(ctx)
  File "C:\Users\user\AppData\Local\Programs\Python\Python38-32\lib\site-packages\discord\ext\commands\core.py", line 864, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "C:\Users\user\AppData\Local\Programs\Python\Python38-32\lib\site-packages\discord\ext\commands\core.py", line 94, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'NoneType' object has no attribute 'voice_state'

NoSearchResults(특정영상이 검색안되는문제)

Ignoring exception in command play:
Traceback (most recent call last):
  File "C:\Users\name\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped
    ret = await coro(*args, **kwargs)
  File "SECRET\MusicBot-master\MusicBot-master\cogs\play.py", line 18, in play
    Data = await VC.loadSource(Query)
  File "C:\Users\name\AppData\Local\Programs\Python\Python38\lib\site-packages\discodo\client\voice_client.py", line 69, in loadSource
    return (await self.query("loadSource", {"query": Query}))["source"]
KeyError: 'source'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\name\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\ext\commands\bot.py", line 903, in invoke
    await ctx.command.invoke(ctx)
  File "C:\Users\name\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\ext\commands\core.py", line 859, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "C:\Users\name\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\ext\commands\core.py", line 94, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: KeyError: 'source'

검색영상- 당신을 기다리는 여우 설야
ㄴ 유튜브에서는 정상적으로 잘 나옴, 모듈내에서 검색이 불가한 증상

Running it on Raspi 4

ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-b12nueh3/av/setup.py'"'"'; file='"'"'/tmp/pip-install-b12nueh3/av/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-at90a7e2
cwd: /tmp/pip-install-b12nueh3/av/
Complete output (48 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-aarch64-3.8
creating build/lib.linux-aarch64-3.8/av
copying av/init.py -> build/lib.linux-aarch64-3.8/av
copying av/main.py -> build/lib.linux-aarch64-3.8/av
copying av/datasets.py -> build/lib.linux-aarch64-3.8/av
copying av/deprecation.py -> build/lib.linux-aarch64-3.8/av
creating build/lib.linux-aarch64-3.8/av/container
copying av/container/init.py -> build/lib.linux-aarch64-3.8/av/container
creating build/lib.linux-aarch64-3.8/av/data
copying av/data/init.py -> build/lib.linux-aarch64-3.8/av/data
creating build/lib.linux-aarch64-3.8/av/audio
copying av/audio/init.py -> build/lib.linux-aarch64-3.8/av/audio
creating build/lib.linux-aarch64-3.8/av/filter
copying av/filter/init.py -> build/lib.linux-aarch64-3.8/av/filter
creating build/lib.linux-aarch64-3.8/av/codec
copying av/codec/init.py -> build/lib.linux-aarch64-3.8/av/codec
creating build/lib.linux-aarch64-3.8/av/video
copying av/video/init.py -> build/lib.linux-aarch64-3.8/av/video
creating build/lib.linux-aarch64-3.8/av/sidedata
copying av/sidedata/init.py -> build/lib.linux-aarch64-3.8/av/sidedata
creating build/lib.linux-aarch64-3.8/av/subtitles
copying av/subtitles/init.py -> build/lib.linux-aarch64-3.8/av/subtitles
running build_ext
running config
PyAV: 8.0.3 (unknown commit)
Python: 3.8.5 (default, Jan 27 2021, 15:41:15) \n[GCC 9.3.0]
platform: Linux-5.4.0-1035-raspi-aarch64-with-glibc2.29
extension_extra:
include_dirs: [b'include']
libraries: []
library_dirs: []
define_macros: []
runtime_library_dirs: []
config_macros:
PYAV_COMMIT_STR="unknown-commit"
PYAV_VERSION=8.0.3
PYAV_VERSION_STR="8.0.3"
Could not find libavformat with pkg-config.
Could not find libavcodec with pkg-config.
Could not find libavdevice with pkg-config.
Could not find libavutil with pkg-config.
Could not find libavfilter with pkg-config.
Could not find libswscale with pkg-config.
Could not find libswresample with pkg-config.

ERROR: Failed building wheel for av

VoiceClient.state raises AttributeError on specific condition.

VoiceClient.state raises AttributeError when its just created or never played any song.

Traceback (most recent call last):
  File "C:\Users\sions\PycharmProjects\slashm\cogs\music.py", line 70, in play
    is_playing = codo.state == "playing"
  File "C:\Users\sions\AppData\Local\Programs\Python\Python37\lib\site-packages\discodo\voice_client.py", line 127, in state
    if not self.Queue and not self.player.current:
AttributeError: 'NoneType' object has no attribute 'current'

Code:

codo = self.bot.discodo.getVC(ctx.guild.id, safe=True)
if not codo:
    await self.bot.connect_voice(ctx.guild, ctx.author.voice.channel)
    await ctx.send(content="음성 채널에 연결했어요! 잠시만 기다려주세요...") # Delays so vc can be created.
    codo = self.bot.discodo.getVC(ctx.guild.id, safe=True)
try:
    is_playing = codo.state == "playing" # Here is where exception occur
except Exception as ex:
    __import__("traceback").print_exc()
    is_playing = False

༼ つ ◕_◕ ༽つ

Ignoring exception in on_message
Traceback (most recent call last):
  File "C:\Users\yoru\AppData\Local\Programs\Python\Python37\lib\site-packages\discord\client.py", line 333, in _run_event
    await coro(*args, **kwargs)
  File "test.py", line 65, in on_message
    Source = await vc.loadSource(message.content[5:].strip())
  File "C:\Users\yoru\AppData\Local\Programs\Python\Python37\lib\site-packages\discodo\client\voice_client.py", line 70, in loadSource
    return (await self.query("loadSource", {"query": Query}))["source"]
KeyError: 'source'

await self.query("loadSource", {"query": Query})

{'traceback': {'JSONDecodeError': 'Extra data: line 1 column 258633 (char 258632)'}, 'guild_id': 621870504147681311}

server(ubuntu 20.04)

[2020-12-12 08:33:43,024] [websocket.py] [discodo.server:websocket] [INFO]: new websocket connection created from 
[2020-12-12 08:33:44,456] [event.py] [discodo.event:event] [INFO]: recieve self voice update. set session id 9544877c55b74a23ac04b5faa78f065e
[2020-12-12 08:33:44,459] [event.py] [discodo.event:event] [INFO]: Voice Client of 621870504147681311 not found. create new one.
[2020-12-12 08:33:44,646] [event.py] [discodo.event:event] [INFO]: Voice server update recieved. connect to new endpoint
[2020-12-12 08:33:44,646] [voice_connector.py] [discodo.VoiceConnector:voice_connector] [INFO]: voice endpoint south-korea367.discord.media detected.
[2020-12-12 08:33:44,709] [gateway.py] [discodo.gateway:gateway] [INFO]: select encrypt mode xsalsa20_poly1305_suffix
[2020-12-12 08:33:44,721] [gateway.py] [discodo.gateway:gateway] [INFO]: recieved voice secret key.
[2020-12-12 08:33:47,292] [search.py] [discodo.extractor.youtube:search] [INFO]: Downloading search page of how far ill go
[2020-12-12 08:33:48,150] [search.py] [discodo.extractor.youtube:search] [INFO]: Downloading search page of how far ill go

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.