YoutubeExplode: JsonReaderException: 'a' is an invalid start of a property name
Hi There,
I’m starting to see this issue pop up now.
---> System.Text.Json.JsonReaderException: 'a' is an invalid start of a property name. Expected a '"'. LineNumber: 0 | BytePositionInLine: 1.
at System.Text.Json.ThrowHelper.ThrowJsonReaderException(Utf8JsonReader& json, ExceptionResource resource, Byte nextByte, ReadOnlySpan`1 bytes)
at System.Text.Json.Utf8JsonReader.ReadSingleSegment()
at System.Text.Json.Utf8JsonReader.Read()
at System.Text.Json.JsonDocument.Parse(ReadOnlySpan`1 utf8JsonSpan, Utf8JsonReader reader, MetadataDb& database, StackRowStack& stack)
at System.Text.Json.JsonDocument.Parse(ReadOnlyMemory`1 utf8Json, JsonReaderOptions readerOptions, Byte[] extraRentedBytes)
at System.Text.Json.JsonDocument.Parse(ReadOnlyMemory`1 json, JsonDocumentOptions options)
at YoutubeExplode.Internal.Json.Parse(String source)
at YoutubeExplode.ReverseEngineering.Responses.WatchPage.TryGetPlayerConfig()
at YoutubeExplode.Videos.Streams.StreamClient.GetStreamContextFromWatchPageAsync(VideoId videoId)
at YoutubeExplode.Videos.Streams.StreamClient.GetManifestAsync(VideoId videoId)
at AudioChord.Extractors.YouTubeExtractor.ExtractSongAsync(String videoId, TimeSpan maximumDuration)
at AudioChord.MusicService.DownloadSongAsync(String url, Boolean ignoreCache)
at Railgun.Music.Scheduler.MusicScheduler.FetchSongAsync(SongId id) in /home/nekoputer/Github/Railgun/Railgun/Music/MusicScheduler.cs:line 225
--- End of inner exception stack trace ---
at Railgun.Music.Scheduler.MusicScheduler.RequestNextSongAsync() in /home/nekoputer/Github/Railgun/Railgun/Music/MusicScheduler.cs:line 78
at Railgun.Music.Player.StartAsync() in /home/nekoputer/Github/Railgun/Railgun/Music/Player.cs:line 148
Is it possible that YT changed something on their side again?
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 4
- Comments: 29 (7 by maintainers)
Commits related to this issue
- Update TryGetPlayerSourceUrl() Related to #479 — committed to Tyrrrz/YoutubeExplode by Tyrrrz 4 years ago
I tried to push a backwards-compatible fix for this. Let’s see if it actually works.
today I got the error back and the new nuget package fixed it- Thanks a lot!!!
FYI: But, I have some videos now who don’t have a working audio stream. YTExplode get an audio and video stream, but the audio stream is empty (wich also leads to a download error - no data). So probably there is still something going on? Lets wait and see.
FYI2: This video with no audio isn’t playable in vlc at all https://www.youtube.com/watch?v=cJ0WE4JkROA and libreelec can play it correctly.
code for the audio:
var streamInfoA = streamManifest.GetAudio() .Where(s => s.Container == Container.Mp4) .WithHighestBitrate();
Odd since it does play. Also I am getting the “‘a’ is an invalid start of a property name. Expected a '”'. LineNumber: 0 | BytePositionInLine: 1." error from GetManifestAsync, but this error is generated in GetSteamContextFromVideoInfoAsync > TryGetPlayerConfig which is called on line 49 in StreamClient. It is working on this emvbedPage but TryGetPlayerConfig returns null and so VideoUnplayableException.Unplayable(videoId) is executed. Though that method throws this; "Video ‘XJNTVdU7_vg’ is unplayable. Streams are not available for this video. In most cases, this error indicates that there are some restrictions in place that prevent watching this video.
Reason: " We still get the “a’ is an invalid” error out of GetManifestAsync.
yes. it is working for me as well. Even the one we extract the html is working too. Looks they are shifting between the two methods.
so in this kind of html, it is in ytplayer.config , args has raw_player_response:ytInitialPlayerResponse but you have to find the definitions for ytInitialPlayerResponse from one of the script block with var ytInitialPlayerResponse = {“responseContext”:{“serviceTrackingParams”:[{“service”:“GFEEDBACK”,“params”:[{“key”:"…
the sample html is: html.txt
Got same error again now, pasted 2 sites in html
ytError_html.zip
PS: vlc has also problems with the no Dash plain Youtube string as fallback, but not on all videos