mirror of
https://github.com/neosubhamoy/neodlp.git
synced 2025-12-19 15:32:59 +05:30
fix: infinite search loop due to yt-dlp fragment missing error on windows
This commit is contained in:
10
src/App.tsx
10
src/App.tsx
@@ -129,8 +129,14 @@ export default function App({ children }: { children: React.ReactNode }) {
|
||||
resolve(null);
|
||||
} else {
|
||||
try {
|
||||
const parsedData: RawVideoInfo = JSON.parse(jsonOutput);
|
||||
resolve(parsedData);
|
||||
const matchedJson = jsonOutput.match(/{.*}/);
|
||||
if (!matchedJson) {
|
||||
console.error(`Failed to match JSON: ${jsonOutput}`);
|
||||
resolve(null);
|
||||
return;
|
||||
}
|
||||
const parsedJson: RawVideoInfo = JSON.parse(matchedJson[0]);
|
||||
resolve(parsedJson);
|
||||
}
|
||||
catch (e) {
|
||||
console.error(`Failed to parse JSON: ${e}`);
|
||||
|
||||
Reference in New Issue
Block a user