Closed tuanbs closed 2 years ago
Seems like the Vietnamese
translation sends some content that is not valid UTF8 encoding, so that produces an error. (You can even see it if you try to navigate directly to the url trackInfo.url
).
I've fixed this in v1.10.10+2
by allowing malformed UTF8 as well, if would be nice if you could test if the text is correct, I cannot speak neither language so I can't help, thank you!
Hi @Hexer10 , thanks for the quick update. I've just tested with version 1.10.10+2
and got the same error when trying to get the translation of Vietnamese:
And when I tried to get the Bulgarian translation I got another error FormatException (FormatException: Missing extension byte (at offset 7506))
:
And when I tried to navigate directly to the url trackInfo.url
as you suggested, I got the Encoding error for both Vietnamese and Bulgarian translations:
@Hexer10 I see you speak Italian language, so I tried to find a YouTube video, that has this same error when getting the Italian translation, to see if you can help to fix this issue. When I get to this YouTube video and navigate directly to its trackInfo.url
, then I got the Encoding error for Italian translation:
Could you send me the code that are you running? I've just tried this and the subtitles were fetched correctly:
final yt = YoutubeExplode();
var manifest = await yt.videos.closedCaptions
.getManifest('https://www.youtube.com/watch?v=0D3oqL6Boew');
var trackInfo = manifest.tracks.first.autoTranslate('it');
print(trackInfo.url);
var track = await yt.videos.closedCaptions.getSubTitles(trackInfo);
print(track);
yt.close();
Also make sure you have the latest version.
Closing due to inactivity, please reopen if this still happens.
Describe the bug I got error
FormatException (FormatException: Unexpected extension byte (at offset 3912))
when trying to get the auto translations of Vietnamese and Bulgarian languages from this YouTube video:https://www.youtube.com/watch?v=LUBNGJZP8m4
To Reproduce
Enviroment: