sytone 5 Posted April 16, 2016 Share Posted April 16, 2016 Is there a way to pull missing episodes via a API call? Looking for the show name, season, episode and name of episode. Want to get a list I can pass to my DVR to fill any gaps I have. Sent from my iPhone using Tapatalk Link to comment Share on other sites More sharing options...
Happy2Play 8273 Posted April 16, 2016 Share Posted April 16, 2016 (edited) Have you considered looking at Reports-Episodes-filter Episodes-Missing episodes Edited April 16, 2016 by Happy2Play Link to comment Share on other sites More sharing options...
speechles 1917 Posted April 16, 2016 Share Posted April 16, 2016 (edited) .../Users/<user-id>/Items?Includeitemtypes=Episodes&recursive=true&IsMissing=trueAfter getting this payload, you may have to ... do more like below Afterwhich newresult only has missing episodes. Not sure if you still need to do this cleansing anymore or not. Last time I tried you had to. NewResult = {} for each item in parse(json.result) { if item.locationType = "Virtual" NewResult.append(item) End if End for Edited April 16, 2016 by speechles Link to comment Share on other sites More sharing options...
sytone 5 Posted April 17, 2016 Author Share Posted April 17, 2016 What is the auth process with this endpoint, getting a auth exception. Link to comment Share on other sites More sharing options...
ebr 14910 Posted April 17, 2016 Share Posted April 17, 2016 Authentication Link to comment Share on other sites More sharing options...
sytone 5 Posted April 20, 2016 Author Share Posted April 20, 2016 Getting a 400 error, from logs I am seeing a auth and then failure. looks like there is a failure on the session? CODe output Invoke-WebRequest : The remote server returned an error: (400) Bad Request. At line:57 char:5 + Invoke-WebRequest -Uri $authUrl -Method POST -Body $postParams -C ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [invoke-WebRequest], WebException + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand CODE Function Get-StringHash([string] $String,$HashName = "MD5") { $StringBuilder = New-Object System.Text.StringBuilder [system.Security.Cryptography.HashAlgorithm]::Create($HashName).ComputeHash([system.Text.Encoding]::UTF8.GetBytes($String))|%{ [Void]$StringBuilder.Append($_.ToString("x2")) } $StringBuilder.ToString() } $embyServerUrl = "http://homecentral:8096" $embyClientName = "PowerShellScript" $embyDeviceName = "PowerShellScriptEpisodeFiller" $embyDeviceId = "1" $embyApplicationVersion = "1.0.0"; function Get-EmbyAccessToken { [CmdletBinding()] param ($Username, $Password) $authUrl = "{0}/Users/AuthenticateByName/" -f $embyServerUrl $sha1Pass = Get-StringHash -String $password -HashName "SHA1" $md5Pass = Get-StringHash -String $password $postParams = (@{Username="$username";password="$sha1Pass";passwordMd5="$md5Pass"} | ConvertTo-Json) $headers = @{"Authorization"="MediaBrowser";"Client"=$embyClientName;"Device"=$embyDeviceName;"DeviceId"=$embyDeviceId;"Version"=$embyApplicationVersion;"UserId"="06da1707c6734dff9a26c360f8b71484"} Write-Verbose ("authUrl={0},Username={1},sha1Pass={2},md5Pass={3},params={4}" -f $authUrl, $Username,$sha1Pass,$md5Pass,$postParams) Invoke-WebRequest -Uri $authUrl -Method POST -Body $postParams -ContentType "application/json" -Headers $headers } Logs: 2016-04-19 19:01:11.5154 Info HttpServer: HTTP POST http://homecentral:8096/Users/AuthenticateByName/. UserAgent: Mozilla/5.0 (Windows NT; Windows NT 10.0; en-US) WindowsPowerShell/5.0.10586.122 2016-04-19 19:01:11.5716 Info UserManager: Authentication request for jon_b has succeeded.2016-04-19 19:01:11.5716 Info SessionManager: Reissuing access token: b80d86289610416f8950ef44bd9a17012016-04-19 19:01:11.5716 Error DtoUtils: ServiceBase<TRequest>::Service Exception*** Error Report ***Version: 3.0.5912.0Command line: C:\Users\jon_b\AppData\Roaming\Emby-Server\System\MediaBrowser.ServerApplication.exe -serviceOperating system: Microsoft Windows NT 6.2.9200.0Processor count: 864-Bit OS: True64-Bit Process: TrueProgram data path: C:\Users\jon_b\AppData\Roaming\Emby-ServerApplication Path: C:\Users\jon_b\AppData\Roaming\Emby-Server\System\MediaBrowser.ServerApplication.exeValue cannot be null.Parameter name: appNameSystem.ArgumentNullException at MediaBrowser.Server.Implementations.Session.SessionManager.<LogSessionActivity>d__9.MoveNext()--- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at MediaBrowser.Server.Implementations.Session.SessionManager.<AuthenticateNewSessionInternal>d__f2.MoveNext()--- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at MediaBrowser.Api.UserService.<Post>d__17.MoveNext()2016-04-19 19:01:11.5716 Error HttpServer: Error processing request for /Users/AuthenticateByName/*** Error Report ***Version: 3.0.5912.0Command line: C:\Users\jon_b\AppData\Roaming\Emby-Server\System\MediaBrowser.ServerApplication.exe -serviceOperating system: Microsoft Windows NT 6.2.9200.0Processor count: 864-Bit OS: True64-Bit Process: TrueProgram data path: C:\Users\jon_b\AppData\Roaming\Emby-ServerApplication Path: C:\Users\jon_b\AppData\Roaming\Emby-Server\System\MediaBrowser.ServerApplication.exeValue cannot be null.Parameter name: appNameServiceStack.HttpErrorNo Stack Trace Available2016-04-19 19:01:11.5716 Info HttpServer: HTTP Response 400 to fe80::1178:92a5:e2fc:10f4%11. Time: 60ms. http://homecentral:8096/Users/AuthenticateByName/ Link to comment Share on other sites More sharing options...
donut114 0 Posted April 20, 2016 Share Posted April 20, 2016 I've got a similar issue. It seems that we are missing some appName parameter in our headers or in the body. However, providing appName doesn't seem to resolve it. I'm also using powershell. Here is another thread about it: http://emby.media/community/index.php?/topic/31789-rest-authentication-started-failing-with-build-5886 Link to comment Share on other sites More sharing options...
willemslouie 0 Posted March 13, 2020 Share Posted March 13, 2020 (edited) In postman: GET http://{serveraddress}/emby/Users/{Userid}/Items?IncludeItemTypes=Episode&recursive=true&IsMissing=true&IsUnaired=false&ParentId={folderid} Header: - Content-Type -> application/json - X-Emby-Token -> apikey or token Edited March 13, 2020 by willemslouie Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now