~exprez135/muffinwoman

70b0eb97c344bcfcad3811032b92bd9a46253c5e — Nate Ijams 3 years ago da6b1cd
Add reconnect youtube-dl options.

Attempts to fix tls disconnect error:
	[tls @ 0x5619f42c0b80] Error in the pull function.
	[matroska,webm @ 0x5619f42bd880]
	Read error[tls @ 0x5619f42c0b80]
	The specified session has been invalidated for some reason.
		Last message repeated 1 times
2 files changed, 7 insertions(+), 2 deletions(-)

M src/cogs/music.py
M src/video.py
M src/cogs/music.py => src/cogs/music.py +6 -1
@@ 40,7 40,12 @@ class Music (Cog):

  # Plays a song on a voice channel
  def play_song(self, botvoice, song):    
    source = discord.FFmpegPCMAudio(song.stream_url)

    # Get new stream url before playing

    updated_song = Video(song.url, song.user)

    source = discord.FFmpegPCMAudio(updated_song.stream_url, before_options="-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5")
    
    def after_playing(err):
      if len(self.playlist) > 0:

M src/video.py => src/video.py +1 -1
@@ 9,7 9,7 @@ import youtube_dl
YTDL_OPTS = {
    "default_search": "ytsearch",
    "format": "bestaudio/best",
    "quiet": True,
    "quiet": False,
    "extract_flat": "in_playlist",
    'postprocessors': [{
      'key': 'FFmpegExtractAudio',