I'm using the python-vlc library to play audio.
import vlc
import time
player = vlc.MediaPlayer('https://r1---sn-cu-nuoe.googlevideo.com/videoplayback?ip=5.81.184.196&sparams=clen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&gir=yes&id=o-AHt-uyg7B2wvOuqq_PMrTGhjp-zwBd_fKvwvxFrryBFF&expire=1508865966&keepalive=yes&initcwndbps=913750&ipbits=0&mime=audio%2Fwebm&dur=205.008&lmt=1500954362115026&key=yt6&itag=171&source=youtube&requiressl=yes&clen=3247546&mm=31&mn=sn-cu-nuoe&ei=TiPvWYqfBtaBVI2ZurAI&ms=au&mt=1508844287&pl=25&mv=m&signature=C509ED606089E3A98A4740C2AD355F663A8DC0C8.86347E6F134BC6953927084455DC74A7371F0893&ratebypass=yes')
player.audio_set_volume(20)
player.play()
time.sleep(100)
I get the url from youtube-dl like this:
youtube-dl -g -f "bestaudio" <video-id>
It works fine initially however at a seemingly random point and not with every file this error message appears:
[02f8a9a4] gnutls tls session error: Error in the pull function.
[02fdba24] core access error: read error: No error
I've run it again with GNUTLS_DEBUG_LEVEL=99
and got this (last few lines included here)
gnutls[4]: REC[0392A0D0]: SSL 3.3 Application Data packet received. Epoch 0, length: 16408
gnutls[4]: REC[0392A0D0]: Expected Packet Application Data(23)
gnutls[4]: REC[0392A0D0]: Received Packet Application Data(23) with length: 16408
gnutls[7]: READ: Got 16408 bytes from 000003EC
gnutls[7]: READ: read 16408 bytes from 000003EC
gnutls[7]: RB: Have 5 bytes into buffer. Adding 16408 bytes.
gnutls[7]: RB: Requested 16413 bytes
gnutls[4]: REC[0392A0D0]: Decrypted Packet[27] Application Data(23) with length: 16384
gnutls[6]: BUF[REC]: Inserted 16384 bytes of Data(23)
gnutls[7]: READ: -1 returned from 000003EC, errno=0 gerrno=0
gnutls[2]: ASSERT: gnutls_buffers.c:336
gnutls[2]: ASSERT: gnutls_buffers.c:521
gnutls[2]: ASSERT: gnutls_record.c:1026
gnutls[2]: ASSERT: gnutls_record.c:1146
gnutls[2]: ASSERT: gnutls_record.c:1393
[02f8a9a4] gnutls tls session error: Error in the pull function.
[02fdba24] core access error: read error: No error
VLC version: 2.2.6
Edit: I've reproduced the same error in proper VLC. The errors at the point of failure are the same, here is the full log.
Looks like this was a bug in VLC 2.2.6
Trying the nightlies (specifically 3.0.0) I've not yet had any problems so I think it's been fixed.