Jump to content
Codeh

[Development] Weird issues

Recommended Posts

Codeh

Hi,

 

I'm developing a plugin for LazyMan but I'm having a few issues.

 

I've been incrementing the "DataVersion" but the cached version still exists. I implemented my own cache so I don't have to keep requesting the game list, but it is currently disabled.

Any input (or critiques) are appreciated! 

 

src: https://github.com/Codehhh/Emby.Plugins.LazyMan/

 

1. Folder are somehow being cached.

 

Expected: https://i.imgur.com/N9Mnndc.png

Cached: https://i.imgur.com/plh7b7x.png

 

 

2. Weird "Forbidden" error.

logfile:

2019-01-20 17:06:26.618 Info HttpClient: GET http://powersports.ml/getM3U8.php?league=nhl&date=2019-01-20&id=64375203&cdn=l3c
2019-01-20 17:06:26.706 Error MediaSourceManager: Error getting media sources
	*** Error Report ***
	Version: 4.0.0.2
	Command line: C:\Users\Cody\AppData\Roaming\Emby-Server\system\EmbyServer.dll -noautorunwebapp
	Operating system: Microsoft Windows NT 6.2.9200.0
	64-Bit OS: True
	64-Bit Process: True
	User Interactive: True
	Processor count: 8
	Program data path: C:\Users\Cody\AppData\Roaming\Emby-Server\programdata
	Application directory: C:\Users\Cody\AppData\Roaming\Emby-Server\system
	MediaBrowser.Model.Net.HttpException: MediaBrowser.Model.Net.HttpException: Forbidden
	   at Emby.Server.Implementations.HttpClientManager.CoreHttpClientManager.SendAsyncInternal(HttpRequestOptions options, String httpMethod)
	   at Emby.Server.Implementations.HttpClientManager.CoreHttpClientManager.SendAsync(HttpRequestOptions options, String httpMethod)
	   at Emby.Plugins.LazyMan.GameApi.PowersportsApi.GetStreamUrlAsync(String league, DateTime date, String mediaId, String cdn)
	   at Emby.Plugins.LazyMan.LazyManChannel.GetChannelItemMediaInfo(String id, CancellationToken cancellationToken)
	   at Emby.Server.Implementations.Channels.ChannelManager.GetChannelItemMediaSourcesInternal(IRequiresMediaInfoCallback channel, String id, CancellationToken cancellationToken)
	   at Emby.Server.Implementations.Channels.ChannelManager.GetDynamicMediaSources(BaseItem item, CancellationToken cancellationToken)
	   at Emby.Server.Implementations.Library.MediaSourceManager.GetDynamicMediaSources(BaseItem item, Folder[] collectionFolders, IMediaSourceProvider provider, CancellationToken cancellationToken)
	Source: Emby.Server.Implementations
	TargetSite: Void MoveNext()
	   at Emby.Server.Implementations.HttpClientManager.CoreHttpClientManager.SendAsyncInternal(HttpRequestOptions options, String httpMethod)
	   at Emby.Server.Implementations.HttpClientManager.CoreHttpClientManager.SendAsync(HttpRequestOptions options, String httpMethod)
	   at Emby.Plugins.LazyMan.GameApi.PowersportsApi.GetStreamUrlAsync(String league, DateTime date, String mediaId, String cdn)
	   at Emby.Plugins.LazyMan.LazyManChannel.GetChannelItemMediaInfo(String id, CancellationToken cancellationToken)
	   at Emby.Server.Implementations.Channels.ChannelManager.GetChannelItemMediaSourcesInternal(IRequiresMediaInfoCallback channel, String id, CancellationToken cancellationToken)
	   at Emby.Server.Implementations.Channels.ChannelManager.GetDynamicMediaSources(BaseItem item, CancellationToken cancellationToken)
	   at Emby.Server.Implementations.Library.MediaSourceManager.GetDynamicMediaSources(BaseItem item, Folder[] collectionFolders, IMediaSourceProvider provider, CancellationToken cancellationToken)

I can't replicate the error using postman or through browser.

 

3. Another caching? issue

Cached: https://i.imgur.com/mB7B6hy.png

I always return the same list, expected: https://i.imgur.com/cpflJ7n.png

Share this post


Link to post
Share on other sites
Luke

Try having your channel implement ihascachekey.

Share this post


Link to post
Share on other sites
Codeh

@@Luke, I don't want anything cached by Emby as the tiles could change at any moment. Is there a way to disable or bust the cache?

Share this post


Link to post
Share on other sites
ebr

@@Luke, I don't want anything cached by Emby as the tiles could change at any moment. Is there a way to disable or bust the cache?

 

Yes, have whatever is returned by the cacheKey always be new.

Share this post


Link to post
Share on other sites
Codeh

Thanks ebr, that worked perfectly.

 

I now have an exception that I'm not sure how to resolve.

 

What I'm currently returning:

GetChannelItemMediaInfo()
...
return new[]
{
  new MediaSourceInfo
  {
    IsRemote = true,
    Path = streamUrl           
  }
};

My exception:

2019-01-24 20:54:04.942 Info LazyMan: [GetChannelItemMediaInfo] Playing https://hlslive-l3c.med2.med.nhl.com/token=exp=1548423979~id=nhlGatewayId:3879065~data=64447403~hash=5ed043c0e05a5141688c02cff8f53ebdb63eb134/ls03/nhl/2019/01/24/NHL_GAME_VIDEO_CARVAN_M2_VISIT_20190124_1546183962948/3500K/3500_complete-trimmed.m3u8
2019-01-24 20:54:05.102 Info App: User policy for Codeh. EnableAudioPlaybackTranscoding: True
2019-01-24 20:54:05.337 Error HttpServer: Error processing request
	*** Error Report ***
	Version: 4.0.1.0
	Command line: C:\Users\Codeh\AppData\Roaming\Emby-Server\system\EmbyServer.dll -noautorunwebapp
	Operating system: Microsoft Windows NT 6.2.9200.0
	64-Bit OS: True
	64-Bit Process: True
	User Interactive: True
	Processor count: 8
	Program data path: C:\Users\Codeh\AppData\Roaming\Emby-Server\programdata
	Application directory: C:\Users\Codeh\AppData\Roaming\Emby-Server\system
	System.ArgumentException: System.ArgumentException: MediaSourceId is required
	   at Emby.Server.MediaEncoding.Api.Hls.DynamicHlsService.GetMasterPlaylistInternal(StreamRequest request, String method)
	   at Emby.Server.MediaEncoding.Api.UniversalAudioService.GetUniversalStream(GetUniversalAudioStream request, Boolean isHeadRequest)
	   at Emby.Server.Implementations.Services.ServiceExecGeneral.GetTaskResult(Task task)
	   at Emby.Server.Implementations.Services.ServiceHandler.ProcessRequestAsync(HttpListenerHost appHost, IRequest httpReq, IResponse httpRes, ILogger logger, String operationName, CancellationToken cancellationToken)
	   at Emby.Server.Implementations.HttpServer.HttpListenerHost.RequestHandler(IRequest httpReq, String urlString, String host, String localPath, CancellationToken cancellationToken)
	Source: Emby.Server.MediaEncoding
	TargetSite: Void MoveNext()
	   at Emby.Server.MediaEncoding.Api.Hls.DynamicHlsService.GetMasterPlaylistInternal(StreamRequest request, String method)
	   at Emby.Server.MediaEncoding.Api.UniversalAudioService.GetUniversalStream(GetUniversalAudioStream request, Boolean isHeadRequest)
	   at Emby.Server.Implementations.Services.ServiceExecGeneral.GetTaskResult(Task task)
	   at Emby.Server.Implementations.Services.ServiceHandler.ProcessRequestAsync(HttpListenerHost appHost, IRequest httpReq, IResponse httpRes, ILogger logger, String operationName, CancellationToken cancellationToken)
	   at Emby.Server.Implementations.HttpServer.HttpListenerHost.RequestHandler(IRequest httpReq, String urlString, String host, String localPath, CancellationToken cancellationToken)

I know I'm missing a parameter, but have no idea what. What did I miss?

Share this post


Link to post
Share on other sites
Luke

You most likely need to fill out more properties on the mediasourceinfo object. Try at least assigning an id

Share this post


Link to post
Share on other sites
Codeh

That fixed that error, thank you!

Now I have the stream not actually playing. Do I have to do anything special for a livestream?

 

logfile:

2019-01-24 21:10:52.352 Info LazyMan: [GetChannelItemMediaInfo] Playing https://hlslive-l3c.med2.med.nhl.com/token=exp=1548423963~id=nhlGatewayId:3879065~data=64447303~hash=45124927b119b57587a08fc9d89c1951c46eb481/ls03/nhl/2019/01/24/NHL_GAME_VIDEO_CARVAN_M2_HOME_20190124_1546183962740/2500K/2500_complete-trimmed.m3u8
2019-01-24 21:10:52.562 Info App: User policy for Codeh. EnableAudioPlaybackTranscoding: True
2019-01-24 21:10:52.811 Info HttpServer: HTTP Response 200 to ::1. Time: 965ms. http://localhost:8096/emby/Audio/1053/universal?UserId=24a2e0c0f0c948e1b88d165c854984c9&DeviceId=TW96aWxsYS81LjAgKFdpbmRvd3MgTlQgMTAuMDsgV2luNjQ7IHg2NDsgcnY6NjUuMCkgR2Vja28vMjAxMDAxMDEgRmlyZWZveC82NS4wfDE1NDgwMDM1MDAwODA1&MaxStreamingBitrate=140000000&Container=opus,mp3|mp3,aac|aac,m4a|aac,mp4|aac,flac,webma,webm,wav,ogg&TranscodingContainer=ts&TranscodingProtocol=hls&AudioCodec=aac&PlaySessionId=1548379537867&StartTimeTicks=0&EnableRedirection=true&EnableRemoteMedia=false
2019-01-24 21:10:53.064 Info HttpServer: HTTP GET http://localhost:8096/emby/Audio/1053/universal?UserId=24a2e0c0f0c948e1b88d165c854984c9&DeviceId=TW96aWxsYS81LjAgKFdpbmRvd3MgTlQgMTAuMDsgV2luNjQ7IHg2NDsgcnY6NjUuMCkgR2Vja28vMjAxMDAxMDEgRmlyZWZveC82NS4wfDE1NDgwMDM1MDAwODA1&MaxStreamingBitrate=140000000&Container=opus,mp3|mp3,aac|aac,m4a|aac,mp4|aac,flac,webma,webm,wav,ogg&TranscodingContainer=ts&TranscodingProtocol=hls&AudioCodec=aac&PlaySessionId=1548379537867&StartTimeTicks=0&EnableRedirection=true&EnableRemoteMedia=false. UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0
2019-01-24 21:10:53.067 Debug App: GetPostedPlaybackInfo request: {"Id":"1053","UserId":"24a2e0c0f0c948e1b88d165c854984c9","MaxStreamingBitrate":140000000,"StartTimeTicks":0,"DeviceProfile":{"EnableAlbumArtInDidl":false,"EnableSingleAlbumArtLimit":false,"EnableSingleSubtitleLimit":false,"SupportedMediaTypes":"Audio,Photo,Video","MaxAlbumArtWidth":0,"MaxAlbumArtHeight":0,"MaxStreamingBitrate":8000000,"MaxStaticBitrate":8000000,"MusicStreamingTranscodingBitrate":128000,"TimelineOffsetSeconds":0,"RequiresPlainVideoItems":false,"RequiresPlainFolders":false,"EnableMSMediaReceiverRegistrar":false,"IgnoreTranscodeByteRangeRequests":false,"XmlRootAttributes":[],"DirectPlayProfiles":[{"Container":"opus","Type":"Audio"},{"Container":"mp3","AudioCodec":"mp3","Type":"Audio"},{"Container":"aac","AudioCodec":"aac","Type":"Audio"},{"Container":"m4a","AudioCodec":"aac","Type":"Audio"},{"Container":"mp4","AudioCodec":"aac","Type":"Audio"},{"Container":"flac","Type":"Audio"},{"Container":"webma","Type":"Audio"},{"Container":"webm","Type":"Audio"},{"Container":"wav","Type":"Audio"},{"Container":"ogg","Type":"Audio"}],"TranscodingProfiles":[{"Container":"ts","Type":"Audio","AudioCodec":"aac","Protocol":"hls","EstimateContentLength":false,"EnableMpegtsM2TsMode":false,"TranscodeSeekInfo":"Auto","CopyTimestamps":false,"Context":"Streaming","MinSegments":0,"SegmentLength":0,"BreakOnNonKeyFrames":false}],"ContainerProfiles":[],"CodecProfiles":[],"ResponseProfiles":[],"SubtitleProfiles":[]},"EnableDirectPlay":true,"EnableDirectStream":true,"EnableTranscoding":true,"AllowVideoStreamCopy":true,"AllowAudioStreamCopy":true,"IsPlayback":true,"AutoOpenLiveStream":false,"DirectPlayProtocols":["Http"]}
2019-01-24 21:10:53.069 Info App: User policy for Codeh. EnableAudioPlaybackTranscoding: True
2019-01-24 21:10:53.099 Debug App: Master playlist: 
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-INDEPENDENT-SEGMENTS
#EXT-X-STREAM-INF:BANDWIDTH=460800,AVERAGE-BANDWIDTH=384000
live.m3u8?UserId=24a2e0c0f0c948e1b88d165c854984c9&DeviceId=TW96aWxsYS81LjAgKFdpbmRvd3MgTlQgMTAuMDsgV2luNjQ7IHg2NDsgcnY6NjUuMCkgR2Vja28vMjAxMDAxMDEgRmlyZWZveC82NS4wfDE1NDgwMDM1MDAwODA1&MaxStreamingBitrate=140000000&Container=opus%2Cmp3%7Cmp3%2Caac%7Caac%2Cm4a%7Caac%2Cmp4%7Caac%2Cflac%2Cwebma%2Cwebm%2Cwav%2Cogg&TranscodingContainer=ts&TranscodingProtocol=hls&AudioCodec=aac&api_key=2fb76bb68f004a7bbad543608bbb004c&PlaySessionId=1548379537867&StartTimeTicks=0&EnableRedirection=true&EnableRemoteMedia=false&SegmentContainer=ts&AudioBitrate=384000&TranscodeReasons=ContainerNotSupported

2019-01-24 21:10:53.100 Info HttpServer: HTTP Response 200 to ::1. Time: 36ms. http://localhost:8096/emby/Audio/1053/universal?UserId=24a2e0c0f0c948e1b88d165c854984c9&DeviceId=TW96aWxsYS81LjAgKFdpbmRvd3MgTlQgMTAuMDsgV2luNjQ7IHg2NDsgcnY6NjUuMCkgR2Vja28vMjAxMDAxMDEgRmlyZWZveC82NS4wfDE1NDgwMDM1MDAwODA1&MaxStreamingBitrate=140000000&Container=opus,mp3|mp3,aac|aac,m4a|aac,mp4|aac,flac,webma,webm,wav,ogg&TranscodingContainer=ts&TranscodingProtocol=hls&AudioCodec=aac&PlaySessionId=1548379537867&StartTimeTicks=0&EnableRedirection=true&EnableRemoteMedia=false
2019-01-24 21:10:53.121 Info HttpServer: HTTP GET http://localhost:8096/emby/Audio/1053/live.m3u8?UserId=24a2e0c0f0c948e1b88d165c854984c9&DeviceId=TW96aWxsYS81LjAgKFdpbmRvd3MgTlQgMTAuMDsgV2luNjQ7IHg2NDsgcnY6NjUuMCkgR2Vja28vMjAxMDAxMDEgRmlyZWZveC82NS4wfDE1NDgwMDM1MDAwODA1&MaxStreamingBitrate=140000000&Container=opus,mp3|mp3,aac|aac,m4a|aac,mp4|aac,flac,webma,webm,wav,ogg&TranscodingContainer=ts&TranscodingProtocol=hls&AudioCodec=aac&PlaySessionId=1548379537867&StartTimeTicks=0&EnableRedirection=true&EnableRemoteMedia=false&SegmentContainer=ts&AudioBitrate=384000&TranscodeReasons=ContainerNotSupported. UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0
2019-01-24 21:10:53.123 Error HttpServer: Could not find handler for /emby/Audio/1053/live.m3u8
2019-01-24 21:10:53.134 Info HttpServer: HTTP Response 404 to ::1. Time: 13ms. http://localhost:8096/emby/Audio/1053/live.m3u8?UserId=24a2e0c0f0c948e1b88d165c854984c9&DeviceId=TW96aWxsYS81LjAgKFdpbmRvd3MgTlQgMTAuMDsgV2luNjQ7IHg2NDsgcnY6NjUuMCkgR2Vja28vMjAxMDAxMDEgRmlyZWZveC82NS4wfDE1NDgwMDM1MDAwODA1&MaxStreamingBitrate=140000000&Container=opus,mp3|mp3,aac|aac,m4a|aac,mp4|aac,flac,webma,webm,wav,ogg&TranscodingContainer=ts&TranscodingProtocol=hls&AudioCodec=aac&PlaySessionId=1548379537867&StartTimeTicks=0&EnableRedirection=true&EnableRemoteMedia=false&SegmentContainer=ts&AudioBitrate=384000&TranscodeReasons=ContainerNotSupported
2019-01-24 21:10:53.159 Info HttpServer: HTTP POST http://localhost:8096/emby/Sessions/Playing. UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0
2019-01-24 21:10:53.189 Info HttpServer: HTTP POST http://localhost:8096/emby/Sessions/Playing/Progress. UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0
2019-01-24 21:10:53.261 Info HttpServer: HTTP POST http://localhost:8096/emby/Sessions/Playing/Stopped. UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0
2019-01-24 21:10:53.275 Debug App: ReportPlaybackStopped PlaySessionId: 1548379537867
2019-01-24 21:10:53.308 Info SessionManager: Playback stopped reported by app Emby Mobile 4.0.1.0 playing Emby.Plugins.LazyMan.GameApi.Team vs Emby.Plugins.LazyMan.GameApi.Team on SNP at 540p. Stopped at 0 ms
2019-01-24 21:10:53.321 Debug XmlSerializer: Deserializing file C:\Users\Codeh\AppData\Roaming\Emby-Server\programdata\config\xbmcmetadata.xml
2019-01-24 21:10:53.323 Info HttpServer: HTTP Response 204 to ::1. Time: 63ms. http://localhost:8096/emby/Sessions/Playing/Stopped
2019-01-24 21:10:53.323 Info HttpServer: HTTP Response 204 to ::1. Time: 165ms. http://localhost:8096/emby/Sessions/Playing
2019-01-24 21:10:53.351 Info HttpServer: HTTP Response 204 to ::1. Time: 162ms. http://localhost:8096/emby/Sessions/Playing/Progress

Share this post


Link to post
Share on other sites
Luke

what do you mean by live stream?

Share this post


Link to post
Share on other sites
Codeh

Sorry, not livestream- live tv. I have an m3u8 stream that plays perfectly in VLC but doesn't start in Emby.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...