Youtubeexplode: Could not find signature decipherer definition body again today

Created on 28 Jul 2020  路  25Comments  路  Source: Tyrrrz/YoutubeExplode

This afternoon, we get the issue again, our version is 5.1.2
the exception is:
Exception download https://www.youtube.com/watch?v=5bAgZLUIgZ8 at Monday, July 27, 2020 7:45:48 PM
YoutubeExplode.Exceptions.TransientFailureException: Could not find signature decipherer definition body.
In most cases, this error indicates that YouTube most likely changed something, which broke the library.
If this issue persists, please report it on the project's GitHub page.
at YoutubeExplode.ReverseEngineering.Responses.PlayerSource.d__3.MoveNext()
at System.Linq.Buffer1..ctor(IEnumerable1 source)
at System.Linq.Enumerable.ToArrayTSource

bug caused by youtube help wanted

Most helpful comment

           string? TryGetDeciphererFuncBody()
            {
                var funcName = Regex.Match(_root, @"(\w+)=function\(\w+\){(\w+)=\2\.split\(\x22{2}\);.*?return\s+\2\.join\(\x22{2}\)}")
                    .Groups[0]
                    .Value;

                return funcName;

                var escapedFuncName = Regex.Escape(funcName);

                return Regex.Match(_root, $@"(?!h\.){escapedFuncName}=function\(\w+\)\{{(.*?)\}}", RegexOptions.Singleline)
                    .Groups[1]
                    .Value
                    .NullIfWhiteSpace();
            }

instead of https://github.com/Tyrrrz/YoutubeExplode/blob/7a1ce6a8e50e7df513a2dc226e66d691421ef1ca/YoutubeExplode/ReverseEngineering/Responses/PlayerSource.cs#L24
Can anyone try this ?

All 25 comments

Same thing is happening here

yes same issue for me also.

youtube-dl has just fixed this issue.

Another example getting same error:
https://www.youtube.com/watch?v=P0lII5xeaWs

same issue for me also.
mark !

Youtube changed something. The NewPipe Team fixed it some hours ago. The youtube kodi adddon seems not to affected by this change.

broken for me too, doh...

youtube dl fixed this in this commit: https://github.com/ytdl-org/youtube-dl/commit/e450f6cb634f17fd4ef59291eafb68b05c141e43
I'm tryna find a place in this library where a similar regexp is present in the library but I had no luck

We're using different patterns, but it's either one of these: https://github.com/Tyrrrz/YoutubeExplode/blob/7a1ce6a8e50e7df513a2dc226e66d691421ef1ca/YoutubeExplode/ReverseEngineering/Responses/PlayerSource.cs#L22-L89

The last change was to match JS variable names that contain $ character in them.

I won't have time to fix this, so PRs are welcome.

actually we get the deciphererFuncBody value as "var b=Tt(a,!0);return Nt($t(a,b))" ,
so the method TryGetDeciphererDefinitionBody code:
var objName = Regex.Match(deciphererFuncBody, "([\$_\w]+).\w+\(\w+,\d+\);")
.Groups[1]
.Value;
will not get a value. just wonder which value you are expecting? Nt or t?

Here is one more video that causes this: https://www.youtube.com/watch?v=WvPZ-blEK-Y

actually we get the deciphererFuncBody value as "var b=Tt(a,!0);return Nt($t(a,b))" ,
so the method TryGetDeciphererDefinitionBody code:
var objName = Regex.Match(deciphererFuncBody, "([$_\w]+).\w+(\w+,\d+);")
.Groups[1]
.Value;
will not get a value. just wonder which value you are expecting? Nt or t?

Previously the func body contained calls like $a.b(c);$a.x(y) so in that case we needed $a to figure out what $a.b and $a.x do, but looks like the format has changed.

Enter YouTube video ID or URL: https://www.youtube.com/watch?v=b9U1dcUS_-w
Unhandled exception. YoutubeExplode.Exceptions.TransientFailureException: Could not find signature decipherer definition body.
In most cases, this error indicates that YouTube most likely changed something, which broke the library.
If this issue persists, please report it on the project's GitHub page.
at YoutubeExplode.ReverseEngineering.Responses.PlayerSource.GetCipherOperations()+MoveNext() in C:\Users\Arman Es\Downloads\Compressed\YoutubeExplode-master\YoutubeExplode-master\YoutubeExplode\ReverseEngineering\Responses\PlayerSource.cs:line 56
at System.Collections.Generic.LargeArrayBuilder1.AddRange(IEnumerable1 items)
at System.Collections.Generic.EnumerableHelpers.ToArrayT
at YoutubeExplode.Videos.Streams.StreamsClient.GetStreamContextFromWatchPageAsync(VideoId videoId) in C:\Users\Arman Es\Downloads\Compressed\YoutubeExplode-master\YoutubeExplode-master\YoutubeExplode\Videos\Streams\StreamsClient.cs:line 102
at YoutubeExplode.Videos.Streams.StreamsClient.GetManifestAsync(VideoId videoId) in C:\Users\Arman Es\Downloads\Compressed\YoutubeExplode-master\YoutubeExplode-master\YoutubeExplode\Videos\Streams\StreamsClient.cs:line 255
at YoutubeExplode.DemoConsole.Program.Main() in C:\Users\Arman Es\Downloads\Compressed\YoutubeExplode-master\YoutubeExplode-master\YoutubeExplode.DemoConsole\Program.cs:line 26
at YoutubeExplode.DemoConsole.Program.

()
Press any key to continue . . .

for the TryGetDeciphererFuncBody, we are looking for the funcName "u" from following line
$u=function(a){a=a.split("");Zu.EV(a,63);Zu.EV(a,16);Zu.EV(a,63);Zu.gg(a,20);Zu.z6(a,3);Zu.gg(a,41);Zu.EV(a,56);Zu.z6(a,1);return a.join("")};
so I guess the result u is not the correct one you are looking for. Also I attached the root string as file here maybe you can see what we are using for our programming.
rootValue.txt

           string? TryGetDeciphererFuncBody()
            {
                var funcName = Regex.Match(_root, @"(\w+)=function\(\w+\){(\w+)=\2\.split\(\x22{2}\);.*?return\s+\2\.join\(\x22{2}\)}")
                    .Groups[0]
                    .Value;

                return funcName;

                var escapedFuncName = Regex.Escape(funcName);

                return Regex.Match(_root, $@"(?!h\.){escapedFuncName}=function\(\w+\)\{{(.*?)\}}", RegexOptions.Singleline)
                    .Groups[1]
                    .Value
                    .NullIfWhiteSpace();
            }

instead of https://github.com/Tyrrrz/YoutubeExplode/blob/7a1ce6a8e50e7df513a2dc226e66d691421ef1ca/YoutubeExplode/ReverseEngineering/Responses/PlayerSource.cs#L24
Can anyone try this ?

           string? TryGetDeciphererFuncBody()
            {
                var funcName = Regex.Match(_root, @"(\w+)=function\(\w+\){(\w+)=\2\.split\(\x22{2}\);.*?return\s+\2\.join\(\x22{2}\)}")
                    **.Groups[0]**
                    .Value;

                **return funcName;**

                var escapedFuncName = Regex.Escape(funcName);

                return Regex.Match(_root, $@"(?!h\.){escapedFuncName}=function\(\w+\)\{{(.*?)\}}", RegexOptions.Singleline)
                    .Groups[1]
                    .Value
                    .NullIfWhiteSpace();
            }

Can anyone try this ?

code is malformatted!

@omansak

You are confusing the DeciphererFuncBody with the DeciphererDefinitionBody I guess

           string? TryGetDeciphererFuncBody()
            {
                var funcName = Regex.Match(_root, @"(\w+)=function\(\w+\){(\w+)=\2\.split\(\x22{2}\);.*?return\s+\2\.join\(\x22{2}\)}")
                    .Groups[0]
                    .Value;

                return funcName;

                var escapedFuncName = Regex.Escape(funcName);

                return Regex.Match(_root, $@"(?!h\.){escapedFuncName}=function\(\w+\)\{{(.*?)\}}", RegexOptions.Singleline)
                    .Groups[1]
                    .Value
                    .NullIfWhiteSpace();
            }

instead of

https://github.com/Tyrrrz/YoutubeExplode/blob/7a1ce6a8e50e7df513a2dc226e66d691421ef1ca/YoutubeExplode/ReverseEngineering/Responses/PlayerSource.cs#L24

Can anyone try this ?

This is working :) 馃憤

           string? TryGetDeciphererFuncBody()
            {
                var funcName = Regex.Match(_root, @"(\w+)=function\(\w+\){(\w+)=\2\.split\(\x22{2}\);.*?return\s+\2\.join\(\x22{2}\)}")
                    .Groups[0]
                    .Value;

                return funcName;

                var escapedFuncName = Regex.Escape(funcName);

                return Regex.Match(_root, $@"(?!h\.){escapedFuncName}=function\(\w+\)\{{(.*?)\}}", RegexOptions.Singleline)
                    .Groups[1]
                    .Value
                    .NullIfWhiteSpace();
            }

instead of
https://github.com/Tyrrrz/YoutubeExplode/blob/7a1ce6a8e50e7df513a2dc226e66d691421ef1ca/YoutubeExplode/ReverseEngineering/Responses/PlayerSource.cs#L24

Can anyone try this ?

This is working :) 馃憤

Definetely working. Thanks 馃憤馃憤

Made the suggested code change - built the dll and added to my application - can confirm all is working great :)

Is nuget package updated?

@isaranghi not yet

Can you check my finding from #407 ?

Thanks!

Thanks guys, update will be released soon.

Thanks @jankowski-t

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jvitoroc picture jvitoroc  路  8Comments

NoobInTraining picture NoobInTraining  路  5Comments

PhapHanh picture PhapHanh  路  4Comments

Luke1998x picture Luke1998x  路  5Comments

vsjtechnologies picture vsjtechnologies  路  7Comments