Failing to download a video due to closed captions parsing error
See original GitHub issueVersion
v1.10.1
Platform
Windows 10
Steps to reproduce
Video URL: https://www.youtube.com/watch?v=TqxQru7bdt0
Download settings:
- 1080p (mp4)
Application settings:
- Nothing changed from the initial state.
Steps:
- Just download.
Details
Some videos fail to download. There seems to be something wrong with the subtitles.
Error message:
System.Xml.XmlException: Root element is missing.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo(String res)
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at System.Xml.XmlReader.MoveToContent()
at System.Xml.Linq.XElement.Load(XmlReader reader, LoadOptions options)
at System.Xml.Linq.XElement.Parse(String text, LoadOptions options)
at YoutubeExplode.Utils.Xml.Parse(String source) in /_/YoutubeExplode/Utils/Xml.cs:line 9
at YoutubeExplode.Bridge.ClosedCaptionTrackResponse.Parse(String raw) in /_/YoutubeExplode/Bridge/ClosedCaptionTrackResponse.cs:line 75
at YoutubeExplode.Videos.ClosedCaptions.ClosedCaptionController.GetClosedCaptionTrackResponseAsync(String url, CancellationToken cancellationToken) in /_/YoutubeExplode/Videos/ClosedCaptions/ClosedCaptionController.cs:line 25
at YoutubeExplode.Videos.ClosedCaptions.ClosedCaptionClient.GetClosedCaptionsAsync(ClosedCaptionTrackInfo trackInfo, CancellationToken cancellationToken)+MoveNext() in /_/YoutubeExplode/Videos/ClosedCaptions/ClosedCaptionClient.cs:line 68
at YoutubeExplode.Videos.ClosedCaptions.ClosedCaptionClient.GetClosedCaptionsAsync(ClosedCaptionTrackInfo trackInfo, CancellationToken cancellationToken)+System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult()
at YoutubeExplode.Utils.Extensions.AsyncCollectionExtensions.ToListAsync[T](IAsyncEnumerable`1 source) in /_/YoutubeExplode/Utils/Extensions/AsyncCollectionExtensions.cs:line 48
at YoutubeExplode.Utils.Extensions.AsyncCollectionExtensions.ToListAsync[T](IAsyncEnumerable`1 source) in /_/YoutubeExplode/Utils/Extensions/AsyncCollectionExtensions.cs:line 48
at YoutubeExplode.Videos.ClosedCaptions.ClosedCaptionClient.GetAsync(ClosedCaptionTrackInfo trackInfo, CancellationToken cancellationToken) in /_/YoutubeExplode/Videos/ClosedCaptions/ClosedCaptionClient.cs:line 121
at YoutubeExplode.Videos.ClosedCaptions.ClosedCaptionClient.WriteToAsync(ClosedCaptionTrackInfo trackInfo, TextWriter writer, IProgress`1 progress, CancellationToken cancellationToken) in /_/YoutubeExplode/Videos/ClosedCaptions/ClosedCaptionClient.cs:line 143
at YoutubeExplode.Videos.ClosedCaptions.ClosedCaptionClient.DownloadAsync(ClosedCaptionTrackInfo trackInfo, String filePath, IProgress`1 progress, CancellationToken cancellationToken) in /_/YoutubeExplode/Videos/ClosedCaptions/ClosedCaptionClient.cs:line 181
at YoutubeExplode.Converter.Converter.PopulateSubtitleInputsAsync(String baseFilePath, IReadOnlyList`1 closedCaptionTrackInfos, ICollection`1 subtitleInputs, IProgress`1 progress, CancellationToken cancellationToken) in /_/YoutubeExplode.Converter/Converter.cs:line 218
at YoutubeExplode.Converter.Converter.ProcessAsync(String filePath, Container container, IReadOnlyList`1 streamInfos, IReadOnlyList`1 closedCaptionTrackInfos, IProgress`1 progress, CancellationToken cancellationToken) in /_/YoutubeExplode.Converter/Converter.cs:line 264
at YoutubeExplode.Converter.ConversionExtensions.DownloadAsync(VideoClient videoClient, IReadOnlyList`1 streamInfos, IReadOnlyList`1 closedCaptionTrackInfos, ConversionRequest request, IProgress`1 progress, CancellationToken cancellationToken) in /_/YoutubeExplode.Converter/ConversionExtensions.cs:line 81
at YoutubeDownloader.Core.Downloading.VideoDownloader.DownloadVideoAsync(String filePath, IVideo video, VideoDownloadOption downloadOption, IProgress`1 progress, CancellationToken cancellationToken) in D:\a\YoutubeDownloader\YoutubeDownloader\YoutubeDownloader.Core\Downloading\VideoDownloader.cs:line 58
at YoutubeDownloader.ViewModels.Components.DashboardViewModel.<>c__DisplayClass31_0.<<EnqueueDownload>b__0>d.MoveNext() in D:\a\YoutubeDownloader\YoutubeDownloader\YoutubeDownloader\ViewModels\Components\DashboardViewModel.cs:line 110
Checklist
- I have looked through existing open and closed issues to make sure that this bug has not been reported before
- I have provided a descriptive title for this issue
- I have made sure that that this bug is reproducible on the latest version of the application
- I have provided all the information needed to reproduce this bug as efficiently as possible
- I have sponsored this project
Issue Analytics
- State:
- Created a month ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
7 Quick Fixes to 4K Video Downloader Can't Parse This Link
1. The internet connection is not working. · 2. The 4K Video Downloader you're using is outdated. · 3. The issue might be...
Read more >Solved! 4K Video Downloader Can't Parse This Link
Quick Fixes to 4K Video Downloader Can't Parse This Link · 1. Ensure the video is from supported sites. · 2. Check if...
Read more >I can't download a video with 4K Video Downloader, what ...
I can't download a video with 4K Video Downloader, what do I do? Can't parse link error can be solved through. Checking the...
Read more >How to Solve 4K Video Downloader Cannot ...
Best Solutions to Solve 4K Video Downloader Cannot Download/Parsing/Crash Errors. This post contains the various errors reported by 4k Video Downloader ...
Read more >How to Fix 4K Video Downloader Error: Can't Download?
This post focuses on 4K Video Downloader Error: Can't download, explaining why the issue appears and showing you how to troubleshoot it.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I tried again today and both the latest and CI builds successfully downloaded the video.✅
Other than that, I have some additional information that might help fix this bug that I will post later.
Hmm, I switched my location to Japan/Tokyo via VPN and I was able to download the video just fine:
You can try the latest CI build, e.g.: https://github.com/Tyrrrz/YoutubeDownloader/suites/15052712649/artifacts/859584208
But I don’t think there’s anything that changed related to that.