Skip to content
This repository has been archived by the owner on Jun 28, 2022. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
kijk2869 committed Sep 27, 2020
2 parents 23eab24 + e40fb38 commit 9d75ea9
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 3 deletions.
26 changes: 25 additions & 1 deletion discodo/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
from hypercorn.config import Config as hypercornConfig
from websockets import auth

from .config import Config
from . import __version__
from .config import Config

log = logging.getLogger("discodo")

Expand Down Expand Up @@ -182,6 +182,27 @@ def is_valid_file(parser, args):
help="seconds to cleanup player when connection of discord terminated (default: 300)",
)

extExtractorParser = parser.add_argument_group("Extra Extractor Option")

extExtractorParser.add_argument(
"--enabled-extractor",
action="append",
default=[],
help="Extra extractors to enable (Support melon and spotify)",
)
extExtractorParser.add_argument(
"--spotify-id",
type=str,
default=None,
help="Spotify API id (default: None)",
)
extExtractorParser.add_argument(
"--spotify-secret",
type=str,
default=None,
help="Spotify API secret (default: None)",
)

logParser = parser.add_argument_group("Logging Option")

logParser.add_argument(
Expand All @@ -204,6 +225,9 @@ def is_valid_file(parser, args):
Config.DEFAULT_GAPLESS = args.default_gapless
Config.BUFFERLIMIT = args.bufferlimit
Config.VCTIMEOUT = args.timeout
Config.ENABLED_EXT_EXTRACTOR = args.enabled_extractor
Config.SPOTIFY_ID = args.spotify_id
Config.SPOTIFY_SECRET = args.spotify_secret
else:
verbose = args.config.pop("verbose", False)

Expand Down
3 changes: 2 additions & 1 deletion discodo/client/voice_client.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import asyncio

from ..utils import EventDispatcher


Expand Down Expand Up @@ -131,4 +132,4 @@ async def lyricsDone(Data):
return Data

async def destroy(self) -> dict:
return await self.query("VC_DESTROY", Event="VC_DESTROYED")
return await self.query("VC_DESTROY", Event="VC_DESTROYED")
4 changes: 3 additions & 1 deletion discodo/server/events.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import asyncio
import uuid

from discodo.source import SubtitleSource

from ..errors import NotConnected, NotPlaying
from ..source import AudioData
from ..status import getStatus
Expand Down Expand Up @@ -384,4 +386,4 @@ async def requestSubtitle(self, Data: dict) -> None:
"language": Data["language"],
},
}
return await self.sendJson(payload)
return await self.sendJson(payload)

0 comments on commit 9d75ea9

Please sign in to comment.