We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0a01445 commit efabe09Copy full SHA for efabe09
background/sources/videos/youtube.js
@@ -68,10 +68,11 @@ export default {
68
data: { 'flow': 2 },
69
responseType: 'text',
70
});
71
- const key = 'window["ytInitialData"] = ';
+ const key = 'window["ytInitialData"] = JSON.parse("';
72
let response = body;
73
response = response.slice(response.indexOf(key) + key.length);
74
- response = response.slice(0, response.indexOf('}}};') + 3);
+ response = response.slice(0, response.indexOf('");\n'));
75
+ response = response.replace(/\\([\\"])/g, '$1');
76
try {
77
response = JSON.parse(response);
78
} catch (err) {
0 commit comments