partial range get confuses backend players both DVDplayer, PapPlayer and also Mplayer

boogiepop

Developer
Jul 13, 2015
45
0
0
hi all

i am working on a link provider of musicmp3 [dot] ru. They are hosting their own audios and their web server does not response nicely to range http request.

what kodi does (i think thats curl's behaviour not so sure) is to play it properly first time if you ever play it and cache it locally.
On the second play it first steams locally and then asks for the rest of the file with http range request. But server does not return 206. (i dont know the exact response did not have to mim sniff the traffic.) and after that response ,kodi just plays several seconds and stops.

I have written some ninja-code to decode the whole site with bunch of weird obfuscuration now this is what i get, kodi is stupid enough to directly stream the http stream.

Anyways, i know kinkin and spoyser had some issues like that before just wanted know if there is a reasonable way to fix the issue. Like "dont use cache and directly stream this url switch" in URL. Dont wanna get in advanced settings because that prattically means that it wont work.

Code:
00:20:53 T:6316    INFO: XCURL::DllLibCurlGlobal::easy_aquire - Created session to https://listen.musicmp3.ru
00:20:54 T:5324   DEBUG: CTextureCacheJob::GetImageHash - unable to stat url http://boogie.us.to/dataserver/ump/images/musicmp3.png
00:20:57 T:6316   DEBUG: CCurlFile::GetMimeType - https://listen.musicmp3.ru/76703fe7443f2c9e/5103e45e674570df|Referer=None&Cookie=SessionId%3D7aimae743e4c29b0%3B&User-Agent=Mozilla%2F5.0+%28Macintosh%3B+Intel+Mac+OS+X+10_7_5%29+AppleWebKit%2F537.78.2+%28KHTML%2C+like+Gecko%29+Version%2F6.1.6+Safari%2F537.78.2 -> audio/mpeg
00:20:57 T:6316   DEBUG: Loading settings for https://listen.musicmp3.ru/76703fe7443f2c9e/5103e45e674570df|Referer=None&Cookie=SessionId%3D7aimae743e4c29b0%3B&User-Agent=Mozilla%2F5.0+%28Macintosh%3B+Intel+Mac+OS+X+10_7_5%29+AppleWebKit%2F537.78.2+%28KHTML%2C+like+Gecko%29+Version%2F6.1.6+Safari%2F537.78.2
00:20:57 T:6316   DEBUG: CPlayerCoreFactory::GetPlayers(https://listen.musicmp3.ru/76703fe7443f2c9e/5103e45e674570df|Referer=None&Cookie=SessionId%3D7aimae743e4c29b0%3B&User-Agent=Mozilla%2F5.0+%28Macintosh%3B+Intel+Mac+OS+X+10_7_5%29+AppleWebKit%2F537.78.2+%28KHTML%2C+like+Gecko%29+Version%2F6.1.6+Safari%2F537.78.2)
00:20:57 T:6316   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: system rules
00:20:57 T:6316   DEBUG: CPlayerSelectionRule::GetPlayers: matches rule: system rules
00:20:57 T:6316   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: mms/udp
00:20:57 T:6316   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: lastfm/shout
00:20:57 T:6316   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: rtmp
00:20:57 T:6316   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: rtsp
00:20:57 T:6316   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: streams
00:20:57 T:6316   DEBUG: CPlayerSelectionRule::GetPlayers: matches rule: streams
00:20:57 T:6316   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: aacp/sdp
00:20:57 T:6316   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: mp2
00:20:57 T:6316   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: dvd
00:20:57 T:6316   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: dvdimage
00:20:57 T:6316   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: sdp/asf
00:20:57 T:6316   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: nsv
00:20:57 T:6316   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: radio
00:20:57 T:6316   DEBUG: CPlayerCoreFactory::GetPlayers: matched 0 rules with players
00:20:57 T:6316   DEBUG: CPlayerCoreFactory::GetPlayers: adding audiodefaultplayer (3)
00:20:57 T:6316   DEBUG: CPlayerCoreFactory::GetPlayers: for video=0, audio=1
00:20:57 T:6316   DEBUG: CPlayerCoreFactory::GetPlayers: adding player: PAPlayer (3)
00:20:57 T:6316   DEBUG: CPlayerCoreFactory::GetPlayers: for video=1, audio=1
00:20:57 T:6316   DEBUG: CPlayerCoreFactory::GetPlayers: adding player: DVDPlayer (1)
00:20:57 T:6316   DEBUG: CPlayerCoreFactory::GetPlayers: added 2 players
00:20:57 T:6316   DEBUG: CCurlFile::GetMimeType - https://listen.musicmp3.ru/76703fe7443f2c9e/5103e45e674570df|Referer=None&Cookie=SessionId%3D7aimae743e4c29b0%3B&User-Agent=Mozilla%2F5.0+%28Macintosh%3B+Intel+Mac+OS+X+10_7_5%29+AppleWebKit%2F537.78.2+%28KHTML%2C+like+Gecko%29+Version%2F6.1.6+Safari%2F537.78.2 -> audio/mpeg
00:20:57 T:6316   DEBUG: CFileCache::Open - opening <76703fe7443f2c9e/5103e45e674570df> using cache
00:20:57 T:6316   DEBUG: CurlFile::Open(0A67B648) https://listen.musicmp3.ru/76703fe7443f2c9e/5103e45e674570df
00:20:59 T:6444   DEBUG: Thread FileCache start, auto delete: false
00:20:59 T:6316   DEBUG: CDVDDemuxFFmpeg::Open - p*****g detected format [mp3]
00:20:59 T:6316   DEBUG: CDVDDemuxFFmpeg::Open - setting usetoc to 0 for accurate VBR MP3 seek
00:20:59 T:6444    INFO: XCURL::DllLibCurlGlobal::easy_aquire - Created session to https://listen.musicmp3.ru
00:20:59 T:6444   DEBUG: CurlFile::CReadState::Connect - Resume from position 91197
00:21:01 T:6444   ERROR: CCurlFile::FillBuffer - Failed: Requested range was not delivered by the server(33)
00:21:01 T:6444    INFO: CFileCache::Process - Hit eof.
00:21:01 T:6316   DEBUG: XFILE::CFileCache::Seek - waiting for position 156605.
00:21:01 T:6316 WARNING: XFILE::CFileCache::Seek - failed to get remaining data
00:21:01 T:6316    INFO: ffmpeg[18AC]: [mp3] Skipping 0 bytes of junk at 417.
00:21:01 T:6316   DEBUG: CDVDDemuxFFmpeg::Open - avformat_find_stream_info starting
00:21:01 T:6316   DEBUG: CDVDDemuxFFmpeg::Open - av_find_stream_info finished
00:21:01 T:6316    INFO: ffmpeg[18AC]: Input #0, mp3, https://listen.musicmp3.ru/76703fe7443f2c9e/5103e45e674570d':
00:21:01 T:6316    INFO: ffmpeg[18AC]:   Duration: 00:00:09.77, start: 0.025057, bitrate: 128 kb/s
00:21:01 T:6316    INFO: ffmpeg[18AC]:     Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16p, 128 kb/s
00:21:01 T:6316    INFO: ffmpeg[18AC]:     Metadata:
00:21:01 T:6316    INFO: ffmpeg[18AC]:       encoder         : LAME3.98r
00:21:01 T:6316    INFO: ffmpeg[18AC]:     Side data:
00:21:01 T:6316    INFO: ffmpeg[18AC]:       replaygain: track gain - -3.200000, track peak - unknown, album gain - unknown, album peak - unknown,
00:21:01 T:6316   DEBUG: CDVDDemuxFFmpeg::AddStream(0, ...) -> 0
00:21:01 T:6316   DEBUG: FactoryCodec - Audio: passthrough - Opening
00:21:01 T:6316   DEBUG: FactoryCodec - Audio: passthrough - Failed
00:21:01 T:6316   DEBUG: FactoryCodec - Audio: FFmpeg - Opening
00:21:01 T:6316   DEBUG: FactoryCodec - Audio: FFmpeg - Opened
00:21:01 T:6316   DEBUG: ffmpeg[18AC]: [mp3] Could not update timestamps for skipped samples.
00:21:01 T:6316   DEBUG: CDVDDemuxFFmpeg::SeekTime - seek ended up on time 0
00:21:01 T:6316   DEBUG: Previous line repeats 1 times.
00:21:01 T:6316   DEBUG: ffmpeg[18AC]: [mp3] Could not update timestamps for skipped samples.
00:21:01 T:6316   DEBUG: AudioDecoder::GetReplayGain - Final Replaygain applied: 1.000000, Track/Album Gain 89.000000, Peak 0.000000
00:21:01 T:6328   DEBUG: CActiveAE::ClearDiscardedBuffers - buffer pool deleted
00:21:01 T:6316    INFO: PAPlayer::PrepareStream - Ready
00:21:01 T:6316   DEBUG: CApplication::PlayFile: OpenFile succeed, play state 1
00:21:01 T:6772   DEBUG: Thread PAPlayer start, auto delete: false
00:21:01 T:6772   DEBUG: PAPlayer::Process - Playback started
00:21:01 T:6772   DEBUG: CApplication::OnPlayBackStarted: play state was 1, starting 0
00:21:01 T:6316   DEBUG: CGUIInfoManager::SetCurrentSong(https://listen.musicmp3.ru/76703fe7443f2c9e/5103e45e674570df|Referer=None&Cookie=SessionId%3D7aimae743e4c29b0%3B&User-Agent=Mozilla%2F5.0+%28Macintosh%3B+Intel+Mac+OS+X+10_7_5%29+AppleWebKit%2F537.78.2+%28KHTML%2C+like+Gecko%29+Version%2F6.1.6+Safari%2F537.78.2)
00:21:01 T:6316   DEBUG: CFileItem::LoadMusicTag: loading tag information for file: https://listen.musicmp3.ru/76703fe7443f2c9e/5103e45e674570df|Referer=None&Cookie=SessionId%3D7aimae743e4c29b0%3B&User-Agent=Mozilla%2F5.0+%28Macintosh%3B+Intel+Mac+OS+X+10_7_5%29+AppleWebKit%2F537.78.2+%28KHTML%2C+like+Gecko%29+Version%2F6.1.6+Safari%2F537.78.2
00:21:01 T:6316   DEBUG: CAnnouncementManager - Announcement: OnPlay from xbmc
00:21:01 T:6316   DEBUG: GOT ANNOUNCEMENT, type: 1, from xbmc, message OnPlay
00:21:01 T:6316   DEBUG: ------ Window Deinit (C:\Users\boogie\AppData\Roaming\Kodi\addons\plugin.program.ump\resources\skins\Default\720p\select.xml) ------
00:21:01 T:6216   DEBUG: CONTENT_CAT  : N/A
00:21:01 T:6216   DEBUG: EOF
00:21:01 T:6216    INFO: CPythonInvoker(16, C:\Users\boogie\AppData\Roaming\Kodi\addons\plugin.program.ump\addon.py): script successfully run
00:21:01 T:6216    INFO: Python script stopped
00:21:01 T:6216   DEBUG: Thread LanguageInvoker 6216 terminating
00:21:02 T:6772    INFO: PAPlayer::ProcessStream - Stream Finished
00:21:02 T:6772   DEBUG: CApplication::OnQueueNextItem: play state was 2, starting 0
00:21:02 T:6444   DEBUG: Thread FileCache 6444 terminating
00:21:02 T:6772   DEBUG: PAPlayer::ProcessStreams - Stream Freed
00:21:02 T:6328   DEBUG: CActiveAE::DiscardStream - audio stream deleted
00:21:02 T:6328   DEBUG: CActiveAE::ClearDiscardedBuffers - buffer pool deleted
00:21:02 T:6772   DEBUG: CApplication::OnPlayBackEnded: play state was 2, starting 0
00:21:02 T:6772   DEBUG: CAnnouncementManager - Announcement: OnStop from xbmc
00:21:02 T:6772   DEBUG: GOT ANNOUNCEMENT, type: 1, from xbmc, message OnStop
00:21:02 T:6772   DEBUG: Thread PAPlayer 6772 terminating
00:21:02 T:6328   DEBUG: CActiveAE::ClearDiscardedBuffers - buffer pool deleted
00:21:02 T:5324   DEBUG: CSaveFileStateJob::DoWork - Saving file state for audio item https://listen.musicmp3.ru/76703fe7443f2c9e/5103e45e674570df|Referer=None&Cookie=SessionId%3D7aimae743e4c29b0%3B&User-Agent=Mozilla%2F5.0+%28Macintosh%3B+Intel+Mac+OS+X+10_7_5%29+AppleWebKit%2F537.78.2+%28KHTML%2C+like+Gecko%29+Version%2F6.1.6+Safari%2F537.78.2
^^00:21:01 T:6444 ERROR: CCurlFile::FillBuffer - Failed: Requested range was not delivered by the server(33)

thats the nasty part.

Tested on both isengard and jarvis. Behaviour is the same. Log is from Jarvis
 
Last edited:

ashdin

New member
May 16, 2016
1
0
0
Hey there,

Wondering if you had any luck with this or any solution? Im facing a similar problem at my end.
Im downloading from another server on to mine, and while its being downloaded, I start streaming in Kodi. So it plays just fine for a bit (5-10 mins) and then just stops. Gives a similar error like yours. Any ideas?

Thanks