Comments (8)
Live streams ain't supported by youtube-dl to incorporate playback of https links @Raptor123471 trying adding lavalink.py/wavelink to your repo. These libraries ensure playback of songs/streams by running parallel to the main source code. @miniboy0624 as you say it plays for some time and stops, it is due to the fact that youtube-dl downloads/extracts audio first and then streams it to the vc.
from dingolingo.
@miniboy0624 try adding this under commands/music.py
@commands.command()
async def stream(self, ctx, *, url):
"""Streams from a url (same as yt, but doesn't predownload)"""
async with ctx.typing():
player = await YTDLSource.from_url(url, loop=self.bot.loop, stream=True)
ctx.voice_client.play(player, after=lambda e: print(f'Player error: {e}') if e else None)
await ctx.send(f'Now playing: {player.title}')
This will stream audio from the provided url rather than downloading it, hope it helps!
from dingolingo.
Can you send me the link to the livestream? It is currently working on my instance.
from dingolingo.
I mean any livestream from YouTube.
When I played the livestream, it showed the following result and started the livestream for a few seconds, then no sound came out.
from dingolingo.
I am not able to reproduce this issue on my instance. The live stream you provided has been playing for 30mins now. Is that the full output with the issue you are having? Try updating all of your dependencies if you have not already.
from dingolingo.
@PythonicBoat youtube-dl does support live-streams and my current instance has no problem with the livestream provided. I believe @miniboy0624 may have outdated dependancies.
from dingolingo.
well with doesn't 'suppport', I had meant the way in which audio playback was. The play command in your repo, by default fetches the url, downloads, extracts and then play it. Doing so for livestreams might be buggy (it completely depends upon your hosting server and network connection) as it will have to continuously fetch and stream it. Thus, alternatively i had mentioned the use of wavelink/lavalink. Though my above post contains a stream command, which instead of downloading the stream will play it directly.
from dingolingo.
Thank you for help, I will try to use the way u guys said. :)
from dingolingo.
Related Issues (20)
- Remove nickname setting?
- Deezzer HOT 1
- Config errror HOT 2
- TypeError: Client.start() got an unexpected keyword argument 'bot' HOT 2
- Update requirements HOT 1
- Songs with colons (:) in their names causes the Bot to stop working. HOT 3
- missing 1 required keyword-only argument: 'intents' HOT 3
- Not Working on Heroku HOT 3
- Change discord-py to py-cord. HOT 1
- Running bot as .pyw prevents music from playing HOT 2
- Bot doesn't respond to any command, and gives error. HOT 5
- Help HOT 2
- The bot doesn't play anything HOT 4
- Nothing gets added to queue HOT 3
- I can't use commands HOT 3
- I have a problem with intents HOT 3
- run.py is missing intents (.galex_ on discord)
- Cant play music: ClientException: ffmpeg was not found. HOT 1
- The bot responds to commands but does not play songs
- The above exception was the direct cause of the following exception: HOT 1
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 dingolingo.