Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Status parameter error - Invalida Data #12

Open
RealKanashii opened this issue Sep 17, 2021 · 11 comments
Open

Status parameter error - Invalida Data #12

RealKanashii opened this issue Sep 17, 2021 · 11 comments

Comments

@RealKanashii
Copy link

Line 142 Caracter 77

+ ... Episode Data from TheTVDB" -Status $PlexShows[$GUID]["title"] -Percen ...
+                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Write-Progress], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.PowerShell.Commands.WriteProgressCommand

Some kind of error with 'Status' parameter.

@RealKanashii
Copy link
Author

And thanks for your effort to keep this script working. It helped my a lot.

@MysticRyuujin
Copy link
Owner

MysticRyuujin commented Sep 17, 2021

hmmm I don't know what that error could be - it says it's an error with the write-progress but it's just accessing the "title" field of some show...

You can either comment out line 142 to ignore it haha or figure out what that show is and why it seemingly doesn't have a title?

@RealKanashii
Copy link
Author

Seems some show appear as NULL or empty. Is not only one error, I have plenty: ""Failed to get Episodes for" but the title is empty.

@RealKanashii
Copy link
Author

ADVERTENCIA: Failed to get Episodes for
ADVERTENCIA: Failed to get Episodes for
ADVERTENCIA: Failed to get Episodes for
ADVERTENCIA: Failed to get Episodes for
ADVERTENCIA: Failed to get Episodes for
ADVERTENCIA: Failed to get Episodes for
ADVERTENCIA: Failed to get Episodes for
ADVERTENCIA: Failed to get Episodes for
ADVERTENCIA: Failed to get Episodes for
ADVERTENCIA: Failed to get Episodes for
ADVERTENCIA: Failed to get Episodes for
ADVERTENCIA: Failed to get Episodes for
ADVERTENCIA: Failed to get Episodes for
ADVERTENCIA: Failed to get Episodes for
ADVERTENCIA: Failed to get Episodes for
ADVERTENCIA: Failed to get Episodes for
ADVERTENCIA: Failed to get Episodes for

@RealKanashii
Copy link
Author

I just saw the first error (which was not visible being blind by all the others) is :

No se puede llamar a un método en una expresión con valor NULL. En C:\Users\kanas\Desktop\Crawler 2.ps1: 107 Carácter: 9 + [void]$PlexShows[$GUID]["ratingKeys"].Add($ShowData.ratingKey ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull

@RealKanashii
Copy link
Author

RealKanashii commented Sep 18, 2021

And then some "Collecting Season Data". I don't know but seems there are some show that are not visible by the script or maybe it recovers a NULL title ( UTF-8/ISO encoding problem maybe?).

@MysticRyuujin
Copy link
Owner

I'm gonna guess it's a language issue like you are suggesting 🤷‍♂️ - I'm also gonna be honest, I haven't touched this script in over a year and the last fix was just some formatting stuff. I probably will not maintain it...

@RealKanashii
Copy link
Author

RealKanashii commented Sep 18, 2021

Curiously there are some title, even with accents and local characters, that work:
ADVERTENCIA: Failed to get Episodes for El Día De Mañana

Anyway, thanks a lot for your efforts.
Maybe is time to learn some powershell script or try myself to code a similar python script.

@qlowell
Copy link

qlowell commented Feb 18, 2022

Plex is deprecating the TVDB in favor of Plex TV Series agent. It uses a different format for the GUID. This script will still work on the shows in your library that were connected to the TVDB but not for anything new you added. In order to use that the script would need to be updated to accept either agent. https://support.plex.tv/articles/advanced-setting-plex-tv-series-agent/

@RealKanashii
Copy link
Author

RealKanashii commented Feb 18, 2022

Plex is deprecating the TVDB in favor of Plex TV Series agent. It uses a different format for the GUID. This script will still work on the shows in your library that were connected to the TVDB but not for anything new you added. In order to use that the script would need to be updated to accept either agent. https://support.plex.tv/articles/advanced-setting-plex-tv-series-agent/

@MysticRyuujin told he isn't gonna maintain the script... we need to look for others methods or fork this one and keep it update.

@qlowell
Copy link

qlowell commented Feb 19, 2022

I'm sure there may be a more elegant way of fixing it but I got this to work. Basically, there are two problems. First, Plex is using a new agent but fortunately they keep the TVDB in an XML attribute. Second, this doesn't work for tv series that were recorded so it will still bomb. (must have been an oversight).

Get all Show Data

$PlexShows = @{ }
$Progress = 0
ForEach ($RatingKey in $RatingKeys) {
$ShowData = (Invoke-RestMethod -Uri "$PlexServer/library/metadata/$RatingKey/" -Headers $PlexHeaders).MediaContainer.Directory
$Progress++
Write-Progress -Activity "Collecting Show Data" -Status $ShowData.title -PercentComplete ($Progress / $RatingKeys.Count * 100)

if ([string]$ShowData.InnerXml -match '<Guid id="tvdb://(\d+)"') {
    $GUID = $matches[1]
}
else {
        $GUID = $ShowData.guid -replace ".*//(\d+).*", '$1'

}

if ($GUID -match '^[\d\.]+$') {

    if ($PlexShows.ContainsKey($GUID)) {
        [void]$PlexShows[$GUID]["ratingKeys"].Add($RatingKey)

    }
    else {
        [void]$PlexShows.Add($GUID, @{
            "title"      = $ShowData.title
            "ratingKeys" = [System.Collections.Generic.List[int]]::new()
            "seasons"    = @{ }
           
        })     

        #Write-Host $GUID  $Showdata.Title

        [void]$PlexShows[$GUID]["ratingKeys"].Add($ShowData.ratingKey)
        }

}

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants