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